/* Sign-in, lockout and error pages (WP4). Layout comes from app.css §13 (base_auth.html);
   this adds the card internals. Tokens only, no new colors. */

.auth-brand p:empty { display: none; }
.auth-card { display: grid; gap: var(--sp-4); }
.auth-card > .alert p { margin: 0; }
.auth-form .field:last-of-type { margin-bottom: var(--sp-6); }
.auth-submit { min-height: 48px; }
.auth-note { color: var(--ink-2); font-size: var(--fs-sm); }
.auth-note code { font-size: .95em; overflow-wrap: anywhere; }

/* Password with a show/hide button inside the field (auth.js un-hides it). */
.password-field { position: relative; }
.password-field input { padding-right: 52px !important; }
.password-toggle {
  position: absolute; top: 50%; right: 2px; translate: 0 -50%;
  color: var(--ink-2); border-radius: var(--r-md);
}
.password-toggle:hover { color: var(--ink); }
.password-toggle .when-shown { display: none; }
.password-toggle[aria-pressed="true"] .when-shown { display: block; }
.password-toggle[aria-pressed="true"] .when-hidden { display: none; }
/* Edge and Safari draw their own reveal/caps-lock buttons; ours replaces them. */
.password-field input::-ms-reveal { display: none; }

/* 403 / 404 / 500 */
.error-card { text-align: center; gap: var(--sp-3); }
.error-card h2 { font-size: var(--fs-xl); line-height: 1.25; }
.error-card > p:not(.error-code) { color: var(--ink-2); }
.error-code {
  font-size: var(--fs-overline); font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-text);
}
.error-actions { margin-top: var(--sp-2); }
.error-actions .btn { min-height: 48px; }

/* Email-code sign-in (2026-10-16) */
.auth-lead { margin: 0 0 var(--sp-4); line-height: 1.5; overflow-wrap: anywhere; }
.auth-help { margin-top: var(--sp-3); text-align: center; }
.code-input { font-size: 1.75rem; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }

/* Terms, privacy and the one-time agreement (drills/legal.py) */
.legal-page .auth { max-width: 720px; }
.legal-card { display: grid; gap: var(--sp-3); line-height: 1.55; }
.legal-card h2 { font-size: var(--fs-xl); }
.legal-card h3 { font-size: var(--fs-lg); margin-top: var(--sp-3); }
.legal-card p, .legal-card ul { margin: 0; max-width: var(--measure); }
.legal-card ul { padding-left: 1.2em; display: grid; gap: var(--sp-1); }
.legal-card .alert p { margin: 0; }
.legal-lead { color: var(--ink-2); }
.legal-meta { color: var(--ink-2); font-size: var(--fs-sm); margin-top: var(--sp-4); }
.legal-links { font-size: var(--fs-sm); overflow-wrap: anywhere; }
.legal-points { margin: 0; padding-left: 1.2em; display: grid; gap: var(--sp-2); }
.legal-agree { display: flex; gap: var(--sp-3); align-items: flex-start; font-weight: 400; line-height: 1.45; }
.legal-agree input { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.auth-legal { margin-top: var(--sp-4); text-align: center; font-size: var(--fs-sm); color: var(--ink-2); }

/* Offline page (served by the service worker) */
.offline-runs { list-style: none; padding: 0; margin: 0 0 var(--sp-4); display: grid; gap: var(--sp-2); }
.offline-runs .btn { justify-content: space-between; min-height: 48px; }
.offline-date { font-weight: 500; opacity: .85; }
#offline-none { margin-bottom: var(--sp-4); }

/* Password sign-in (2026-10-17) */
.optional { color: var(--ink-2); font-weight: 400; }

/* Passkeys and Sign-in & security (2026-10-17) */
.auth-or { display: flex; align-items: center; gap: var(--sp-3); color: var(--ink-2); font-size: var(--fs-sm); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.auth-card:not(:has([data-passkey-signin]:not([hidden]))) > [data-passkey-signin-wrap] { display: none; }
[data-passkey-signin] .i { margin-right: var(--sp-2); }
.security-section { display: grid; gap: var(--sp-3); }
.security-section + .security-section { border-top: 1px solid var(--line); padding-top: var(--sp-4); }
.security-section h2 { font-size: var(--fs-lg); margin: 0; }
.security-section .help { margin: 0; }
.passkey-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.passkey-list li {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-3); border: 1px solid var(--line); border-radius: var(--r-md);
}
.passkey-list .btn { min-height: 44px; }

/* Request early access (2026-10-17) */
.auth-early { text-align: center; margin: var(--sp-4) 0 0; font-size: var(--fs-md, 1rem); }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Public home page for signed-out visitors (2026-10-18) */
.home-card h2 { font-size: var(--fs-lg); margin-top: var(--sp-3); }
.home-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.home-actions .btn { min-height: 44px; flex: 1 1 12rem; }
