/* ============================================================================
   Auth UI — Design System (Linear / Minimal style)
   Variables → Reset → Layout → Card → Brand → Form →
   Input → Button → OTP → Banner → Social → Legal → Animations
   ============================================================================ */

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --primary:            #6c47ff;
  --primary-foreground: #ffffff;
  --primary-hover:      color-mix(in srgb, var(--primary) 85%, #000);
  --primary-subtle:     color-mix(in srgb, var(--primary) 10%, transparent);

  --bg:          #f7f7f6;
  --surface:     #ffffff;
  --border:      #e8e8e4;
  --border-focus: var(--primary);

  --text:        #0f0f0e;
  --text-muted:  #6b6b6b;
  --text-subtle: #9b9b9b;

  --err:         #dc2626;
  --err-subtle:  color-mix(in srgb, #dc2626 10%, transparent);
  --ok:          #16a34a;
  --ok-subtle:   color-mix(in srgb, #16a34a 12%, transparent);

  --radius-sm:   6px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-full: 9999px;

  /* Button: always near-black on light theme */
  --btn-bg:  #141414;
  --btn-fg:  #ffffff;
  --btn-bg-hover: #2d2d2d;

  /* Input background (borderless style) */
  --input-bg: color-mix(in srgb, var(--bg) 60%, var(--surface));

  --shadow-card:  0 1px 4px 0 rgb(0 0 0 / .05), 0 6px 24px -4px rgb(0 0 0 / .09);
  --shadow-input: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);

  --transition: 150ms ease;
  --font: system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root:not([data-auth-theme="light"]) {
    --bg:      #0a0a0d;
    --surface: #101015;
    --border:  #24242e;
    --text:    #f0f0f5;
    --text-muted:  #9ca3af;
    --text-subtle: #6b7280;
    --shadow-card: 0 1px 4px 0 rgb(0 0 0 / .3), 0 6px 24px -4px rgb(0 0 0 / .3);
    --input-bg: color-mix(in srgb, var(--bg) 60%, var(--surface));
    /* Button inverts in dark mode for visibility */
    --btn-bg:       #e8e8e6;
    --btn-fg:       #0f0f0e;
    --btn-bg-hover: #d0d0ce;
  }
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button { cursor: pointer; font: inherit; border: none; background: none; }
a { color: inherit; text-decoration: none; }
input { font: inherit; }
svg { display: block; }
/* Prevents display:flex/block rules from overriding [hidden]'s display:none */
[hidden] { display: none !important; }

/* Screen-reader only */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Page layout ────────────────────────────────────────────────────────────── */
.auth-body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.auth-root {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 40px;
}

.auth-main-shell {
  width: 100%;
  max-width: 470px;
}

/* ── v2 split layout (desktop only) ─────────────────────────────────────────── */
/* v1: wrapper is transparent, layout unchanged */
.auth-form-col { display: contents; }

/* v2: two columns — wider left marketing panel + right form column */
.auth-root--split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  padding: 0;
  min-height: 100dvh;
}

.auth-root--split .auth-form-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  min-height: 100dvh;
}

/* Left panel — dark hero with subtle grid pattern + divider */
.auth-side {
  position: relative;
  overflow: hidden;
  color: #e6edf6;
  background:
    radial-gradient(120% 90% at 15% 0%, #10213c 0%, #0a1628 55%, #070f1e 100%);
  border-right: 1px solid var(--border);
  display: flex;
}

.auth-side::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, #ffffff 4%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, #ffffff 4%, transparent) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(130% 100% at 30% 20%, #000 45%, transparent 100%);
  pointer-events: none;
}

/* primaryColor glow — sits behind the badge + title, the only accent in dark mode */
.auth-side::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 55% at 34% 40%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 68%);
  pointer-events: none;
}

/* Dark mode: drop the navy background, keep only the glow (matches page black) */
@media (prefers-color-scheme: dark) {
  :root:not([data-auth-theme="light"]) .auth-side { background: var(--bg); }
}

.auth-side__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 40px;
  width: 100%;
  max-width: 760px;
  margin: 0;
  padding: 56px clamp(36px, 3vw, 52px);
}

