/* ═══════════════════════════════════════════════════════════════
   UniMate Auth v6 — Apple / Stripe / Google-tier Design
   100vh viewport-locked, zero scroll, perfect stepper
   ═══════════════════════════════════════════════════════════════ */

/* ── Tokens ───────────────────────────────────── */
:root {
  --au-primary: #0ea5e9;
  --au-primary-hover: #0284c7;
  --au-primary-soft: rgba(14,165,233,0.08);
  --au-primary-glow: rgba(14,165,233,0.35);
  --au-accent: #8b5cf6;
  --au-accent-soft: rgba(139,92,246,0.08);
  --au-bg: #f8fafc;
  --au-surface: #ffffff;
  --au-surface-glass: rgba(255,255,255,0.82);
  --au-surface-2: #f1f5f9;
  --au-text: #0f172a;
  --au-sub: #475569;
  --au-muted: #94a3b8;
  --au-border: rgba(226,232,240,0.7);
  --au-border-strong: #e2e8f0;
  --au-input-bg: #ffffff;
  --au-input-border: #e2e8f0;
  --au-focus: rgba(14,165,233,0.18);
  --au-ok: #10b981;
  --au-ok-soft: rgba(16,185,129,0.08);
  --au-err: #ef4444;
  --au-err-soft: rgba(239,68,68,0.06);
  --au-warn: #f59e0b;
  --au-r: 16px;
  --au-r-sm: 12px;
  --au-r-xs: 8px;
  --au-shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --au-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 24px rgba(0,0,0,0.03);
  --au-shadow-lg: 0 8px 40px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.03);
  --au-shadow-xl: 0 16px 48px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.03);
  --au-font: 'Exo 2', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --au-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --au-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --au-transition: 0.2s var(--au-ease);
}

/* ── Reset ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
a { color: inherit; text-decoration: none; }

/* ── Page — locked to 100vh ──────────────────── */
body.auth-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  background: var(--au-bg);
  color: var(--au-text);
  font-family: var(--au-font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* ── Animated Background ──────────────────────── */
.au-ambient {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  overflow: hidden;
}
.au-ambient::before,
.au-ambient::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.5;
  animation: au-float 25s ease-in-out infinite;
}
.au-ambient::before {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(14,165,233,0.08), transparent 70%);
  top: -20%; left: -10%;
}
.au-ambient::after {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(139,92,246,0.06), transparent 70%);
  bottom: -15%; right: -10%;
  animation-delay: -12s;
}
@keyframes au-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.05); }
  66% { transform: translate(-30px, 20px) scale(0.97); }
}

.au-ambient-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(14,165,233,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14,165,233,0.02) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 60% 50% at 50% 40%, black 10%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 40%, black 10%, transparent 70%);
}

/* ── Language Switch ──────────────────────────── */
.au-lang {
  position: fixed; top: 20px; right: 24px; z-index: 100;
}
.au-lang select {
  appearance: none;
  background: var(--au-surface-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--au-border);
  border-radius: 100px;
  padding: 7px 32px 7px 14px;
  font: inherit; font-size: 13px; font-weight: 500;
  color: var(--au-sub);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: all var(--au-transition);
  box-shadow: var(--au-shadow-sm);
}
.au-lang select:hover {
  border-color: var(--au-primary);
  box-shadow: 0 0 0 3px var(--au-focus);
}

/* ── Shell (two-column, full height) ──────────── */
.au-shell {
  display: grid;
  grid-template-columns: 1fr 480px;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

/* ── Hero (left panel) ───────────────────────── */
.au-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 64px 56px 64px 72px;
  position: relative;
  overflow: hidden;
}
.au-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(14,165,233,0.03) 0%, rgba(139,92,246,0.02) 100%);
  pointer-events: none;
}

.au-hero-brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 48px;
  position: relative;
}
.au-hero-brand img {
  width: 36px; height: 36px; border-radius: 10px;
  object-fit: cover;
}
.au-hero-brand span {
  font-size: 18px; font-weight: 700; color: var(--au-text);
  letter-spacing: -0.02em;
}
.logo-fb {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--au-primary), var(--au-accent));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
  box-shadow: 0 2px 12px rgba(14,165,233,0.25);
}

