/* EnrollAI auth — KlinikaHub-inspired light default + dark option */
:root,
[data-theme="light"] {
  --aa-bg: #ffffff;
  --aa-fg: #111827;
  --aa-muted: #4b5563;
  --aa-border: #e5e7eb;
  --aa-card: #ffffff;
  --aa-input-bg: #ffffff;
  --aa-input-border: #e5e7eb;
  --aa-blue: #2563eb;
  --aa-blue-hover: #1d4ed8;
  --aa-sky: #3b82f6;
  --aa-ok: #10b981;
  --aa-danger: #dc2626;
  --aa-surface: #f8fafc;
  --aa-chip-bg: #f3f4f6;
  --aa-top-bg: rgba(255, 255, 255, 0.72);
  --aa-shadow: 0 8px 32px rgba(15, 23, 42, 0.08), 0 2px 8px rgba(15, 23, 42, 0.04);
  --aa-blob-a: rgba(37, 99, 235, 0.16);
  --aa-blob-b: rgba(16, 185, 129, 0.16);
  --aa-font: "Satoshi", Inter, system-ui, sans-serif;
  --aa-serif: "Instrument Serif", Georgia, serif;
}

[data-theme="dark"] {
  --aa-bg: hsl(240 10% 4%);
  --aa-fg: hsl(0 0% 98%);
  --aa-muted: hsl(0 0% 63.9%);
  --aa-border: hsl(0 0% 14.9%);
  --aa-card: hsl(0 0% 6%);
  --aa-input-bg: hsl(0 0% 7%);
  --aa-input-border: hsl(0 0% 16%);
  --aa-blue: #3b82f6;
  --aa-blue-hover: #2563eb;
  --aa-sky: #38bdf8;
  --aa-ok: #4ade80;
  --aa-danger: #f87171;
  --aa-surface: hsl(0 0% 100% / 0.03);
  --aa-chip-bg: hsl(0 0% 8%);
  --aa-top-bg: hsl(240 10% 4% / 0.72);
  --aa-shadow: 0 24px 80px -32px hsl(0 0% 0% / 0.65);
  --aa-blob-a: rgba(59, 130, 246, 0.18);
  --aa-blob-b: rgba(6, 182, 212, 0.12);
}

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

.aa-body {
  margin: 0;
  min-height: 100vh;
  background: var(--aa-bg);
  color: var(--aa-fg);
  font-family: var(--aa-font);
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* KlinikaHub soft blob background */
.aa-body::before,
.aa-body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  z-index: 0;
  pointer-events: none;
}
.aa-body::before {
  top: -10%;
  left: -10%;
  width: 45vw;
  height: 45vw;
  background: var(--aa-blob-a);
}
.aa-body::after {
  top: 15%;
  right: -12%;
  width: 40vw;
  height: 40vw;
  background: var(--aa-blob-b);
}

.aa-skip {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--aa-blue);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
}
.aa-skip:focus { left: 8px; color: #fff; }

.aa-shell-solo {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.aa-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #60a5fa, #2563eb);
  color: #fff;
  font-size: 14px;
  flex-shrink: 0;
}

.aa-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--aa-border);
  background: var(--aa-top-bg);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.aa-top-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--aa-fg);
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
}
.aa-top-sep { color: var(--aa-muted); font-weight: 400; }
.aa-top-tenant { font-weight: 500; color: var(--aa-muted); font-size: 14px; }
@media (max-width: 640px) {
  .aa-top-sep, .aa-top-tenant { display: none; }
}
.aa-top-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}
.aa-top-nav a {
  color: var(--aa-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
}
.aa-top-nav a:hover { color: var(--aa-fg); }
.aa-theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--aa-border);
  background: var(--aa-card);
  color: var(--aa-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.aa-theme-btn:hover { color: var(--aa-fg); border-color: #cbd5e1; }
.aa-top-cta {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  color: #fff !important;
  background: var(--aa-blue);
  font-weight: 600;
  box-shadow: 0 8px 20px -8px rgba(37, 99, 235, 0.45);
}
.aa-top-cta:hover { background: var(--aa-blue-hover); color: #fff !important; }

.aa-main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

/* Hero for register */
.aa-hero {
  text-align: center;
  margin-bottom: 28px;
}
.aa-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--aa-fg);
}
.aa-hero h1 em,
.aa-hero h1 .aa-accent {
  font-style: normal;
  color: var(--aa-blue);
}
.aa-hero p {
  margin: 0 auto;
  max-width: 42rem;
  color: var(--aa-muted);
  font-size: 16px;
  line-height: 1.6;
}
.aa-trust {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  margin-top: 1.5rem;
}
.aa-trust span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--aa-muted);
  font-size: 14px;
  font-weight: 500;
}
.aa-trust i { color: var(--aa-ok); }

