:root {
  --bg-void: #0B0B0E;
  --surface: #141418;
  --surface-low: #18181D;
  --surface-hover: #1C1C22;
  --surface-high: #23232B;
  --border: #26262F;
  --border-strong: #353542;
  --primary: #7C3AED;
  --primary-hover: #6E44FF;
  --primary-container: #221844;
  --primary-text: #A78BFA;
  --text: #F5F5F7;
  --text-muted: #8E8E9A;
  --error: #FB7185;
  --error-bg: #2E1218;
  --error-border: rgba(251, 113, 133, 0.45);
  --success: #34D399;
  --success-bg: #0E291E;
  --success-border: rgba(52, 211, 153, 0.25);
  --pending: #F59E0B;
  --pending-bg: #2B1E0D;
  --pending-border: rgba(245, 158, 11, 0.25);
  --neutral-bg: #1F1F26;
  --neutral-text: #A1A1AA;
  --radius-sm: 6px;
  --radius-base: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--bg-void);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  min-height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.page-shell--top {
  justify-content: flex-start;
  padding-top: 32px;
  padding-bottom: 40px;
}

.bio-container {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}

.approval-container {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
}

.legal-container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
}

.card--spacious {
  padding: 28px;
}

@media (max-width: 520px) {
  .card--spacious {
    padding: 20px;
  }
}

.center-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stack-md {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stack-lg {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Logo lockup */
.logo-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.logo-text-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.logo-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-subtitle {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.15;
  color: rgba(245, 245, 247, 0.68);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bio Page */
.bio-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 28px;
}

.bio-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  background-color: var(--primary-container);
  color: var(--accent-color, var(--primary-text));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
  border: 1px solid rgba(167, 139, 250, 0.2);
}

.bio-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
}

.bio-subtitle {
  margin: 6px 0 0 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 400px;
}

.bio-links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bio-link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: transform 120ms cubic-bezier(0.22, 1, 0.36, 1),
              border-color 120ms ease,
              background-color 120ms ease;
}

.bio-link-card:hover {
  background-color: var(--surface-hover);
  border-color: var(--border-strong);
}

.bio-link-card:active {
  transform: scale(0.97);
}

.bio-link-card--kaspi {
  border-color: var(--error-border);
}

.bio-link-card--kaspi:hover {
  border-color: rgba(251, 113, 133, 0.72);
}

.bio-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color, var(--primary));
  flex-shrink: 0;
}

.bio-link-label {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
}

.bio-link-chevron {
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.bio-footer {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.bio-footer-links {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

.bio-footer-links a:hover {
  color: var(--text);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  flex-shrink: 0;
}

.badge--success {
  background-color: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge--error {
  background-color: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(251, 113, 133, 0.25);
}

.badge--pending {
  background-color: var(--pending-bg);
  color: var(--pending);
  border: 1px solid var(--pending-border);
}

.badge--neutral {
  background-color: var(--neutral-bg);
  color: var(--neutral-text);
  border: 1px solid var(--border);
}

.badge--primary {
  background-color: var(--primary-container);
  color: var(--primary-text);
  border: 1px solid rgba(167, 139, 250, 0.25);
}

/* Approval Screen */
.approval-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.approval-brand-wl {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background-color: var(--surface-low);
  border: 1px solid var(--border);
  border-radius: var(--radius-base);
}

.lang-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn--active {
  background-color: var(--surface-high);
  color: var(--text);
}

.approval-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.approval-post-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

.approval-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.targets-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.post-body-box {
  padding: 16px;
  background-color: var(--surface-low);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
}

.feedback-note {
  padding: 10px 12px;
  background-color: var(--surface-low);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.form-textarea {
  width: 100%;
  min-height: 84px;
  padding: 12px;
  background-color: var(--surface-low);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-base);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.45;
  resize: vertical;
  outline: none;
  transition: border-color 120ms ease;
}

.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-textarea:focus {
  border-color: var(--primary);
}

.alert-banner {
  padding: 10px 12px;
  border-radius: var(--radius-base);
  font-size: 13px;
  font-weight: 500;
}

.alert-banner--success {
  background-color: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.alert-banner--error {
  background-color: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(251, 113, 133, 0.35);
}

/* Buttons */
.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 440px) {
  .btn-row {
    grid-template-columns: 1fr;
  }
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: var(--radius-base);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms cubic-bezier(0.22, 1, 0.36, 1),
              background-color 120ms ease,
              border-color 120ms ease,
              opacity 120ms ease;
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background-color: var(--primary);
  border: 1px solid var(--primary);
  color: #FFFFFF;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--surface-hover);
}

/* Legal Document */
.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legal-tab {
  padding: 6px 12px;
  border-radius: var(--radius-base);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background-color: var(--surface-low);
  transition: border-color 120ms ease, color 120ms ease, background-color 120ms ease;
}

.legal-tab:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.legal-tab--active {
  background-color: var(--primary-container);
  color: var(--primary-text);
  border-color: rgba(167, 139, 250, 0.35);
}

.legal-title {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

.legal-updated {
  margin: 4px 0 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.legal-section-heading {
  margin: 0 0 6px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.legal-section-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Skeleton Shimmer */
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton {
  background: linear-gradient(90deg, var(--surface-low) 25%, var(--surface-high) 50%, var(--surface-low) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: var(--radius-base);
}

.skeleton-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
}

.skeleton-line {
  height: 16px;
  width: 100%;
}

.skeleton-line--sm {
  height: 12px;
  width: 60%;
}

.skeleton-card {
  height: 54px;
  width: 100%;
  border-radius: var(--radius-md);
}

.icon-muted {
  color: var(--text-muted);
  display: inline-flex;
}

.icon-error {
  color: var(--error);
  display: inline-flex;
}

.state-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.state-desc {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}