.au-hero h1 {
  font-size: clamp(32px, 3vw, 42px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin-bottom: 16px;
  color: var(--au-text);
  max-width: 480px;
  position: relative;
}

.au-hero > p {
  font-size: 16px; color: var(--au-sub); line-height: 1.65;
  max-width: 420px; margin-bottom: 40px;
  position: relative;
}

/* Feature rows */
.au-features {
  display: flex; flex-direction: column; gap: 20px;
  margin-bottom: 40px;
  position: relative;
}
.au-feat {
  display: flex; align-items: flex-start; gap: 14px;
  transition: transform var(--au-transition);
}
.au-feat:hover { transform: translateX(3px); }

.au-feat-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--au-surface);
  color: var(--au-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
  border: 1px solid var(--au-border);
  box-shadow: var(--au-shadow-sm);
  transition: all 0.3s var(--au-ease);
}
.au-feat:hover .au-feat-icon {
  box-shadow: 0 4px 16px rgba(14,165,233,0.12);
  border-color: rgba(14,165,233,0.2);
}
.au-feat-text { display: flex; flex-direction: column; gap: 1px; padding-top: 1px; }
.au-feat-text strong { font-size: 14px; font-weight: 650; color: var(--au-text); }
.au-feat-text span { font-size: 13px; color: var(--au-sub); line-height: 1.45; }

/* Stats row */
.au-stats {
  display: flex; gap: 32px; margin-bottom: 28px;
  position: relative;
}
.au-stat { display: flex; flex-direction: column; }
.au-stat strong {
  font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
  color: var(--au-primary);
}
.au-stat small {
  font-size: 11px; color: var(--au-muted); text-transform: uppercase;
  letter-spacing: 0.06em; font-weight: 600; margin-top: 2px;
}

/* Trust tags */
.au-trust { display: flex; flex-wrap: wrap; gap: 8px; position: relative; }
.au-trust-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: var(--au-surface);
  border: 1px solid var(--au-border);
  border-radius: 100px;
  font-size: 12px; font-weight: 550; color: var(--au-sub);
  transition: all 0.25s var(--au-ease);
  box-shadow: var(--au-shadow-sm);
}
.au-trust-tag:hover {
  border-color: rgba(14,165,233,0.25);
  transform: translateY(-1px);
}
.au-trust-tag i { font-size: 11px; color: var(--au-primary); }

/* ── Card (right panel) ──────────────────────── */
.au-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--au-surface);
  border-left: 1px solid var(--au-border);
  padding: 48px 44px;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Subtle top accent line */
.au-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--au-primary), var(--au-accent), var(--au-primary));
  background-size: 200% 100%;
  animation: au-shimmer 6s ease infinite;
  opacity: 0.6;
}
@keyframes au-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Card header */
.au-card-head { margin-bottom: 32px; }
.au-card-brand {
  display: none;
  align-items: center; gap: 10px;
  margin-bottom: 24px;
}
.au-card-brand img { width: 32px; height: 32px; border-radius: 10px; object-fit: cover; }
.au-card-brand span { font-size: 16px; font-weight: 700; }
.au-card-brand .logo-fb { width: 32px; height: 32px; font-size: 14px; border-radius: 10px; }

.au-card-title {
  font-size: 26px; font-weight: 750; color: var(--au-text);
  letter-spacing: -0.03em; margin-bottom: 6px;
}
.au-card-sub {
  font-size: 14px; color: var(--au-sub); margin: 0; line-height: 1.5;
}

/* ── Stepper v6 — clean, minimal, Apple-style ── */
.au-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}

.au-step {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 0 0 auto;
  position: relative;
}

/* Connector line between steps */
.au-step-line {
  width: 40px;
  height: 2px;
  background: var(--au-border-strong);
  border-radius: 1px;
  transition: background 0.4s var(--au-ease);
  flex-shrink: 0;
}
.au-step.completed .au-step-line {
  background: var(--au-ok);
}