/* Wizard layout */
.aa-wizard {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .aa-wizard { grid-template-columns: 1fr; }
}

.aa-steps-side {
  position: sticky;
  top: 5rem;
  padding: 1.25rem 1rem;
}
.aa-step-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
  color: #9ca3af;
  font-size: 14px;
  font-weight: 600;
  position: relative;
}
.aa-step-pill:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 15px;
  top: 42px;
  width: 2px;
  height: calc(100% - 8px);
  background: #e5e7eb;
}
[data-theme="dark"] .aa-step-pill:not(:last-child)::after { background: hsl(0 0% 18%); }
.aa-step-pill.is-done:not(:last-child)::after { background: var(--aa-ok); }
.aa-step-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f3f4f6;
  color: #9ca3af;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  z-index: 1;
  flex-shrink: 0;
}
[data-theme="dark"] .aa-step-badge { background: hsl(0 0% 14%); }
.aa-step-pill.is-active { color: var(--aa-blue); }
.aa-step-pill.is-active .aa-step-badge {
  background: var(--aa-blue);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}
.aa-step-pill.is-done { color: var(--aa-ok); }
.aa-step-pill.is-done .aa-step-badge {
  background: var(--aa-ok);
  color: #fff;
}

@media (max-width: 900px) {
  .aa-steps-side {
    position: static;
    padding: 0;
    margin-bottom: 12px;
  }
  .aa-steps-side .aa-step-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
  }
  .aa-step-pill {
    padding: 0.45rem 0.9rem 0.45rem 0.45rem;
    border-radius: 999px;
    background: var(--aa-card);
    border: 1px solid var(--aa-border);
  }
  .aa-step-pill:not(:last-child)::after { display: none; }
  .aa-step-pill.is-active {
    background: #eef2ff;
    border-color: #c7d2fe;
  }
  [data-theme="dark"] .aa-step-pill.is-active {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.35);
  }
  .aa-step-badge { width: 24px; height: 24px; font-size: 12px; }
}

/* —— Mobile register enhancements —— */
.aa-hero-kicker {
  display: none;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--aa-muted);
}
.aa-hero-lead { /* inherits .aa-hero p */ }
.aa-mobile-progress { display: none; }

