/* Bloom Dates · auth pages (R4 · Atelier): /login (sign in, create account, recover, new password, results, expired link),
   /mfa-pending and /mfa-recovery. Needs tokens.css, fonts.css, base.css, components.css. Tokens only: no raw colours,
   no !important. Layout: one column on phones (logo + card), a story column on the brand cream from 960 px. One primary
   action per screen; every control at 16 px with a visible label; the theme follows the system (tokens.css). */

.auth { background: var(--c-bg); }
/* Components set display (grid, inline-flex); the hidden attribute must still win on these pages. */
.auth [hidden] { display: none; }
.auth-layout { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); }

/* ── Story column (desktop only): real logo on the cream plate, the promise, three plain facts ─────────────────── */
.auth-story { display: none; }
@media (min-width: 960px) {
  .auth-layout { grid-template-columns: minmax(360px, 5fr) minmax(0, 7fr); }
  .auth-story {
    position: sticky; top: 0; height: 100vh; height: 100dvh;
    display: flex; flex-direction: column; justify-content: space-between; gap: var(--s-12);
    padding: var(--s-12) var(--s-10); overflow: auto;
    background: var(--c-cream); color: var(--c-text); border-right: var(--line-width) solid var(--c-line);
  }
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth-story { background: var(--c-surface-2); } }
:root[data-theme="dark"] .auth-story { background: var(--c-surface-2); }
.auth-logo { width: auto; height: 96px; aspect-ratio: 980 / 558; color: var(--c-text); }
.auth-story__body { display: grid; gap: var(--s-6); max-width: 30rem; }
.auth-story__title { font: var(--t-display); letter-spacing: var(--tracking-display); }
.auth-story__copy { font: var(--t-body-lg); color: var(--c-text-muted); }
.auth-points { display: grid; gap: var(--s-3); margin: 0; padding: var(--s-6) 0 0; list-style: none; border-top: var(--line-width) solid var(--c-line); }
.auth-points li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: var(--s-3); align-items: start; font: var(--t-body); }
.auth-points svg { margin-top: 2px; color: var(--c-accent); }

/* ── Main column ────────────────────────────────────────────────────────────────────────────────────────────── */
.auth-main { display: flex; flex-direction: column; min-width: 0; padding: var(--s-4) var(--gutter) var(--s-8); }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: var(--target-min); }
.auth-top__logo { height: 40px; width: auto; aspect-ratio: 980 / 558; color: var(--c-text); }
@media (min-width: 960px) { .auth-top { justify-content: flex-end; } .auth-top__logo { display: none; } .auth-top .auth-top__logo--always { display: block; margin-right: auto; } }
.auth-lang { width: auto; min-width: 5.5rem; min-height: var(--control-height-sm); padding-top: var(--s-2); padding-bottom: var(--s-2); }

.auth-card { width: 100%; max-width: 30rem; margin: var(--s-8) auto; display: grid; gap: var(--s-5); align-content: start; }
@media (min-width: 600px) {
  .auth-card { margin: auto; padding: var(--s-10); background: var(--c-surface); border: var(--line-width) solid var(--c-line); box-shadow: var(--e-1); }
}
.auth-card h1 { font: var(--t-h1); letter-spacing: var(--tracking-display); overflow-wrap: anywhere; }
.auth-lead { color: var(--c-text-muted); margin-top: calc(var(--s-3) * -1); overflow-wrap: anywhere; }
.auth-tabs .bd-tab { flex: 1 1 0; }
.auth-result-icon { color: var(--c-accent); }

/* ── Form ───────────────────────────────────────────────────────────────────────────────────────────────────── */
.auth-form { display: grid; gap: var(--s-5); }
.auth-form[hidden] { display: none; }
.auth-password { position: relative; }
.auth-password .bd-input { padding-right: calc(var(--target-min) + var(--s-2)); }
.auth-reveal {
  position: absolute; top: 50%; right: var(--s-1); transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center; width: var(--target-min); height: var(--target-min);
  padding: 0; border: 0; border-radius: var(--radius-control); background: transparent; color: var(--c-text-muted); cursor: pointer;
}
.auth-reveal:hover { color: var(--c-text); }
.auth-reveal:focus-visible { outline: var(--focus-ring); outline-offset: 0; }
.auth-reveal svg { width: 22px; height: 22px; }
.auth-reveal[aria-pressed="true"] .auth-reveal__show, .auth-reveal[aria-pressed="false"] .auth-reveal__hide { display: none; }

.auth-terms-block { display: grid; gap: var(--s-2); }
.auth-terms-block[hidden] { display: none; }
.auth-terms { padding: var(--s-1) 0; font: var(--t-small); }
.auth-terms input { margin-top: 0; }
.auth-terms a, .auth-privacy-note a { color: var(--c-accent); }
.auth-privacy-note { font: var(--t-small); color: var(--c-text-muted); }

.auth-message:empty { display: none; }
.auth-banner .bd-banner__text { font: var(--t-small); overflow-wrap: anywhere; }
.auth-banner__actions { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); margin-top: var(--s-1); }
.auth-banner__actions .bd-btn { padding: 0; min-height: var(--target-min); }
.auth-submit[aria-busy="true"] { opacity: 1; }

.auth-extras { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-2); }
.auth-extras[hidden] { display: none; }
.auth-extras .bd-btn--text { min-height: var(--target-min); font-weight: 500; }

/* ── Results ("Revisa tu correo") ───────────────────────────────────────────────────────────────────────────── */
.auth-result { display: grid; gap: var(--s-4); }
.auth-result[hidden] { display: none; }
.auth-result__hint { font: var(--t-small); color: var(--c-text-muted); }
.auth-result__hint:empty { display: none; }

/* ── Legal footer ───────────────────────────────────────────────────────────────────────────────────────────── */
.auth-legal { margin-top: auto; padding-top: var(--s-6); text-align: center; font: var(--t-small); color: var(--c-text-muted); }
.auth-legal a { display: inline-block; padding: var(--s-2) var(--s-1); color: var(--c-text-muted); text-decoration: none; }
.auth-legal a:hover, .auth-legal a:focus-visible { color: var(--c-accent); text-decoration: underline; }

/* ── MFA pages (restyle only: same ids and scripts as before) ───────────────────────────────────────────────── */
.auth-message { font: var(--t-small); }
.auth-message.error { color: var(--c-danger); }
#mfa-form, .auth-mfa-setup { display: grid; gap: var(--s-5); }
#mfa-code, #recovery-code { letter-spacing: .3em; font-variant-numeric: tabular-nums; }
#mfa-factor-row[hidden], #recovery-setup[hidden], #recovery-factor[hidden] { display: none; }
#recovery-qr { width: 180px; height: 180px; background: var(--c-surface); border: var(--line-width) solid var(--c-line); }
#recovery-secret { display: block; padding: var(--s-3); background: var(--c-surface-2); font: 500 14px/20px ui-monospace, monospace; overflow-wrap: anywhere; }
.auth-foot { font: var(--t-small); color: var(--c-text-muted); text-align: center; }