.au-step-dot {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: var(--au-surface);
  border: 2px solid var(--au-border-strong);
  color: var(--au-muted);
  transition: all 0.35s var(--au-ease);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.au-step.active .au-step-dot {
  background: var(--au-primary);
  border-color: var(--au-primary);
  color: #fff;
  box-shadow: 0 0 0 4px var(--au-focus);
}

.au-step.completed .au-step-dot {
  background: var(--au-ok);
  border-color: var(--au-ok);
  color: #fff;
}

.au-step-label {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 600;
  color: var(--au-muted);
  white-space: nowrap;
  transition: color 0.3s var(--au-ease);
}
.au-step.active .au-step-label { color: var(--au-primary); }
.au-step.completed .au-step-label { color: var(--au-ok); }

/* Old stepper compat — hide old elements */
.au-step-num { display: none; }

/* ── Alerts ───────────────────────────────────── */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  border-radius: var(--au-r-sm);
  font-size: 13px; line-height: 1.5;
  margin-bottom: 20px;
  border: 1px solid transparent;
  position: relative; z-index: 1;
  animation: au-slideDown 0.3s var(--au-ease);
}
@keyframes au-slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.alert i { margin-top: 2px; flex-shrink: 0; font-size: 14px; }
.alert-danger {
  background: var(--au-err-soft);
  color: #b91c1c;
  border-color: rgba(239,68,68,0.12);
}
.alert-success {
  background: var(--au-ok-soft);
  color: #047857;
  border-color: rgba(16,185,129,0.12);
}
.alert-info {
  background: rgba(14,165,233,0.05);
  color: #0369a1;
  border-color: rgba(14,165,233,0.12);
}
.invite-banner { font-size: 13px; }
.invite-sub { opacity: 0.7; }

/* ── Form ─────────────────────────────────────── */
.au-form {
  display: none;
  flex-direction: column;
  gap: 20px;
  position: relative;
  z-index: 1;
}
.au-form.active {
  display: flex;
  animation: au-fadeIn 0.3s var(--au-ease);
}
@keyframes au-fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--au-text);
}
.form-label i { font-size: 12px; color: var(--au-primary); opacity: 0.6; }

.form-control {
  width: 100%;
  padding: 11px 14px;
  font: inherit; font-size: 14px;
  background: var(--au-input-bg);
  border: 1.5px solid var(--au-input-border);
  border-radius: var(--au-r-sm);
  color: var(--au-text);
  transition: border-color 0.2s var(--au-ease), box-shadow 0.2s var(--au-ease);
  outline: none;
}
.form-control::placeholder { color: var(--au-muted); font-weight: 400; }
.form-control:hover { border-color: #cbd5e1; }
.form-control:focus {
  border-color: var(--au-primary);
  box-shadow: 0 0 0 3px var(--au-focus);
}
.form-control.is-invalid { border-color: var(--au-err); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.12); }
.form-control.is-valid { border-color: var(--au-ok); }
.form-control.is-valid:focus { box-shadow: 0 0 0 3px rgba(16,185,129,0.12); }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
}

.form-hint {
  font-size: 12px; color: var(--au-muted); line-height: 1.4;
}

/* Password wrapper */
.input-pw { position: relative; }
.input-pw .form-control { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--au-muted);
  border-radius: var(--au-r-xs);
  transition: all 0.2s var(--au-ease);
}
.pw-toggle:hover {
  color: var(--au-primary);
  background: var(--au-primary-soft);
}

