/* Account pages: login, signup, forgot/reset, gates, status pages.
   Mobile first (390px): one column, primary action in thumb reach (sticky bar on signup).
   >= 992px: split screen - brand panel left, form card right. */

.authx { min-height: calc(100dvh - 64px); display: grid; }
.authx__panel { display: none; }
.authx__main { display: flex; flex-direction: column; justify-content: flex-start; padding: var(--s-5) var(--gutter) calc(var(--s-7) + var(--safe-b)); }
.authx__card { width: 100%; max-width: 440px; margin: 0 auto; }
.authx__head { margin-bottom: var(--s-6); }
.authx__head .h1 { font-size: 1.9rem; margin-bottom: var(--s-2); }
.authx__head p { color: var(--muted); margin: 0; }
.authx__foot { margin-top: var(--s-6); text-align: center; color: var(--muted); font-weight: 600; }
.authx__foot a { font-weight: 800; }

@media (min-width: 992px) {
  .authx { grid-template-columns: minmax(0, 1.05fr) minmax(480px, 1fr); }
  .authx__panel {
    position: relative; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; isolation: isolate;
    padding: var(--s-9) clamp(40px, 5vw, 80px); color: #fff; background: var(--brand-grad);
  }
  .authx__panel::before, .authx__panel::after {
    content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(2px);
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.35), rgba(255,255,255,0) 60%);
  }
  .authx__panel::before { width: 620px; height: 620px; top: -180px; right: -160px; }
  .authx__panel::after { width: 420px; height: 420px; bottom: 18%; left: -160px; opacity: .6; }
  .authx__art { position: absolute; top: 12%; right: 10%; width: min(46%, 360px); opacity: .95; filter: drop-shadow(0 30px 60px rgba(120, 0, 40, .35)); }
  .authx__panel h2 { font-family: var(--font-display); font-size: clamp(2.2rem, 3.4vw, 3.2rem); line-height: 1.05; letter-spacing: -.03em; font-weight: 800; max-width: 12ch; }
  .authx__panel p { font-size: var(--fs-lg); opacity: .92; max-width: 34ch; margin-top: var(--s-4); }
  .authx__perks { list-style: none; padding: 0; margin: var(--s-7) 0 0; display: grid; gap: var(--s-3); }
  .authx__perks li { display: flex; align-items: center; gap: var(--s-3); font-weight: 700; }
  .authx__perks .ic { width: 22px; height: 22px; padding: 6px; box-sizing: content-box; border-radius: 12px; background: rgba(255,255,255,.18); }
  .authx__main { justify-content: center; padding: var(--s-8) clamp(32px, 4vw, 64px); }
  .authx__card { max-width: 420px; }
}

/* fields */
.pw { position: relative; }
.pw .input { padding-right: 52px; }
.pw__toggle { position: absolute; right: 4px; top: 3px; }
.pw__toggle[aria-pressed="true"] .ic-eye { display: none; }
.pw__toggle:not([aria-pressed="true"]) .ic-eye-off { display: none; }
.input, .select, .textarea { font-size: 16px; } /* no iOS zoom */
.row-links { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin: var(--s-1) 0 var(--s-5); }
.row-links a { font-weight: 700; font-size: var(--fs-sm); }
.form-error { margin-bottom: var(--s-4); }

/* signup steps */
.steps { display: grid; gap: var(--s-2); margin-bottom: var(--s-5); }
.steps__label { display: flex; justify-content: space-between; font-size: var(--fs-sm); font-weight: 750; color: var(--muted); }
.step { display: grid; gap: var(--s-1); }
.step + .step { margin-top: var(--s-7); }
.signup.is-stepped .step { display: none; }
.signup.is-stepped .step.is-current { display: grid; animation: step-in .28s var(--ease); }
.signup.is-stepped .step + .step { margin-top: 0; }
.step__title { font-family: var(--font-display); font-size: 1.55rem; font-weight: 750; letter-spacing: -.02em; margin: 0; }
.step__lead { color: var(--muted); margin: 0 0 var(--s-4); }
@keyframes step-in { from { opacity: 0; transform: translateX(14px); } }

.choice-group { border: 0; padding: 0; margin: 0 0 var(--s-5); min-width: 0; }
.choice-group legend { padding: 0; margin-bottom: var(--s-2); font-weight: 750; font-size: var(--fs-sm); color: var(--text-2); }
.choice { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 92px; padding: var(--s-3); border-radius: var(--r-lg); border: 1.5px solid var(--line-strong); background: var(--card);
  cursor: pointer; font-weight: 800; text-align: center; transition: border-color var(--dur), background-color var(--dur), transform .12s var(--ease); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:hover { border-color: var(--faint); }
.choice:active { transform: scale(.98); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent); }
.choice:has(input:focus-visible) { outline: 2.5px solid var(--focus); outline-offset: 2px; }
.choice__ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); }
.choice:has(input:checked) .choice__ic { background: var(--accent); color: var(--on-accent); }
.choices { display: grid; gap: var(--s-2); grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); }

.dob { display: grid; grid-template-columns: 0.8fr 1.4fr 1fr; gap: var(--s-2); }

/* town combobox */
.combo { position: relative; }
.combo .input { padding-right: 52px; }
.combo__locate { position: absolute; right: 4px; top: 3px; }
.combo__list { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); max-height: 300px; overflow-y: auto; margin: 0; padding: 6px; list-style: none;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--sh-3); }
.combo__list li { display: flex; align-items: center; gap: var(--s-3); min-height: 48px; padding: 6px 10px; border-radius: var(--r-sm); cursor: pointer; }
.combo__list li .ic { color: var(--faint); }
.combo__list li[aria-selected="true"], .combo__list li:hover { background: var(--accent-soft); }
.combo__list small { color: var(--muted); font-weight: 600; display: block; font-size: 13px; }
.combo__list .empty-row { color: var(--muted); cursor: default; }
.combo__list .empty-row:hover { background: none; }