@media (max-width: 720px) {
  .aa-main {
    padding: 20px 16px 48px;
  }

  .aa-top {
    padding: 10px 14px;
    gap: 10px;
  }
  .aa-top-brand span:not(.aa-logo) {
    font-size: 15px;
  }
  .aa-top-nav a:not(.aa-top-cta) {
    display: none;
  }
  .aa-top-cta {
    height: 34px;
    padding: 0 12px;
    font-size: 13px;
  }

  .aa-hero {
    text-align: left;
    margin-bottom: 18px;
  }
  .aa-hero-kicker { display: block; }
  .aa-hero h1 {
    font-size: clamp(1.35rem, 6.2vw, 1.75rem);
    margin-bottom: 8px;
    line-height: 1.2;
  }
  .aa-hero p,
  .aa-hero-lead {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
  }
  .aa-trust {
    justify-content: flex-start;
    gap: 8px;
    margin-top: 12px;
  }
  .aa-trust span {
    font-size: 12px;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--aa-border);
    background: var(--aa-card);
  }

  .aa-mobile-progress {
    display: block;
    margin-bottom: 10px;
  }
  .aa-mobile-progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
  }
  .aa-mobile-progress-meta strong {
    font-size: 13px;
    font-weight: 700;
    color: var(--aa-fg);
  }
  .aa-mobile-progress-track {
    height: 6px;
    border-radius: 999px;
    background: var(--aa-border);
    overflow: hidden;
  }
  .aa-mobile-progress-track > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--aa-blue), #60a5fa);
    transition: width 0.25s ease;
  }

  .aa-steps-side .aa-step-list {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    gap: 0.4rem;
    padding: 2px 2px 10px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .aa-steps-side .aa-step-list::-webkit-scrollbar { display: none; }

  .aa-step-pill {
    flex: 0 0 auto;
    scroll-snap-align: center;
    min-height: 40px;
    padding: 0.35rem 0.7rem 0.35rem 0.35rem;
  }
  .aa-step-pill:not(.is-active) .aa-step-pill-label {
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    margin: 0;
    padding: 0;
  }
  .aa-step-pill:not(.is-active) {
    padding: 0.35rem;
    gap: 0;
  }
  .aa-step-pill.is-active .aa-step-pill-label {
    max-width: 8rem;
    opacity: 1;
  }
  .aa-step-pill.is-done:not(.is-active) .aa-step-pill-label {
    max-width: 0;
  }

  .aa-card {
    border-radius: 18px;
    padding: 1.15rem 1rem 1.35rem;
  }
  .aa-step-heading {
    font-size: 1.2rem;
    margin-bottom: 6px;
  }
  .aa-step-sub {
    font-size: 13px;
    margin-bottom: 1rem;
  }

  .aa-grid-3,
  .aa-grid-2 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .aa-nav {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 10px;
    margin-top: 1.25rem;
  }
  .aa-nav > div {
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }
  .aa-nav .aa-btn {
    width: 100%;
    min-height: 48px;
  }

  .aa-otp {
    gap: 6px;
    margin: 10px 0 16px;
  }
  .aa-otp input {
    max-width: none;
    height: 48px;
    font-size: 18px;
    border-radius: 10px;
  }

  .aa-face-stage {
    max-width: none;
    border-radius: 16px;
  }
  .aa-face-actions {
    flex-direction: column;
  }
  .aa-face-actions .aa-btn {
    width: 100%;
  }

  .aa-verify-progress {
    flex-wrap: wrap;
    gap: 8px;
  }

  .aa-body::before,
  .aa-body::after {
    width: 70vw;
    height: 70vw;
    filter: blur(70px);
  }
}

@media (max-width: 380px) {
  .aa-hero h1 { font-size: 1.25rem; }
  .aa-otp input { height: 44px; font-size: 16px; }
  .aa-trust { gap: 6px; }
  .aa-trust span { padding: 5px 8px; font-size: 11px; }
}

.aa-card {
  width: 100%;
  background: var(--aa-card);
  border: 1px solid var(--aa-border);
  border-radius: 24px;
  padding: 2rem 2.25rem 2.25rem;
  box-shadow: var(--aa-shadow);
}
.aa-login-wrap {
  max-width: 480px;
  margin: 0 auto;
  padding-top: 24px;
}
.aa-login-wrap .aa-card { padding: 2.25rem; }

.aa-card h1,
.aa-step-heading {
  margin: 0 0 8px;
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--aa-fg);
}
.aa-step-heading em {
  font-family: var(--aa-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--aa-blue);
}
.aa-sub,
.aa-step-sub {
  margin: 0 0 1.5rem;
  color: var(--aa-muted);
  font-size: 14px;
  line-height: 1.55;
}

