/* ============================================
   SIGN-IN PAGES (login, register, forgot, reset, verify, sign out, email change)
   Phone first: the form is the whole screen, like an app. Tablet: a centered card.
   1024px and up: the form card plus a "cosmic" side panel with Cassy.
   Matches the home page: lavender background, white cards with thin borders, brand purple.
   Every animation stops for people who ask for reduced motion.
   ============================================ */

:root {
  --au-purple: var(--brand, #5b2fb8);
  --au-purple-dark: var(--brand-dark, #3f1f86);
  --au-purple-light: #7c5cd6;
  --au-lavender: var(--brand-soft, #f4effe);
  --au-ink: var(--brand-ink, #1f1636);
  --au-muted: #5d5575;
  --au-faint: #8a83a3;
  --au-line: rgba(91, 47, 184, 0.16);
  --au-line-strong: rgba(91, 47, 184, 0.32);
  --au-error: #c4264a;
  --au-error-soft: #fff1f4;
  --au-ok: #12805c;
  --au-ok-soft: #ecfaf4;
  --au-warn: #9a5b00;
  --au-warn-soft: #fff7e6;
  --au-radius: 14px;
  --au-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- page frame ---------- */
/* Anything marked hidden stays hidden, whatever display rule it has. */
.auth-shell [hidden] { display: none !important; }

.auth-skip {
  position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; border-radius: 10px;
  background: var(--au-ink); color: #fff; font-weight: 700; text-decoration: none; transition: top 0.15s ease;
}
.auth-skip:focus { top: 12px; }

.auth-shell {
  position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--au-lavender) 0%, #fbf9ff 46%, #ffffff 100%);
  color: var(--au-ink); overflow-x: clip;
}
/* Faint star dust behind everything. */
.auth-sky {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.55;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, rgba(91, 47, 184, 0.45), transparent 60%),
    radial-gradient(1px 1px at 78% 12%, rgba(91, 47, 184, 0.35), transparent 60%),
    radial-gradient(1.5px 1.5px at 64% 72%, rgba(124, 92, 214, 0.35), transparent 60%),
    radial-gradient(1px 1px at 28% 86%, rgba(91, 47, 184, 0.3), transparent 60%),
    radial-gradient(1.2px 1.2px at 90% 54%, rgba(124, 92, 214, 0.4), transparent 60%);
}

.auth-top {
  position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; max-width: 1240px; margin: 0 auto; padding: 12px 16px;
}
.auth-brand { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; color: var(--au-ink); text-decoration: none; font-weight: 800; font-size: 17px; min-height: 44px; }
.auth-brand img { width: 32px; height: 32px; }
.auth-top-links { display: flex; align-items: center; gap: 6px; }
.auth-pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 12px; border-radius: 999px;
  background: #fff; border: 1px solid var(--au-line); color: var(--au-purple); font-size: 14px; font-weight: 700; text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.auth-pill:hover { border-color: var(--au-line-strong); box-shadow: 0 4px 14px rgba(63, 31, 134, 0.1); transform: translateY(-1px); }
.auth-pill .ai-icon { width: 16px; height: 16px; }
.auth-pill-ghost { background: transparent; border-color: transparent; color: var(--au-muted); }
/* On small phones the "back" pill keeps only its arrow. */
@media (max-width: 519px) {
  .auth-pill-ghost { width: 40px; padding: 8px; justify-content: center; }
  .auth-pill-ghost span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 359px) { .auth-brand span { font-size: 15px; } .auth-pill { padding: 8px 10px; } }

.auth-main {
  position: relative; z-index: 1; flex: 1; display: grid; width: 100%; max-width: 1240px; margin: 0 auto;
  padding: 4px 0 24px; outline: none;
}
.auth-panel { display: flex; justify-content: center; min-width: 0; }
.auth-card { width: 100%; max-width: 480px; padding: 8px 16px 8px; animation: au-rise 0.45s var(--au-ease) both; }

.auth-aside { display: none; }

.auth-foot {
  position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px;
  padding: 14px 16px 22px; font-size: 13px; color: var(--au-faint);
}
.auth-foot a { color: var(--au-muted); text-decoration: none; min-height: 24px; display: inline-flex; align-items: center; }
.auth-foot a:hover { color: var(--au-purple); text-decoration: underline; }

/* Small Cassy at the top of the card (phones and tablets; the big one lives in the side panel). */
.auth-mini { position: relative; width: 62px; height: 82px; margin: 4px auto 6px; }
.auth-mini img { position: relative; width: 62px; height: auto; animation: au-bob 5s ease-in-out infinite; }
.auth-mini-glow { position: absolute; inset: 14px -14px -6px; border-radius: 50%; background: radial-gradient(circle, rgba(167, 139, 250, 0.45), rgba(167, 139, 250, 0)); }

.auth-head { text-align: center; margin: 0 0 18px; }
.auth-title { font-size: clamp(24px, 6.4vw, 30px); line-height: 1.18; letter-spacing: -0.02em; margin: 0 0 8px; color: var(--au-ink); }
.auth-sub { font-size: 16px; line-height: 1.55; color: var(--au-muted); margin: 0 auto; max-width: 400px; }
.auth-badge {
  display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; margin-bottom: 12px;
  background: #fff; border: 1px solid var(--au-line); color: var(--au-purple); box-shadow: 0 8px 22px rgba(63, 31, 134, 0.1);
}
.auth-badge .ai-icon { width: 24px; height: 24px; }

.auth-switch { text-align: center; margin: 18px 0 0; font-size: 15px; color: var(--au-muted); }
.auth-switch a { color: var(--au-purple); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; }
.auth-switch a:hover { text-decoration: underline; }
.auth-switch .ai-icon { width: 16px; height: 16px; }

.auth-secure { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 20px 0 4px; font-size: 13px; color: var(--au-faint); text-align: center; }
.auth-secure .ai-icon { width: 16px; height: 16px; flex: none; color: var(--au-ok); }

/* ---------- form ---------- */
.af-form { display: grid; gap: 16px; margin: 0; }
.af-field { display: grid; gap: 6px; min-width: 0; }
.af-field > label, .af-label-row label { font-size: 14px; font-weight: 700; color: var(--au-ink); }
.af-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.af-optional { font-weight: 500; color: var(--au-faint); }
.af-link { font-size: 14px; font-weight: 700; color: var(--au-purple); text-decoration: none; min-height: 24px; display: inline-flex; align-items: center; }
.af-link:hover { text-decoration: underline; }

.af-input { position: relative; display: flex; align-items: center; }
.af-input > .ai-icon {
  position: absolute; left: 14px; width: 20px; height: 20px; color: var(--au-faint); pointer-events: none;
  transition: color 0.2s ease;
}
.auth-shell .af-input input, .auth-shell .af-input select {
  width: 100%; min-height: 54px; padding: 14px 48px 14px 44px; font-size: 16px; font-family: inherit; color: var(--au-ink);
  background: #fff; border: 1.5px solid #e2d9f7; border-radius: var(--au-radius); outline: none; appearance: none; -webkit-appearance: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.auth-shell .af-select select { padding-right: 40px; cursor: pointer; }
.af-select::after {
  content: ''; position: absolute; right: 18px; top: 50%; width: 8px; height: 8px; margin-top: -6px; pointer-events: none;
  border-right: 2px solid var(--au-faint); border-bottom: 2px solid var(--au-faint); transform: rotate(45deg);
}
.auth-shell .af-input input::placeholder { color: #a9a2c0; }
.auth-shell .af-input input:hover, .auth-shell .af-input select:hover { border-color: #cfc2f1; }
.af-input:focus-within > .ai-icon { color: var(--au-purple); }
.auth-shell .af-input input:focus, .auth-shell .af-input select:focus { border-color: var(--au-purple); box-shadow: 0 0 0 4px rgba(91, 47, 184, 0.16); }

/* Valid: a green check slides in. Invalid: red border and message, with a small shake on submit. */
.af-ok {
  position: absolute; right: 14px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%;
  background: var(--au-ok-soft); color: var(--au-ok); opacity: 0; transform: scale(0.6); transition: opacity 0.2s ease, transform 0.25s var(--au-ease);
  pointer-events: none;
}
.af-ok .ai-icon { width: 14px; height: 14px; stroke-width: 2.6; }
.af-field.is-valid .af-ok { opacity: 1; transform: scale(1); }
.auth-shell .af-field.is-invalid .af-input input, .auth-shell .af-field.is-invalid .af-input select { border-color: var(--au-error); background: #fffafb; }
.auth-shell .af-field.is-invalid .af-input input:focus { box-shadow: 0 0 0 4px rgba(196, 38, 74, 0.14); }
.af-field.is-invalid .af-input > .ai-icon { color: var(--au-error); }
.af-field.shake { animation: au-shake 0.38s ease; }

.af-error {
  display: flex; gap: 6px; align-items: flex-start; margin: 0; font-size: 14px; line-height: 1.45; color: var(--au-error);
  max-height: 0; opacity: 0; overflow: hidden; transition: max-height 0.25s ease, opacity 0.2s ease;
}
.af-field.is-invalid .af-error { max-height: 120px; opacity: 1; }
.af-error:not(:empty)::before {
  content: '!'; flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%;
  background: var(--au-error); color: #fff; font-size: 12px; font-weight: 800;
}
.af-caps { margin: 0; font-size: 13px; font-weight: 700; color: var(--au-warn); display: flex; gap: 6px; align-items: center; }
.af-caps::before { content: '⇪'; font-size: 15px; }

/* Show / hide password */
.af-eye {
  position: absolute; right: 6px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 10px;
  background: transparent; color: var(--au-faint); cursor: pointer; transition: color 0.15s ease, background 0.15s ease;
}
.af-eye:hover { color: var(--au-purple); background: var(--au-lavender); }
.af-eye:focus-visible { outline: 3px solid rgba(91, 47, 184, 0.35); outline-offset: 0; }
.af-eye-hide { display: none; }
.af-eye[aria-pressed="true"] .af-eye-show { display: none; }
.af-eye[aria-pressed="true"] .af-eye-hide { display: inline; }
.af-eye .ai-icon { width: 20px; height: 20px; }

/* Password checklist and strength */
.af-rules {
  margin-top: 2px; padding: 12px 14px; border-radius: 12px; background: #fbf9ff; border: 1px solid var(--au-line);
}
.af-rules-title { margin: 10px 0 6px; font-size: 13px; font-weight: 700; color: var(--au-muted); }
.af-rules ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.af-rules li { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--au-muted); transition: color 0.2s ease; }
.af-rules li .ai-icon {
  flex: none; width: 18px; height: 18px; padding: 2px; border-radius: 50%; border: 1.5px solid #d6cdee; color: transparent;
  stroke-width: 3; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.25s var(--au-ease);
}
.af-rules li.is-met { color: var(--au-ink); }
.af-rules li.is-met .ai-icon { background: var(--au-ok); border-color: var(--au-ok); color: #fff; transform: scale(1.08); }
.af-rules li.af-rule-quiet { display: none; }
.af-rules li.af-rule-quiet.is-broken { display: flex; color: var(--au-error); }
.af-rules li.af-rule-quiet.is-broken .ai-icon { border-color: var(--au-error); }
@media (min-width: 420px) { .af-rules ul { grid-template-columns: 1fr 1fr; } }

.af-strength { display: flex; align-items: center; gap: 10px; }
.af-strength-bar { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.af-strength-bar i { height: 6px; border-radius: 999px; background: #e7e0f6; transition: background 0.25s ease; }
.af-strength-text { font-size: 13px; color: var(--au-muted); min-width: 56px; text-align: right; }
.af-strength[data-strength="1"] i:nth-child(-n+1) { background: #d9435f; }
.af-strength[data-strength="2"] i:nth-child(-n+2) { background: #e08a12; }
.af-strength[data-strength="3"] i:nth-child(-n+3) { background: #6a8f1c; }
.af-strength[data-strength="4"] i:nth-child(-n+4) { background: var(--au-ok); }

/* Checkbox */
.af-check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: 15px; line-height: 1.45; color: var(--au-ink); min-height: 44px; padding: 2px 0; }
.af-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.af-check-box {
  flex: none; display: grid; place-items: center; width: 24px; height: 24px; margin-top: 1px; border-radius: 8px;
  border: 1.5px solid #cfc2f1; background: #fff; color: transparent; transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.2s var(--au-ease);
}
.af-check-box .ai-icon { width: 16px; height: 16px; stroke-width: 3; }
.af-check input:checked + .af-check-box { background: var(--au-purple); border-color: var(--au-purple); color: #fff; transform: scale(1.05); }
.af-check input:focus-visible + .af-check-box { box-shadow: 0 0 0 4px rgba(91, 47, 184, 0.22); }
.af-check-text small { display: block; font-size: 13px; color: var(--au-faint); margin-top: 2px; }
.af-check-text a { color: var(--au-purple); font-weight: 700; }
.af-field.is-invalid .af-check-box { border-color: var(--au-error); }

/* Main button */
.af-submit {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px;
  padding: 14px 20px; border: 0; border-radius: var(--au-radius); cursor: pointer; font-family: inherit; font-size: 16px; font-weight: 800;
  color: #fff; text-decoration: none; background: linear-gradient(135deg, var(--au-purple) 0%, var(--au-purple-light) 100%);
  box-shadow: 0 10px 24px rgba(91, 47, 184, 0.28); transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease, background 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}
.af-submit:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(91, 47, 184, 0.34); }
.af-submit:active { transform: translateY(0) scale(0.985); }
.af-submit:focus-visible { outline: 3px solid rgba(91, 47, 184, 0.45); outline-offset: 3px; }
.af-submit[disabled], .af-submit[aria-disabled="true"] { cursor: not-allowed; filter: saturate(0.4); opacity: 0.75; transform: none; box-shadow: none; }
.af-submit-soft { background: #fff; color: var(--au-purple); border: 1.5px solid var(--au-line-strong); box-shadow: none; }
.af-submit-soft:hover { box-shadow: 0 8px 20px rgba(63, 31, 134, 0.1); }
.af-spinner {
  display: none; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.4); border-top-color: #fff;
  animation: au-spin 0.7s linear infinite;
}
.af-submit-soft .af-spinner { border-color: rgba(91, 47, 184, 0.25); border-top-color: var(--au-purple); }
.af-submit.is-busy { cursor: progress; }
.af-submit.is-busy .af-spinner { display: inline-block; }
.af-submit.is-done { background: linear-gradient(135deg, #0f7a57, #19a074); box-shadow: 0 10px 24px rgba(18, 128, 92, 0.28); }
.af-submit.is-done .af-submit-label::before { content: '✓ '; }

.af-text-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin: 6px auto 0; padding: 8px 14px; border: 0; background: none;
  color: var(--au-purple); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; border-radius: 10px;
}
.af-text-btn:hover { background: var(--au-lavender); }
.af-actions { display: grid; gap: 4px; justify-items: center; }
.af-actions .af-submit { width: 100%; }

/* Messages */
.af-alert {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: 15px; line-height: 1.5;
  animation: au-drop 0.3s var(--au-ease) both;
}
.af-alert[hidden] { display: none; }
.af-alert p { margin: 0; }
.af-alert .ai-icon { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.af-alert-error { background: var(--au-error-soft); color: #8d1530; border: 1px solid #f6c9d4; }
.af-alert-success { background: var(--au-ok-soft); color: #0b5e43; border: 1px solid #bfe9d6; margin-bottom: 14px; }
.af-alert-warn { background: var(--au-warn-soft); color: #6d4100; border: 1px solid #f3dcae; }
.af-alert .af-countdown { font-variant-numeric: tabular-nums; font-weight: 800; }

/* Result screens (sent, done, expired...) */
.af-state { text-align: center; display: grid; gap: 12px; justify-items: center; outline: none; }
.af-state[hidden] { display: none; }
.af-state:not(.af-state-static) { animation: au-rise 0.4s var(--au-ease) both; }
.af-state .af-form, .af-state > .af-submit { width: 100%; margin-top: 6px; }
.af-state-icon { display: grid; place-items: center; width: 68px; height: 68px; border-radius: 22px; margin-bottom: 2px; }
.af-state-icon .ai-icon { width: 32px; height: 32px; }
.af-state-ok { background: var(--au-ok-soft); color: var(--au-ok); }
.af-state-ok .ai-icon { stroke-width: 2.6; }
.af-state-info { background: #fff; color: var(--au-purple); border: 1px solid var(--au-line); box-shadow: 0 10px 26px rgba(63, 31, 134, 0.12); }
.af-state-warn { background: var(--au-warn-soft); color: var(--au-warn); }
.af-hint { margin: 0; font-size: 14px; color: var(--au-faint); max-width: 380px; }
.af-email { color: var(--au-ink); word-break: break-all; }
.af-pop { animation: au-pop 0.5s var(--au-ease) both; }
.af-float { animation: au-bob 4s ease-in-out infinite; }

.af-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Google button block */
.google-signin { margin: 0 0 4px; display: grid; gap: 10px; justify-items: center; }
.google-signin-button { width: 100%; min-height: 44px; display: flex; justify-content: center; }
.google-signin-terms { margin: 0; font-size: 13px; line-height: 1.45; color: var(--au-faint); text-align: center; }
.google-signin-terms a { color: var(--au-purple); }
.google-signin-error { margin: 0; color: var(--au-error); font-size: 14px; }
.google-signin-divider { display: flex; align-items: center; gap: 12px; width: 100%; margin: 4px 0 6px; color: var(--au-faint); font-size: 13px; }
.google-signin-divider::before, .google-signin-divider::after { content: ''; flex: 1; height: 1px; background: var(--au-line); }

/* ---------- tablet: a centered card ---------- */
@media (min-width: 600px) {
  .auth-top { padding: 16px 24px; }
  .auth-main { padding: 12px 24px 32px; align-content: center; }
  .auth-card {
    padding: 28px 36px 24px; background: #fff; border: 1px solid var(--au-line); border-radius: 26px;
    box-shadow: 0 24px 60px rgba(63, 31, 134, 0.12);
  }
}

/* ---------- desktop: card + cosmic side panel ---------- */
@media (min-width: 1024px) {
  .auth-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: stretch; padding: 8px 32px 28px; }
  .auth-panel { align-items: center; }
  .auth-card { max-width: 500px; padding: 36px 44px 28px; }
  .auth-mini { display: none; }
  .auth-head { text-align: left; }
  .auth-sub { margin: 0; }
  .af-state { text-align: center; }
  .af-state .auth-sub { margin: 0 auto; }

  .auth-aside {
    display: flex; position: relative; overflow: hidden; border-radius: 30px; min-height: 560px;
    background:
      radial-gradient(120% 80% at 80% 0%, rgba(167, 139, 250, 0.55) 0%, rgba(167, 139, 250, 0) 55%),
      radial-gradient(90% 70% at 0% 100%, rgba(255, 196, 120, 0.18) 0%, rgba(255, 196, 120, 0) 60%),
      linear-gradient(160deg, #23114f 0%, #3a1c86 48%, #5b2fb8 100%);
    color: #fff; animation: au-rise 0.55s 0.08s var(--au-ease) both;
  }
  /* Twinkling stars in the panel. */
  .auth-aside::before {
    content: ''; position: absolute; inset: 0; opacity: 0.85;
    background-image:
      radial-gradient(1.6px 1.6px at 14% 22%, #fff, transparent 60%), radial-gradient(1px 1px at 32% 8%, #fff, transparent 60%),
      radial-gradient(1.2px 1.2px at 58% 18%, #fff, transparent 60%), radial-gradient(1.8px 1.8px at 86% 30%, #ffe7b3, transparent 60%),
      radial-gradient(1px 1px at 72% 62%, #fff, transparent 60%), radial-gradient(1.4px 1.4px at 22% 70%, #fff, transparent 60%),
      radial-gradient(1px 1px at 46% 88%, #fff, transparent 60%), radial-gradient(1.6px 1.6px at 92% 84%, #fff, transparent 60%);
    animation: au-twinkle 6s ease-in-out infinite alternate;
  }
  .auth-aside-inner { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 44px 48px; width: 100%; }
  .auth-aside-art { position: relative; align-self: center; width: 230px; height: 260px; display: grid; place-items: center; margin-bottom: 6px; }
  .auth-aside-art img { position: relative; width: 170px; height: auto; filter: drop-shadow(0 18px 30px rgba(10, 4, 40, 0.45)); animation: au-bob 6s ease-in-out infinite; }
  .auth-aside-glow { position: absolute; inset: 20px; border-radius: 50%; background: radial-gradient(circle, rgba(196, 179, 240, 0.55), rgba(196, 179, 240, 0)); }
  .auth-orbit { position: absolute; border-radius: 50%; border: 1px dashed rgba(255, 255, 255, 0.28); }
  .auth-orbit-1 { inset: 0; animation: au-orbit 40s linear infinite; }
  .auth-orbit-2 { inset: 34px; border-style: solid; border-color: rgba(255, 255, 255, 0.14); animation: au-orbit 28s linear infinite reverse; }
  .auth-orbit-1::after {
    content: ''; position: absolute; top: 12%; left: 6%; width: 9px; height: 9px; border-radius: 50%;
    background: #ffd27a; box-shadow: 0 0 14px 3px rgba(255, 210, 122, 0.7);
  }
  .auth-aside-title { margin: 0; font-size: 30px; line-height: 1.2; letter-spacing: -0.02em; color: #fff; }
  .auth-aside-text { margin: 0; font-size: 17px; line-height: 1.6; color: rgba(255, 255, 255, 0.86); max-width: 440px; }
  .auth-aside-points { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
  .auth-aside-points li {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; font-size: 15px; font-weight: 600;
    background: rgba(255, 255, 255, 0.09); border: 1px solid rgba(255, 255, 255, 0.14); backdrop-filter: blur(4px);
  }
  .auth-aside-points .ai-icon { flex: none; width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: rgba(255, 255, 255, 0.18); stroke-width: 2.6; }
}

/* ---------- big screens: more air, same proportions ---------- */
@media (min-width: 1600px) {
  .auth-main { max-width: 1360px; gap: 48px; }
  .auth-top { max-width: 1360px; }
  .auth-card { max-width: 540px; }
  .auth-aside { min-height: 640px; }
  .auth-aside-title { font-size: 34px; }
  .auth-aside-art { width: 270px; height: 300px; }
  .auth-aside-art img { width: 200px; }
}

/* ---------- motion ---------- */
/* Movement only: content is never hidden behind an animation (paused tabs and prefetching would leave it invisible). */
@keyframes au-rise { from { transform: translateY(10px); } to { transform: none; } }
@keyframes au-drop { from { transform: translateY(-6px); } to { transform: none; } }
@keyframes au-spin { to { transform: rotate(360deg); } }
@keyframes au-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes au-orbit { to { transform: rotate(360deg); } }
@keyframes au-twinkle { from { opacity: 0.55; } to { opacity: 1; } }
@keyframes au-pop { 0% { transform: scale(0.7); } 70% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes au-shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-5px); } 40%, 60% { transform: translateX(5px); } }

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

/* Phones and tablets already show the small Cassy at the top of the card, so the page badge (key, lock)
   would be a second icon for the same thing. It returns on wide screens, where Cassy moves to the side panel. */
@media (max-width: 1023px) { .auth-badge { display: none; } }

/* The "protected sign-in" line: the shield sits with the first word, even when the line wraps. */
.auth-secure { display: block; }
.auth-secure .ai-icon { display: inline-block; vertical-align: -3px; margin-right: 6px; }

/* ---------- sign-up steps (one short screen each) ---------- */
/* Only when the script has turned steps on; without it every step shows, as one form. */
.af-form.is-stepped .af-step { display: none; }
.af-form.is-stepped .af-step.is-active { display: grid; gap: 16px; }
.af-step { display: grid; gap: 16px; }
.af-form:not(.is-stepped) .af-step-nav [data-step-next], .af-form:not(.is-stepped) .af-step-nav [data-step-back] { display: none; }
.af-step.from-fwd { animation: au-step-in 0.32s var(--au-ease) both; }
.af-step.from-back { animation: au-step-back 0.32s var(--au-ease) both; }
@keyframes au-step-in { from { transform: translateX(18px); } to { transform: none; } }
@keyframes au-step-back { from { transform: translateX(-18px); } to { transform: none; } }

.af-progress { margin: 0 0 14px; }
.af-progress-track { height: 6px; border-radius: 999px; background: #ece5fa; overflow: hidden; }
.af-progress-fill { display: block; height: 100%; width: 33.3%; border-radius: inherit; background: linear-gradient(90deg, var(--au-purple), var(--au-purple-light)); transition: width 0.35s var(--au-ease); }
.af-progress-text { margin: 8px 0 0; font-size: 13px; font-weight: 700; color: var(--au-muted); }

.af-step-nav { display: flex; gap: 10px; align-items: stretch; margin-top: 4px; }
.af-step-nav .af-submit { flex: 1; }
.af-back {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 54px; padding: 0 16px;
  border: 1.5px solid var(--au-line-strong); border-radius: var(--au-radius); background: #fff; color: var(--au-purple);
  font: inherit; font-weight: 800; cursor: pointer; transition: background 0.15s ease, transform 0.15s ease;
}
.af-back:hover { background: var(--au-lavender); }
.af-back:active { transform: scale(0.98); }
.af-back:focus-visible { outline: 3px solid rgba(91, 47, 184, 0.45); outline-offset: 3px; }
.af-back .ai-icon { width: 18px; height: 18px; }
@media (max-width: 359px) { .af-back span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .af-back { padding: 0 14px; } }
.af-hint-left { text-align: left; margin-top: 2px; }

/* ---------- fit on one screen ---------- */
/* Tighter rhythm, so sign-in fits a laptop screen and each sign-up step fits a phone screen without scrolling. */
.auth-head { margin-bottom: 14px; }
.af-form, .af-step { gap: 14px; }
.af-field { gap: 5px; }
.auth-shell .af-input input, .auth-shell .af-input select { min-height: 50px; padding-top: 12px; padding-bottom: 12px; }
.af-submit, .af-back { min-height: 50px; }
.af-rules { padding: 10px 12px; }
.af-rules-title { margin: 8px 0 4px; }
.auth-switch { margin-top: 14px; }
.auth-secure { margin-top: 14px; }
.google-signin { gap: 8px; }
.google-signin-divider { margin: 2px 0 4px; }
@media (min-width: 1024px) {
  .auth-card { padding: 30px 40px 22px; }
  .auth-aside { min-height: 0; }
  .auth-aside-inner { padding: 36px 44px; gap: 12px; }
  .auth-aside-art { width: 200px; height: 220px; }
  .auth-aside-art img { width: 150px; }
  .auth-aside-points li { padding: 9px 14px; }
}
/* Short laptop screens (768px tall and less): smaller art and headings so nothing needs a scroll. */
@media (min-width: 1024px) and (max-height: 820px) {
  .auth-top { padding-top: 10px; padding-bottom: 6px; }
  .auth-title { font-size: 26px; }
  .auth-aside-art { width: 160px; height: 170px; }
  .auth-aside-art img { width: 118px; }
  .auth-aside-title { font-size: 26px; }
  .auth-aside-points { gap: 8px; }
  .auth-card { padding-top: 22px; padding-bottom: 16px; }
  .auth-secure { display: none; }
  .auth-switch { margin-top: 10px; }
  .google-signin-terms { font-size: 12.5px; }
}