/* Password strength */
.pw-strength { display: flex; align-items: center; gap: 10px; }
.pw-bar {
  flex: 1; height: 4px;
  background: var(--au-border-strong);
  border-radius: 2px; overflow: hidden;
}
.pw-fill {
  height: 100%; width: 0;
  border-radius: 2px;
  transition: width 0.4s var(--au-ease), background 0.4s var(--au-ease);
}
.pw-fill[data-level="1"] { width: 25%; background: var(--au-err); }
.pw-fill[data-level="2"] { width: 50%; background: var(--au-warn); }
.pw-fill[data-level="3"] { width: 75%; background: #22c55e; }
.pw-fill[data-level="4"] { width: 100%; background: var(--au-ok); }
.pw-text {
  font-size: 11px; font-weight: 650; min-width: 50px;
  transition: color 0.3s var(--au-ease);
}
.pw-text[data-level="1"] { color: var(--au-err); }
.pw-text[data-level="2"] { color: var(--au-warn); }
.pw-text[data-level="3"] { color: #22c55e; }
.pw-text[data-level="4"] { color: var(--au-ok); }

/* ── Buttons ──────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px;
  font: inherit; font-size: 14px; font-weight: 650;
  border: none; border-radius: var(--au-r-sm);
  cursor: pointer;
  transition: all 0.2s var(--au-ease);
  text-decoration: none;
  width: 100%;
  position: relative;
}
.btn-primary {
  background: var(--au-primary);
  color: #fff;
  box-shadow: 0 1px 3px rgba(14,165,233,0.3), 0 4px 12px rgba(14,165,233,0.15);
}
.btn-primary:hover {
  background: var(--au-primary-hover);
  box-shadow: 0 2px 4px rgba(14,165,233,0.35), 0 6px 20px rgba(14,165,233,0.2);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-loading {
  pointer-events: none; opacity: 0.7;
}
.btn-loading::after {
  content: '';
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: au-spin 0.6s linear infinite;
  margin-left: 8px;
}
@keyframes au-spin { to { transform: rotate(360deg); } }

/* ── Form Tabs (login page) ───────────────────── */
.au-tabs {
  display: flex; gap: 0;
  margin-bottom: 28px;
  background: var(--au-surface-2);
  border-radius: var(--au-r-sm);
  padding: 3px;
  border: 1px solid var(--au-border);
  position: relative; z-index: 1;
}
.au-tab {
  flex: 1;
  padding: 9px 14px;
  font: inherit; font-size: 13px; font-weight: 600;
  background: none; border: none;
  border-radius: calc(var(--au-r-sm) - 2px);
  color: var(--au-muted);
  cursor: pointer;
  transition: all 0.2s var(--au-ease);
  text-align: center;
}
.au-tab:hover { color: var(--au-text); }
.au-tab.active {
  background: var(--au-surface);
  color: var(--au-primary);
  box-shadow: var(--au-shadow-sm);
  font-weight: 650;
}

/* ── Footer ───────────────────────────────────── */
.au-footer {
  text-align: center;
  padding-top: 20px;
  margin-top: 8px;
  border-top: 1px solid var(--au-border);
  position: relative; z-index: 1;
}
.au-footer p {
  font-size: 13px; color: var(--au-sub); margin: 4px 0;
}
.au-footer a {
  color: var(--au-primary);
  font-weight: 650;
  text-decoration: none;
  transition: color 0.2s var(--au-ease);
}
.au-footer a:hover { color: var(--au-primary-hover); text-decoration: underline; }

/* ── Terms ────────────────────────────────────── */
.terms-group { margin-top: 4px; }
.terms-label {
  display: flex; align-items: flex-start; gap: 10px;
  cursor: pointer; font-size: 13px; color: var(--au-sub);
  transition: color 0.2s var(--au-ease);
}
.terms-label:hover { color: var(--au-text); }
.terms-label input[type="checkbox"] {
  width: 18px; height: 18px; margin-top: 2px;
  accent-color: var(--au-primary);
  flex-shrink: 0;
  cursor: pointer;
}
.terms-label a { color: var(--au-primary); font-weight: 600; }
.terms-label a:hover { text-decoration: underline; }

/* ── Summary List (finalize step) ─────────────── */
.summary-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column;
}
.summary-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--au-border);
}
.summary-item:last-child { border-bottom: none; }
.summary-item > i {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--au-primary-soft);
  color: var(--au-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.summary-content { flex: 1; min-width: 0; }
.summary-label {
  font-size: 11px; color: var(--au-muted); text-transform: uppercase;
  letter-spacing: 0.04em; font-weight: 650;
}
.summary-value {
  font-size: 14px; color: var(--au-text); font-weight: 550;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Email Verification Code Input ───────────── */
.verify-code-wrap {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 8px 0;
}
.verify-code-wrap input {
  width: 48px; height: 56px;
  text-align: center;
  font-family: var(--au-font);
  font-size: 22px;
  font-weight: 700;
  border: 2px solid var(--au-border-strong);
  border-radius: var(--au-r-sm);
  background: var(--au-input-bg);
  color: var(--au-text);
  outline: none;
  transition: all 0.2s var(--au-ease);
  caret-color: var(--au-primary);
}
.verify-code-wrap input:focus {
  border-color: var(--au-primary);
  box-shadow: 0 0 0 3px var(--au-focus);
}
.verify-code-wrap input.filled {
  border-color: var(--au-primary);
  background: rgba(14,165,233,0.03);
}

.verify-info {
  text-align: center;
  font-size: 13px;
  color: var(--au-sub);
  line-height: 1.5;
}
.verify-info strong {
  color: var(--au-text);
  font-weight: 600;
}

.verify-resend {
  text-align: center;
  margin-top: 4px;
}
.verify-resend button {
  background: none;
  border: none;
  color: var(--au-primary);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s var(--au-ease);
}
.verify-resend button:hover {
  background: var(--au-primary-soft);
}
.verify-resend button:disabled {
  color: var(--au-muted);
  cursor: not-allowed;
  background: none;
}

/* ── NiceSelect overrides ─────────────────────── */
select.ns-hidden-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.nice-select {
  position: relative;
}
.nice-select .ns-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  background: var(--au-input-bg);
  border: 1.5px solid var(--au-input-border);
  border-radius: var(--au-r-sm);
  padding: 11px 14px;
  font: inherit; font-size: 14px;
  color: var(--au-text);
  transition: border-color 0.2s var(--au-ease), box-shadow 0.2s var(--au-ease);
}
.nice-select .ns-value {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nice-select .ns-arrow {
  flex-shrink: 0;
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--au-muted, #94a3b8);
  transition: transform 0.2s ease;
}
.nice-select.open .ns-arrow {
  transform: rotate(180deg);
}
.nice-select .ns-control:hover { border-color: #cbd5e1; }
.nice-select.open .ns-control,
.nice-select .ns-control:focus {
  border-color: var(--au-primary);
  box-shadow: 0 0 0 3px var(--au-focus);
}
.nice-select .ns-dropdown {
  display: none;
  position: absolute;
  left: 0; right: 0;
  top: 100%;
  z-index: 100;
  background: var(--au-surface);
  border: 1px solid var(--au-border);
  border-radius: var(--au-r-sm);
  box-shadow: var(--au-shadow-lg);
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
}
.nice-select.open .ns-dropdown {
  display: block;
}
.nice-select .ns-search {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid var(--au-border);
  font: inherit; font-size: 13px;
  background: var(--au-surface);
  color: var(--au-text);
  outline: none;
}
.nice-select .ns-option {
  padding: 9px 14px;
  font-size: 13px;
  color: var(--au-text);
  cursor: pointer;
  transition: background 0.15s var(--au-ease);
}
.nice-select .ns-option:hover { background: var(--au-primary-soft); }
.nice-select .ns-option.selected {
  background: rgba(14,165,233,0.08);
  color: var(--au-primary);
  font-weight: 600;
}
.nice-select .ns-group-label {
  padding: 7px 14px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--au-muted);
  background: var(--au-surface-2);
}

/* ── Turnstile ────────────────────────────────── */
.cf-turnstile { margin: 4px 0; position: relative; z-index: 1; }

/* ═══════════════════════════════════════════════
   Dark Theme
   ═══════════════════════════════════════════════ */
.theme-dark body.auth-page,
.theme-dark.auth-page {
  --au-primary: #38bdf8;
  --au-primary-hover: #0ea5e9;
  --au-primary-soft: rgba(56,189,248,0.1);
  --au-accent: #a78bfa;
  --au-bg: #060a14;
  --au-surface: rgba(17,24,39,0.95);
  --au-surface-glass: rgba(17,24,39,0.7);
  --au-surface-2: rgba(15,22,41,0.8);
  --au-text: #f1f5f9;
  --au-sub: #94a3b8;
  --au-muted: #64748b;
  --au-border: rgba(148,163,184,0.1);
  --au-border-strong: rgba(148,163,184,0.18);
  --au-input-bg: rgba(15,23,42,0.8);
  --au-input-border: rgba(148,163,184,0.16);
  --au-focus: rgba(56,189,248,0.18);
  --au-ok-soft: rgba(16,185,129,0.1);
  --au-err-soft: rgba(239,68,68,0.1);
  --au-shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --au-shadow: 0 1px 3px rgba(0,0,0,0.3), 0 4px 24px rgba(0,0,0,0.15);
  --au-shadow-lg: 0 8px 40px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.15);
  --au-shadow-xl: 0 16px 48px rgba(0,0,0,0.4), 0 4px 12px rgba(0,0,0,0.2);
}

.theme-dark .au-ambient::before {
  background: radial-gradient(circle, rgba(56,189,248,0.06), transparent 70%);
}
.theme-dark .au-ambient::after {
  background: radial-gradient(circle, rgba(139,92,246,0.04), transparent 70%);
}
.theme-dark .au-ambient-grid {
  background-image:
    linear-gradient(rgba(56,189,248,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56,189,248,0.015) 1px, transparent 1px);
}

.theme-dark .au-hero h1 { color: var(--au-text); }

.theme-dark .au-card {
  background: var(--au-surface);
  border-left-color: rgba(148,163,184,0.06);
}

.theme-dark .au-feat-icon {
  background: rgba(56,189,248,0.08);
  border-color: rgba(56,189,248,0.1);
}

.theme-dark .logo-fb {
  box-shadow: 0 2px 12px rgba(56,189,248,0.2);
}

.theme-dark .btn-primary {
  background: #0ea5e9;
  box-shadow: 0 1px 3px rgba(14,165,233,0.4), 0 4px 12px rgba(14,165,233,0.2);
}

.theme-dark .alert-danger { background: rgba(127,29,29,0.2); color: #fca5a5; border-color: rgba(185,28,28,0.2); }
.theme-dark .alert-success { background: rgba(6,78,59,0.2); color: #6ee7b7; border-color: rgba(4,120,87,0.2); }
.theme-dark .alert-info { background: rgba(12,74,110,0.2); color: #7dd3fc; border-color: rgba(14,165,233,0.15); }

.theme-dark .nice-select .ns-arrow { border-top-color: rgba(148,163,184,0.5); }
.theme-dark .nice-select .ns-control { background: var(--au-input-bg); border-color: var(--au-input-border); color: var(--au-text); }
.theme-dark .nice-select .ns-dropdown { background: #111827; border-color: rgba(148,163,184,0.1); }
.theme-dark .nice-select .ns-search { background: #111827; color: var(--au-text); border-bottom-color: rgba(148,163,184,0.08); }
.theme-dark .nice-select .ns-option { color: var(--au-text); }
.theme-dark .nice-select .ns-option:hover { background: rgba(56,189,248,0.08); }
.theme-dark .nice-select .ns-option.selected { background: rgba(56,189,248,0.12); color: #7dd3fc; }
.theme-dark .nice-select .ns-group-label { background: rgba(15,23,42,0.6); color: var(--au-muted); }

.theme-dark .summary-item > i { background: rgba(56,189,248,0.08); }

.theme-dark .au-tab.active { background: rgba(56,189,248,0.1); color: var(--au-primary); box-shadow: none; }

.theme-dark .au-trust-tag { background: rgba(15,22,41,0.6); border-color: rgba(148,163,184,0.08); }

.theme-dark .verify-code-wrap input { background: var(--au-input-bg); border-color: var(--au-input-border); color: var(--au-text); }
.theme-dark .verify-code-wrap input:focus { border-color: var(--au-primary); }
.theme-dark .verify-code-wrap input.filled { background: rgba(56,189,248,0.05); border-color: var(--au-primary); }

/* ═══════════════════════════════════════════════
   Responsive — Tablet
   ═══════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .au-shell {
    grid-template-columns: 1fr 420px;
  }
  .au-hero {
    padding: 48px 40px;
  }
  .au-hero h1 { font-size: 30px; }
}

/* ═══════════════════════════════════════════════
   Responsive — Mobile (≤768px)
   Full single-column, card-first layout
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  body.auth-page {
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: auto;
    display: block;
    -webkit-overflow-scrolling: touch;
  }

  .au-ambient::before { width: 400px; height: 400px; top: -15%; left: -20%; }
  .au-ambient::after  { width: 350px; height: 350px; bottom: -10%; right: -15%; }

  .au-lang {
    position: fixed; top: 12px; right: 12px; z-index: 200;
  }
  .au-lang select {
    padding: 6px 28px 6px 10px;
    font-size: 12px;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    background-color: var(--au-surface-glass);
  }

  .au-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
  }

  /* Hide hero on mobile — card is primary */
  .au-hero { display: none; }

  .au-card {
    flex: 1;
    border-left: none;
    padding: 24px 20px 40px;
    padding-top: max(24px, env(safe-area-inset-top, 0px));
    justify-content: flex-start;
    overflow-y: auto;
    background: var(--au-bg);
    min-height: 100vh;
    min-height: 100dvh;
  }

  .au-card::before {
    height: 3px;
    background: linear-gradient(90deg, var(--au-primary), var(--au-accent));
    opacity: 1;
    animation: none;
  }

  /* Show mobile brand */
  .au-card-brand {
    display: flex !important;
    margin-bottom: 20px;
    justify-content: center;
  }
  .au-card-brand img { width: 40px; height: 40px; border-radius: 12px; }
  .au-card-brand .logo-fb { width: 40px; height: 40px; font-size: 16px; border-radius: 12px; }
  .au-card-brand span { font-size: 18px; }

  .au-card-head {
    text-align: center;
    margin-bottom: 24px;
  }
  .au-card-title {
    font-size: 24px;
    letter-spacing: -0.02em;
  }
  .au-card-sub {
    font-size: 14px;
    max-width: 320px;
    margin: 0 auto;
  }

  /* Stepper — compact horizontal */
  .au-stepper {
    margin-bottom: 24px;
    justify-content: center;
    gap: 0;
    padding: 0 8px;
  }
  .au-step-dot {
    width: 28px; height: 28px;
    font-size: 11px;
  }
  .au-step-line {
    width: 28px;
  }
  .au-step-label {
    font-size: 9px;
    top: calc(100% + 4px);
  }

  /* Form adjustments */
  .au-form { gap: 16px; }
  .form-control {
    padding: 12px 14px;
    font-size: 16px; /* Prevents iOS zoom */
    border-radius: var(--au-r-sm);
  }
  select.form-control { font-size: 16px; }

  .form-label { font-size: 13px; }

  .btn {
    padding: 14px 20px;
    font-size: 15px;
    border-radius: var(--au-r-sm);
  }

  .alert {
    font-size: 13px;
    padding: 12px 14px;
    border-radius: var(--au-r-sm);
  }

  /* Verification code */
  .verify-code-wrap { gap: 8px; }
  .verify-code-wrap input {
    width: 42px; height: 50px;
    font-size: 20px;
    border-radius: var(--au-r-xs);
  }

  /* Summary list */
  .summary-item { padding: 8px 0; gap: 10px; }
  .summary-item > i { width: 28px; height: 28px; font-size: 12px; border-radius: 7px; }
  .summary-value { font-size: 13px; }
  .summary-label { font-size: 10px; }

  /* Terms */
  .terms-label { font-size: 13px; gap: 8px; }
  .terms-label input[type="checkbox"] { width: 20px; height: 20px; }

  /* Footer */
  .au-footer {
    padding-top: 16px;
    margin-top: 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  }
  .au-footer p { font-size: 14px; }

  /* NiceSelect mobile */
  .nice-select .ns-control { padding: 12px 14px; font-size: 16px; }
  .nice-select .ns-dropdown {
    max-height: 200px;
    border-radius: var(--au-r-sm);
    box-shadow: var(--au-shadow-xl);
  }
  .nice-select .ns-search { padding: 12px 14px; font-size: 16px; }
  .nice-select .ns-option { padding: 11px 14px; font-size: 14px; }

  /* Password strength */
  .pw-strength { gap: 8px; }
  .pw-bar { height: 5px; }

  /* Turnstile */
  .cf-turnstile { transform: scale(0.9); transform-origin: left; }
}

/* ═══════════════════════════════════════════════
   Responsive — Small phones (≤400px)
   ═══════════════════════════════════════════════ */
@media (max-width: 400px) {
  .au-card { padding: 20px 16px 32px; }
  .au-card-title { font-size: 22px; }
  .au-step-line { width: 20px; }
  .au-step-dot { width: 26px; height: 26px; font-size: 10px; }
  .verify-code-wrap input { width: 38px; height: 46px; font-size: 18px; }
  .hm-btn, .btn { padding: 13px 16px; font-size: 14px; }
}

/* ── Accessibility ────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--au-primary);
  outline-offset: 2px;
}