.aa-alert {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.45;
}
.aa-alert-danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.aa-alert-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; }
.aa-role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 8px;
}
.aa-role-grid.aa-role-grid-single {
  grid-template-columns: 1fr;
  max-width: 420px;
}
@media (max-width: 720px) {
  .aa-role-grid { grid-template-columns: 1fr; }
}
.aa-role-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  padding: 18px 16px;
  border-radius: 16px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: inherit;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease;
}
.aa-role-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 8px 24px rgba(37, 99, 235, .1);
  transform: translateY(-1px);
}
.aa-role-card.is-selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
  background: #eff6ff;
}
.aa-role-card strong { font-size: 15px; font-weight: 700; }
.aa-role-card > span:last-child { font-size: 13px; color: #64748b; line-height: 1.4; }
.aa-role-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #e0e7ff;
  color: #3730a3;
  font-size: 18px;
}
[data-theme="dark"] .aa-role-card {
  background: hsl(0 0% 10%);
  border-color: hsl(0 0% 20%);
}
[data-theme="dark"] .aa-role-card.is-selected {
  background: hsl(217 91% 60% / 0.12);
  border-color: #60a5fa;
}
[data-theme="dark"] .aa-role-card > span:last-child { color: #a3a3a3; }
[data-theme="dark"] .aa-role-icon { background: hsl(217 91% 60% / 0.2); color: #93c5fd; }

.aa-alert-info { background: #eef2ff; border: 1px solid #c7d2fe; color: #1e40af; }
.aa-alert-warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
[data-theme="dark"] .aa-alert-danger { background: hsl(0 70% 50% / 0.12); border-color: hsl(0 70% 50% / 0.35); color: #fecaca; }
[data-theme="dark"] .aa-alert-success { background: hsl(142 70% 40% / 0.12); border-color: hsl(142 70% 40% / 0.35); color: #bbf7d0; }
[data-theme="dark"] .aa-alert-info { background: hsl(217 91% 60% / 0.12); border-color: hsl(217 91% 60% / 0.3); color: #bfdbfe; }
[data-theme="dark"] .aa-alert-warn { background: hsl(43 96% 40% / 0.12); border-color: hsl(43 96% 40% / 0.35); color: #fde68a; }
.aa-existing { display: flex; flex-direction: column; gap: 12px; margin-bottom: 1rem; }
.aa-existing[hidden],
#aaExistingAlert[hidden] { display: none !important; }
.aa-existing-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.aa-existing-actions .aa-btn { margin: 0; }
.aa-alert code { font-weight: 700; letter-spacing: 0.1em; }

.aa-wizard-pane { display: none; }
.aa-wizard-pane.is-active { display: block; }

.aa-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.aa-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 720px) {
  .aa-grid-3, .aa-grid-2 { grid-template-columns: 1fr; }
  .aa-card { padding: 1.5rem; border-radius: 18px; }
}

.aa-field { margin-bottom: 1rem; }
.aa-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}
[data-theme="dark"] .aa-label { color: #e5e5e5; }
.aa-label .req { color: #dc2626; }
.aa-label .opt { color: var(--aa-muted); font-weight: 400; font-size: 12px; }
.aa-hint { margin: 0.4rem 0 0; font-size: 12px; color: var(--aa-muted); line-height: 1.45; }

.aa-input {
  width: 100%;
  height: 48px;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--aa-input-border);
  background: var(--aa-input-bg);
  color: var(--aa-fg);
  font-size: 14px;
  font-family: Inter, system-ui, sans-serif;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.aa-input::placeholder { color: #9ca3af; }
.aa-input:focus {
  border-color: var(--aa-blue);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}
.aa-input.is-invalid { border-color: #f87171; }
.aa-input-wrap { position: relative; }
.aa-input-wrap .aa-input { padding-right: 48px; }
.aa-toggle-pw {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--aa-muted);
  cursor: pointer;
}
.aa-toggle-pw:hover { color: var(--aa-fg); background: rgba(15, 23, 42, 0.04); }

.aa-strength { display: flex; gap: 6px; margin-top: 10px; }
.aa-strength i {
  flex: 1; height: 4px; border-radius: 999px; background: #e5e7eb;
}
[data-theme="dark"] .aa-strength i { background: hsl(0 0% 16%); }
.aa-strength[data-level="1"] i:nth-child(1) { background: #ef4444; }
.aa-strength[data-level="2"] i:nth-child(-n+2) { background: #f59e0b; }
.aa-strength[data-level="3"] i:nth-child(-n+3) { background: #84cc16; }
.aa-strength[data-level="4"] i { background: #22c55e; }
.aa-strength-label { margin-top: 8px; font-size: 12px; color: var(--aa-muted); }

.aa-privacy {
  border: 1px solid var(--aa-border);
  border-radius: 12px;
  background: var(--aa-surface);
  margin-bottom: 14px;
  overflow: hidden;
}
.aa-privacy summary {
  cursor: pointer;
  padding: 14px 16px;
  font-size: 13px;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.aa-privacy summary::-webkit-details-marker { display: none; }
.aa-privacy[open] summary { border-bottom: 1px solid var(--aa-border); }
.aa-privacy-body {
  padding: 14px 16px;
  font-size: 12px;
  color: var(--aa-muted);
  line-height: 1.55;
  max-height: 140px;
  overflow: auto;
}

.aa-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 8px 0 18px;
  font-size: 13px;
  color: var(--aa-muted);
  line-height: 1.5;
  cursor: pointer;
}
.aa-consent input {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  accent-color: var(--aa-blue);
}

.aa-dpa-layer1 {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--aa-border);
  border-radius: 12px;
  background: #eff6ff;
  font-size: 13px;
  line-height: 1.45;
  color: var(--aa-fg);
}
.aa-dpa-layer1 strong { display: block; margin-bottom: 6px; }
.aa-dpa-layer1 p { margin: 0 0 8px; color: var(--aa-muted); }
.aa-dpa-layer1 a { font-weight: 600; }

.aa-age-callout {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #c7d2fe;
  background: #eef2ff;
  color: #312e81;
  font-size: 13px;
  line-height: 1.45;
}
.aa-age-callout p { margin: 6px 0 0; }
.aa-age-callout.aa-age-under_13 {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #7f1d1d;
}
.aa-age-callout.aa-age-teen {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #78350f;
}
.aa-age-callout.aa-age-adult {
  border-color: #86efac;
  background: #f0fdf4;
  color: #14532d;
}

.aa-esign {
  margin: 1rem 0 1.25rem;
  padding: 12px;
  border: 1px dashed var(--aa-border);
  border-radius: 12px;
}
.aa-esign-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.aa-esign-tabs .is-esign-active {
  border-color: var(--aa-blue);
  color: var(--aa-blue);
}
.aa-sign-canvas {
  width: 100%;
  max-width: 640px;
  height: 160px;
  border: 1px solid var(--aa-border);
  border-radius: 10px;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}

.aa-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 1.75rem;
  padding-top: 0.25rem;
}
.aa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.aa-btn:hover { transform: translateY(-1px); }
.aa-btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.aa-btn-primary {
  color: #fff;
  background: var(--aa-blue);
  border: none;
  box-shadow: 0 10px 24px -10px rgba(37, 99, 235, 0.55);
}
.aa-btn-primary:hover { background: var(--aa-blue-hover); color: #fff; }
.aa-btn-primary:disabled,
.aa-btn.is-otp-done:disabled {
  color: #94a3b8 !important;
  background: #e2e8f0 !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: none !important;
  opacity: 1;
  pointer-events: none;
}
.aa-btn-primary:disabled:hover,
.aa-btn.is-otp-done:disabled:hover {
  background: #e2e8f0 !important;
  color: #94a3b8 !important;
  transform: none;
}
.aa-btn-ghost {
  color: var(--aa-fg);
  background: #fff;
  border-color: var(--aa-border);
}
[data-theme="dark"] .aa-btn-ghost {
  background: transparent;
  color: var(--aa-fg);
}
.aa-btn-ghost:hover { background: #f3f4f6; color: var(--aa-fg); }
[data-theme="dark"] .aa-btn-ghost:hover { background: hsl(0 0% 100% / 0.06); }
.aa-btn-block { width: 100%; }

.aa-foot {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 13px;
  color: var(--aa-muted);
}
.aa-foot a { color: var(--aa-blue); text-decoration: none; font-weight: 600; }
.aa-foot a:hover { color: var(--aa-blue-hover); }

.aa-demo {
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px solid var(--aa-border);
  background: var(--aa-surface);
}
.aa-demo-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
}
.aa-demo-head code {
  color: var(--aa-blue);
  background: rgba(37, 99, 235, 0.08);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 12px;
}
.aa-demo-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.aa-chip {
  border: 1px solid var(--aa-border);
  background: var(--aa-chip-bg);
  color: var(--aa-fg);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.aa-chip:hover,
.aa-chip.is-active {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.08);
  color: var(--aa-blue);
}

.aa-review {
  display: grid;
  gap: 10px;
  margin-bottom: 1rem;
}
.aa-review-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--aa-border);
  font-size: 14px;
}
.aa-review-row dt { color: var(--aa-muted); font-weight: 500; }
.aa-review-row dd { margin: 0; color: var(--aa-fg); font-weight: 600; }
@media (max-width: 520px) {
  .aa-review-row { grid-template-columns: 1fr; gap: 4px; }
}

/* OTP */
.aa-otp {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin: 12px 0 22px;
}
.aa-otp input {
  width: 100%;
  max-width: 56px;
  height: 56px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  border-radius: 12px;
  border: 1px solid var(--aa-input-border);
  background: var(--aa-input-bg);
  color: var(--aa-fg);
  outline: none;
}
.aa-otp input:focus {
  border-color: var(--aa-blue);
  box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.15);
}
.aa-email-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #1e40af;
  font-size: 13px;
  margin-bottom: 18px;
  word-break: break-all;
}
[data-theme="dark"] .aa-email-chip {
  background: hsl(217 91% 60% / 0.12);
  border-color: hsl(217 91% 60% / 0.25);
  color: #bfdbfe;
}
.aa-resend-note {
  text-align: center;
  font-size: 12px;
  color: var(--aa-muted);
  margin-top: 8px;
}

[data-theme="dark"] .aa-theme-btn .bi-moon-stars { display: none; }
[data-theme="dark"] .aa-theme-btn .bi-sun { display: inline; }
[data-theme="light"] .aa-theme-btn .bi-sun,
:root:not([data-theme="dark"]) .aa-theme-btn .bi-sun { display: none; }
[data-theme="light"] .aa-theme-btn .bi-moon-stars,
:root:not([data-theme="dark"]) .aa-theme-btn .bi-moon-stars { display: inline; }

/* Face capture */
.aa-face { margin-bottom: 0.5rem; }
.aa-face-stage {
  position: relative;
  width: 100%;
  max-width: 360px;
  margin: 0 auto 1rem;
  aspect-ratio: 1;
  border-radius: 20px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid var(--aa-border);
}
.aa-face-stage video,
.aa-face-stage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.aa-face-stage video { transform: scaleX(-1); }
.aa-face-guide {
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 2px dashed rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 999px rgba(15, 23, 42, 0.35);
  pointer-events: none;
}
.aa-face-status {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  color: #fff;
  background: linear-gradient(transparent, rgba(15, 23, 42, 0.85));
  text-align: center;
}
.aa-face-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 1rem;
}
.aa-face-upload { cursor: pointer; }
.aa-face-tips {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--aa-muted);
  font-size: 13px;
  line-height: 1.5;
  max-width: 36rem;
}
.aa-face-tips li { margin-bottom: 4px; }
.aa-review-face {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 1rem;
}
.aa-review-face img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #e0e7ff;
  box-shadow: var(--aa-shadow);
}

.aa-verify-progress {
  display: flex;
  gap: 10px;
  margin: 0 0 1rem;
}
.aa-verify-progress span {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--aa-border);
  font-size: 12px;
  font-weight: 600;
  color: var(--aa-muted);
  background: var(--aa-surface);
}
.aa-verify-progress span.is-active {
  color: var(--aa-blue);
  border-color: #c7d2fe;
  background: #eef2ff;
}
.aa-verify-progress span.is-done {
  color: var(--aa-ok);
  border-color: #a7f3d0;
  background: #ecfdf5;
}

#aaRegOtpNext[hidden],
#aaRegOtpNext:disabled {
  display: none !important;
}
#aaRegOtpNext.is-unlocked:not([hidden]):not(:disabled) {
  display: inline-flex !important;
}
.ap-face-thumb {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #c7d2fe;
  flex-shrink: 0;
}

/* —— University signup —— */
.aa-uni-wrap .aa-card { max-width: 560px; }
.aa-optional { font-weight: 400; color: var(--aa-muted); font-size: 12px; }
.aa-textarea { min-height: 96px; resize: vertical; padding-top: 12px; padding-bottom: 12px; }
.aa-uni-plans {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 8px 0 20px;
}
.aa-uni-plan {
  display: grid;
  place-items: center;
  min-height: 56px;
  border-radius: 14px;
  border: 1px solid var(--aa-border);
  background: var(--aa-surface);
  color: var(--aa-fg);
  font-weight: 600;
  text-decoration: none;
}
.aa-uni-plan:hover {
  border-color: var(--aa-blue);
  color: var(--aa-blue);
}
.aa-choice-grid {
  display: grid;
  gap: 12px;
  margin: 8px 0 8px;
}
.aa-choice {
  display: grid;
  gap: 6px;
  padding: 18px 16px;
  border-radius: 16px;
  border: 1px solid var(--aa-border);
  background: var(--aa-surface);
  color: var(--aa-fg);
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
.aa-choice:hover {
  border-color: var(--aa-blue);
  transform: translateY(-1px);
  color: var(--aa-fg);
}
.aa-choice-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #eef2ff;
  color: var(--aa-blue);
  margin-bottom: 4px;
}
.aa-choice strong { font-size: 16px; }
.aa-choice span:last-child {
  font-size: 13px;
  line-height: 1.5;
  color: var(--aa-muted);
}
.aa-field-help {
  font-size: 13px;
  color: var(--aa-muted);
}
.aa-field-help a {
  color: var(--aa-blue);
  text-decoration: none;
  font-weight: 600;
}
.aa-field-help a:hover { text-decoration: underline; }
.aa-otp-channel {
  border: 0;
  padding: 0;
  margin: 0 0 1rem;
}
.aa-otp-channel legend {
  padding: 0;
  margin-bottom: 8px;
}
.aa-channel-grid {
  display: grid;
  gap: 10px;
}
.aa-channel-option {
  display: block;
  cursor: pointer;
}
.aa-channel-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.aa-channel-card {
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 2px;
  align-items: start;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--aa-border);
  background: var(--aa-surface);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.aa-channel-card i {
  grid-row: 1 / span 2;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #eef2ff;
  color: var(--aa-blue);
  font-size: 16px;
}
.aa-channel-card strong {
  font-size: 15px;
  color: var(--aa-fg);
}
.aa-channel-card span {
  font-size: 12px;
  line-height: 1.4;
  color: var(--aa-muted);
}
.aa-channel-option input:checked + .aa-channel-card {
  border-color: var(--aa-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.aa-channel-option input:focus-visible + .aa-channel-card {
  outline: 2px solid var(--aa-blue);
  outline-offset: 2px;
}
@media (max-width: 520px) {
  .aa-uni-plans { grid-template-columns: 1fr; }
}