.auth-side__brand { display: flex; align-items: center; }
.auth-side__logo { height: 40px; width: auto; max-width: 220px; object-fit: contain; }
.auth-side__brandname { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; color: #fff; }

.auth-side__body { display: flex; flex-direction: column; gap: 24px; margin-top: auto; }

/* Badge above the title */
.auth-side__badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  padding: 9px 20px;
  border: 1px solid color-mix(in srgb, var(--primary) 42%, transparent);
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--primary) 7%, transparent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
}

.auth-side__badge-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
}

/* Radar-ping pulse around the dot */
.auth-side__badge-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--primary);
  animation: badge-dot-ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes badge-dot-ping {
  0%   { transform: scale(1);   opacity: 0.55; }
  70%, 100% { transform: scale(2.8); opacity: 0; }
}

.auth-side__headline {
  font-size: clamp(34px, 3vw, 44px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.auth-side__accent { color: var(--primary); }

.auth-side__sub {
  font-size: 17px;
  line-height: 1.6;
  color: color-mix(in srgb, #e6edf6 62%, transparent);
  max-width: 600px;
}

.auth-side__features {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-side__features li {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 16px;
  color: color-mix(in srgb, #e6edf6 88%, transparent);
}

.auth-side__ficon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 32%, transparent);
  color: var(--primary);
}

.auth-side__ficon svg { width: 14px; height: 14px; }

/* Stats row */
.auth-side__stats {
  display: flex;
  gap: clamp(24px, 2.5vw, 44px);
  margin-top: auto;
}

.auth-side__stat { display: flex; flex-direction: column; gap: 4px; }

.auth-side__statnum {
  font-family: var(--font-mono);
  font-size: clamp(18px, 1.6vw, 21px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--primary);
}

.auth-side__statlabel {
  font-family: var(--font-mono);
  font-size: 11px;
  color: color-mix(in srgb, #e6edf6 45%, transparent);
}

/* v2 desktop: logo already lives in the left panel — hide the in-card brand header */
@media (min-width: 961px) {
  .auth-root--split .auth-brand { display: none; }
}

/* Collapse to single centered card below desktop — v1 look on mobile/tablet */
@media (max-width: 960px) {
  .auth-root--split { grid-template-columns: 1fr; padding: 24px 16px 40px; }
  .auth-root--split .auth-side { display: none; }
  .auth-root--split .auth-form-col { padding: 0; min-height: 100dvh; }
}

/* ── Card — frameless: elements sit directly on the page, no boxed look ──────── */
.auth-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  width: 100%;
  animation: auth-card-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ── Brand header (logo + name row) ────────────────────────────────────────── */
.auth-brand {
  margin-bottom: 20px;
}

.auth-brand--row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Logo shown when branded */
.auth-logo {
  height: 70px;
  width: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: var(--radius-sm);
  display: none;
}

.auth-logo.is-visible { display: block; }

/* Brand name text */
.auth-brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1;
}

/* Badge — hidden in this design */
.auth-badge { display: none !important; }

/* Step badge (e.g. "Step 1 of 2") */
.auth-step-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--input-bg);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  margin-bottom: 10px;
}

/* ── Title + subtitle ───────────────────────────────────────────────────────── */
.auth-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 4px;
}

.auth-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

.auth-sub.auth-status--error {
  color: var(--err);
  font-weight: 500;
}

/* ── Navigation ─────────────────────────────────────────────────────────────── */
.auth-nav {
  margin-bottom: 12px;
}

.auth-nav-back__a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
  transition: color var(--transition);
}

.auth-nav-back__a:hover { color: var(--text); }

.auth-links-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 13.5px;
}