.suggest { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 6px 12px; border-radius: var(--r-pill); border: 0;
  background: var(--warn-soft); color: var(--warn); font-weight: 750; font-size: var(--fs-sm); }
.strength { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 8px; }
.strength span { height: 4px; border-radius: 2px; background: var(--surface-2); transition: background-color var(--dur); }
.strength[data-level="1"] span:nth-child(1) { background: var(--danger); }
.strength[data-level="2"] span:nth-child(-n+2) { background: var(--gold); }
.strength[data-level="3"] span { background: var(--success); }
.strength-label { font-size: 13px; color: var(--muted); font-weight: 650; }

.terms { font-size: var(--fs-sm); color: var(--muted); margin: var(--s-4) 0 0; }
.terms a { font-weight: 700; }
.trust { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2) var(--s-4); margin-top: var(--s-5); color: var(--muted); font-size: 13px; font-weight: 700; }
.trust span { display: inline-flex; align-items: center; gap: 6px; }
.trust .ic { width: 16px; height: 16px; color: var(--success); }

/* actions: sticky on phones so the next step is always in thumb reach */
.step-actions { display: flex; gap: var(--s-2); margin-top: var(--s-5); }
.step-actions .btn--primary { flex: 1; }
@media (max-width: 991.98px) {
  .signup.is-stepped .step-actions {
    position: sticky; bottom: 0; z-index: 5; margin: var(--s-5) calc(var(--gutter) * -1) 0; padding: var(--s-3) var(--gutter) calc(var(--s-3) + var(--safe-b));
    background: linear-gradient(to top, var(--bg) 70%, color-mix(in srgb, var(--bg) 0%, transparent));
  }
}

/* status / gate pages */
.gate { text-align: center; padding: var(--s-6) 0 var(--s-5); }
.gate__art { width: 104px; height: 104px; margin: 0 auto var(--s-5); border-radius: 34px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); position: relative; }
.gate__art .ic { width: 48px; height: 48px; stroke-width: 1.7; }
.gate__art--pulse::after { content: ""; position: absolute; inset: -8px; border-radius: 40px; border: 2px solid var(--accent-line); animation: pulse 2.2s ease-out infinite; }
@keyframes pulse { from { opacity: 1; transform: scale(.92); } to { opacity: 0; transform: scale(1.18); } }
.gate h1 { font-family: var(--font-display); font-size: 1.75rem; letter-spacing: -.02em; margin-bottom: var(--s-3); }
.gate p { color: var(--text-2); max-width: 40ch; margin-left: auto; margin-right: auto; }
.gate .email-chip { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 8px 14px; border-radius: var(--r-pill); background: var(--surface); font-weight: 800; margin: var(--s-2) 0 var(--s-4); }
.gate .email-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gate__actions { display: grid; gap: var(--s-2); max-width: 380px; margin: var(--s-5) auto 0; }
.gate__hint { font-size: var(--fs-sm); color: var(--muted); margin-top: var(--s-4); }
.gate__waiting { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: var(--fs-sm); font-weight: 650; margin-top: var(--s-5); }
.gate__waiting .spinner { width: 18px; height: 18px; border-width: 2px; }
.gate details { margin-top: var(--s-5); text-align: left; max-width: 380px; margin-left: auto; margin-right: auto; }
.gate summary { cursor: pointer; font-weight: 750; color: var(--accent-ink); text-align: center; list-style: none; }
.gate summary::-webkit-details-marker { display: none; }

.phone-row { display: grid; grid-template-columns: 118px 1fr; gap: var(--s-2); }
.code-input { font-size: 2rem !important; font-weight: 800; letter-spacing: .5em; text-align: center; padding-left: .5em; font-variant-numeric: tabular-nums; }
.verify-step[hidden] { display: none; }
.signup:not(.is-stepped) [data-next], .signup:not(.is-stepped) [data-prev], .signup:not(.is-stepped) .steps { display: none; }
.signup:not(.is-stepped) .step-actions { justify-content: stretch; }
.step-actions [data-prev] { flex: none; width: 56px; padding: 0; }

/* ---- Sign in with Google / Apple (views/account/_social.php) ---- */
.sbtns { display: grid; gap: var(--s-3); margin: 0 0 var(--s-2); }
.sbtn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 52px; padding: 0 var(--s-5);
  border-radius: 999px; border: 1px solid #dadce0; background: #fff; color: #1f1f1f; font: inherit; font-weight: 700; font-size: 1rem;
  text-decoration: none; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.sbtn:hover { box-shadow: 0 2px 10px rgb(0 0 0 / .1); text-decoration: none; }
.sbtn:active { transform: scale(.98); }
.sbtn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sbtn__logo { flex: none; }
.sbtn--apple { background: #000; border-color: #000; color: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sbtn--apple { background: #fff; border-color: #fff; color: #000; } }
:root[data-theme="dark"] .sbtn--apple { background: #fff; border-color: #fff; color: #000; }
.or-line { display: flex; align-items: center; gap: var(--s-3); margin: var(--s-4) 0; color: var(--muted); font-size: var(--fs-sm); font-weight: 700; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sconn { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-4); border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); margin: 0 0 var(--s-3); }
.sconn > div { display: grid; min-width: 0; }
.sconn > div span { overflow-wrap: anywhere; }
.sconn__ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--success); color: #fff; }