.auth-links-row--center {
  justify-content: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.auth-footer__muted { color: var(--text-muted); }

.auth-link-muted {
  color: var(--primary);
  font-weight: 600;
  transition: color var(--transition);
}

.auth-link-muted:hover { color: var(--primary-hover); }

/* Segmented tabs now own login↔register switching — hide the redundant text links */
.auth-links-row--center:has(#btn-goto-register),
.auth-links-row--center:has(#btn-goto-login-from-register),
.auth-links-row--center:has(#btn-goto-register-from-pl),
.auth-links-row--center:has(#btn-pl-goto-login) { display: none; }

/* ── Segmented Sign In / Create Account tabs ────────────────────────────────── */
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  margin-bottom: 28px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.auth-tab {
  height: 46px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.auth-tab:not(.is-active):hover { color: var(--text); }

.auth-tab.is-active {
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 2px 10px -2px color-mix(in srgb, var(--primary) 50%, transparent);
}

/* Dark mode off (forced light): neutral white pill, no accent color */
:root[data-auth-theme="light"] .auth-tab.is-active {
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.10), 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* ── Trust badges ───────────────────────────────────────────────────────────── */
.auth-trust {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-subtle);
}

.auth-trust span { display: inline-flex; align-items: center; gap: 6px; }
.auth-trust svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ── Form ───────────────────────────────────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.field label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.field__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.field__aux-action {
  font-size: 12.5px;
  color: var(--text-muted);
  transition: color var(--transition);
}

.field__aux-action:hover { color: var(--primary); }

/* Forgot password link row (below password input) */
.auth-forgot-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
  margin-bottom: 4px;
}

.auth-forgot-row a {
  font-size: 12.5px;
  color: var(--text-muted);
  transition: color var(--transition);
}

.auth-forgot-row a:hover { color: var(--primary); }

.field__error {
  font-size: 12.5px;
  color: var(--err);
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 5px;
}

.field__error::before {
  content: '';
  display: inline-block;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  margin-top: 1px;
  background-color: var(--err);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Ccircle cx='8' cy='8' r='7' stroke='currentColor' stroke-width='1.5'/%3E%3Cpath d='M8 5v3.5' stroke='currentColor' stroke-width='1.5' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='11' r='.75' fill='currentColor'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Ccircle cx='8' cy='8' r='7' stroke='currentColor' stroke-width='1.5'/%3E%3Cpath d='M8 5v3.5' stroke='currentColor' stroke-width='1.5' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='11' r='.75' fill='currentColor'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
}

.field-hint {
  font-size: 12.5px;
  color: var(--text-subtle);
}

/* Password strength bar */
.auth-pw-strength {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.auth-pw-strength__seg {
  height: 3px;
  flex: 1;
  border-radius: var(--radius-full);
  background: var(--border);
  transition: background 0.25s ease;
}

.auth-pw-strength__seg.is-weak   { background: #ef4444; }
.auth-pw-strength__seg.is-fair   { background: #f59e0b; }
.auth-pw-strength__seg.is-strong { background: #16a34a; }

.field--error .input { border-color: var(--err) !important; }
.field--error .auth-otp-digit { border-color: var(--err) !important; }

/* ── Input — light filled with leading icon ─────────────────────────────────── */
.input {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1.5px solid rgba(0, 0, 0, 0.10);
  border-radius: 10px;
  background-color: #ffffff;
  color: #16161a;
  font-size: 15px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}

/* Leading icons by input type (CSS-only, no markup change) */
.input[type="email"],
.input[type="password"] {
  background-repeat: no-repeat;
  background-position: 16px center;
  background-size: 18px 18px;
  padding-left: 44px;
}

.input[type="email"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239096a2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='16' x='2' y='4' rx='2'/%3E%3Cpath d='m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7'/%3E%3C/svg%3E");
}

.input[type="password"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239096a2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
}

.input::placeholder { color: #9096a2; }

.input:hover:not(:disabled) { border-color: rgba(0, 0, 0, 0.18); }

.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}

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

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrap .input { padding-right: 46px; }

/* ── Password toggle ────────────────────────────────────────────────────────── */
.btn-toggle-password {
  position: absolute;
  right: 0;
  top: 0;
  height: 100%;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9096a2;
  transition: color var(--transition);
  border-radius: 0 10px 10px 0;
}

.btn-toggle-password:hover { color: #16161a; }

.btn-toggle-password__eye-off { display: none; }
.btn-toggle-password.is-active .btn-toggle-password__eye { display: none; }
.btn-toggle-password.is-active .btn-toggle-password__eye-off { display: block; }

/* ── Button ─────────────────────────────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  padding: 0 20px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  background: var(--primary);
  color: var(--primary-foreground);
  box-shadow: 0 6px 20px -6px color-mix(in srgb, var(--primary) 55%, transparent);
  transition: background var(--transition), box-shadow var(--transition), opacity var(--transition), transform 80ms ease;
  user-select: none;
  white-space: nowrap;
}

/* Arrow after label on primary buttons (hidden while loading) */
.btn:not(.btn--secondary):not(.is-loading)::after {
  content: "";
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
}

.btn:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: 0 8px 26px -6px color-mix(in srgb, var(--primary) 65%, transparent);
}
.btn:active:not(:disabled) { transform: scale(0.985); }

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn--secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  font-weight: 500;
}

.btn--secondary:hover:not(:disabled) {
  background: var(--input-bg);
  color: var(--text);
  border-color: color-mix(in srgb, var(--border) 60%, var(--text));
}

/* Button loading — animated dots overlay */
.btn.is-loading {
  pointer-events: none;
  position: relative;
  color: transparent !important;
  opacity: 1 !important; /* keep full opacity; :disabled normally dims to 0.4 */
}

/* Overlay fills the button, flex-centres the dots — no transform needed */
.btn.is-loading::before {
  content: '• • •';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-foreground);
  font-size: 11px;
  letter-spacing: 3px;
  animation: btn-loading-dots 1.1s ease-in-out infinite;
}

.btn--secondary.is-loading::before {
  color: var(--text-muted);
}

@keyframes btn-loading-dots {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 1;   }
}

/* ── Secondary action (e.g. Resend button below form) ───────────────────────── */
.auth-secondary-action {
  margin-top: 8px;
}

/* ── Action hint (e.g. "not verified" nudge below login error) ──────────────── */
.auth-action-hint {
  margin-top: 10px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.auth-action-hint a {
  color: var(--primary);
  font-weight: 500;
  margin-left: 4px;
}

/* ── Form summary error ─────────────────────────────────────────────────────── */
.auth-form-summary {
  font-size: 13px;
  padding: 10px 13px;
  border-radius: var(--radius-md);
  line-height: 1.5;
  animation: field-err-in 0.2s ease both;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.auth-form-summary--error {
  color: var(--err);
  background: var(--err-subtle);
  border-left: 3px solid var(--err);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.auth-form-summary--error::before {
  content: '';
  display: block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 1px;
  background-color: var(--err);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Ccircle cx='8' cy='8' r='7' stroke='currentColor' stroke-width='1.5'/%3E%3Cpath d='M8 5v3.5' stroke='currentColor' stroke-width='1.5' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='11' r='.75' fill='currentColor'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Ccircle cx='8' cy='8' r='7' stroke='currentColor' stroke-width='1.5'/%3E%3Cpath d='M8 5v3.5' stroke='currentColor' stroke-width='1.5' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='11' r='.75' fill='currentColor'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
}

/* ── OTP ─────────────────────────────────────────────────────────────────────── */
.auth-otp-wrap { width: 100%; }

.auth-otp-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-otp-digit {
  width: 48px;
  height: 56px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  background: var(--input-bg);
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  outline: none;
  caret-color: var(--primary);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.auth-otp-digit:hover:not(:disabled) {
  background: color-mix(in srgb, var(--input-bg) 80%, var(--surface));
}

.auth-otp-digit:focus {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-input);
  background: var(--surface);
}

.auth-otp-sep {
  font-size: 20px;
  color: var(--text-subtle);
  user-select: none;
  padding: 0 2px;
}

@media (max-width: 380px) {
  .auth-otp-digit { width: 38px; height: 46px; font-size: 18px; }
  .auth-otp-row { gap: 5px; }
}

/* Verify-email resend row */
.auth-verify-resend {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  justify-content: center;
}

.auth-text-link {
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  transition: opacity var(--transition);
  display: inline;
}

.auth-text-link:hover { opacity: 0.75; }
.auth-text-link:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Banner ──────────────────────────────────────────────────────────────────── */
.banner {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  font-size: 13px;
  font-weight: 500;
  transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease, margin 0.3s ease;
  margin-bottom: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.banner.is-visible {
  max-height: 80px;
  opacity: 1;
  padding: 10px 13px;
  margin-bottom: 12px;
}

.banner--success {
  color: var(--ok);
  background: var(--ok-subtle);
  border-left: 3px solid var(--ok);
}

.banner--success::before {
  content: '';
  display: block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 1px;
  background-color: var(--ok);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Ccircle cx='8' cy='8' r='7' stroke='currentColor' stroke-width='1.5'/%3E%3Cpath d='M5 8l2 2 4-4' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Ccircle cx='8' cy='8' r='7' stroke='currentColor' stroke-width='1.5'/%3E%3Cpath d='M5 8l2 2 4-4' stroke='currentColor' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
}

/* ── Spinner ─────────────────────────────────────────────────────────────────── */
.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 16px auto;
}

/* ── Social / Google ─────────────────────────────────────────────────────────── */
.auth-social { margin-top: 16px; }

.auth-divider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: var(--text-subtle);
}

.auth-divider-row::before,
.auth-divider-row::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 42px;
  padding: 0 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: background var(--transition), border-color var(--transition);
}

.btn-google:hover { background: var(--input-bg); }

.btn-google-icon {
  width: 18px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath fill='%234285F4' d='M23.49 12.27c0-.87-.07-1.7-.2-2.5H12v4.73h6.47c-.28 1.52-1.12 2.8-2.38 3.66v3.04h3.85c2.25-2.07 3.55-5.13 3.55-8.93z'/%3E%3Cpath fill='%2334A853' d='M12 24c3.24 0 5.95-1.07 7.93-2.9l-3.85-3.04c-1.07.72-2.44 1.14-4.08 1.14-3.14 0-5.79-2.12-6.74-4.97H1.28v3.14C3.25 21.44 7.31 24 12 24z'/%3E%3Cpath fill='%23FBBC05' d='M5.26 14.23A7.2 7.2 0 0 1 4.82 12c0-.77.13-1.52.44-2.23V6.63H1.28A12 12 0 0 0 0 12c0 1.94.46 3.77 1.28 5.37l3.98-3.14z'/%3E%3Cpath fill='%23EA4335' d='M12 4.75c1.77 0 3.35.61 4.6 1.8l3.44-3.44C17.94 1.19 15.23 0 12 0 7.31 0 3.25 2.56 1.28 6.63l3.98 3.14C6.21 6.87 8.86 4.75 12 4.75z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

/* ── Legal ───────────────────────────────────────────────────────────────────── */
.auth-legal {
  font-size: 12px;
  color: var(--text-subtle);
  text-align: center;
  line-height: 1.6;
  margin-top: 20px;
}

.auth-legal a {
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: text-decoration-color var(--transition), color var(--transition);
}

.auth-legal a:hover {
  color: var(--text);
  text-decoration-color: currentColor;
}

/* ── Field error animation ───────────────────────────────────────────────────── */
.field__error:not([hidden]) {
  animation: field-err-in 0.2s ease both;
}

/* ── Step transitions (signup multi-step) ────────────────────────────────────── */
@keyframes step-enter-forward {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes step-enter-back {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}

.auth-step--enter-forward { animation: step-enter-forward 0.28s cubic-bezier(0.22, 1, 0.36, 1) both; }
.auth-step--enter-back    { animation: step-enter-back    0.28s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* Progressive field reveal (OTP → password) */
.auth-reveal {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.28s ease;
}
.auth-reveal.is-visible {
  max-height: 120px;
  opacity: 1;
}

/* ── Animations ──────────────────────────────────────────────────────────────── */
@keyframes auth-card-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes field-err-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes auth-shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

.auth-shake { animation: auth-shake 0.38s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }

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

/* ── Print ───────────────────────────────────────────────────────────────────── */
@media print {
  .auth-root { background: white; }
  .btn, .auth-social, .auth-nav, .auth-links-row, .auth-forgot-row { display: none; }
  .auth-card { box-shadow: none; border: 1px solid #ddd; }
}
