/* Auth-only styles reuse the homepage variables, typography, and buttons. */
.auth-page { min-height: 100vh; }
.auth-layout { width: min(460px, calc(100% - 40px)); margin-inline: auto; padding: 64px 0 48px; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 32px; }
.auth-card { padding: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 4px 18px #262b2106; }
.auth-eyebrow { margin: 0 0 12px; color: #a6532e; font-size: 11px; font-weight: 600; line-height: 1.5; letter-spacing: .5px; }
.auth-intro h1 { margin: 0 0 12px; font-size: 28px; line-height: 1.2; font-weight: 650; letter-spacing: -.045em; }
.auth-description { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.auth-form { margin-top: 26px; }
.auth-field { margin-bottom: 18px; }
.auth-field > label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 600; line-height: 1.5; }
.auth-field input { width: 100%; min-width: 0; min-height: 46px; padding: 12px; border: 1px solid #dedfd6; border-radius: var(--radius-control); background: #fdfcf9; color: var(--ink); font: inherit; font-size: 16px; line-height: 1.4; }
.auth-field input::placeholder { color: var(--muted); font-size: 13px; }
.auth-field input:focus-visible, .auth-checkbox input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.auth-field input[aria-invalid="true"], .auth-checkbox input[aria-invalid="true"] { border-color: var(--danger); }
.password-field { position: relative; }
.password-field input { padding-right: 64px; }
.password-toggle { position: absolute; top: 1px; right: 3px; bottom: 1px; min-width: 54px; padding: 0 10px; border: 0; border-radius: 4px; background: transparent; font: inherit; font-size: 11px; font-weight: 600; color: var(--muted); cursor: pointer; }
.password-toggle:hover { color: var(--ink); }
.auth-help { margin: 7px 0 0; font-size: 11px; line-height: 1.6; color: var(--muted); }
.auth-error { margin: 0; color: var(--danger); font-size: 11px; line-height: 1.6; }
.auth-error:not(:empty) { margin-top: 6px; }
.auth-options { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 20px; }
.auth-checkbox { display: flex; align-items: center; gap: 9px; min-height: 40px; font-size: 12px; line-height: 1.7; cursor: pointer; }
.auth-checkbox input { flex-shrink: 0; width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }
.auth-text-control { min-height: 40px; padding: 8px 0; border: 0; background: transparent; font: inherit; font-size: 11px; color: var(--muted); text-align: right; }
.auth-text-control:disabled { opacity: 1; cursor: default; }
.auth-terms { margin: 4px 0 22px; }
.auth-terms .auth-checkbox { align-items: flex-start; }
.auth-terms input { margin-top: 3px; }
.auth-terms a { color: var(--ink); text-decoration: underline; text-decoration-color: #c6c9be; text-underline-offset: 3px; }
.auth-submit { width: 100%; min-height: 46px; padding: 12px 18px; border: 1px solid var(--ink); font-size: 13px; cursor: pointer; }
.auth-status { margin: 0; font-size: 12px; line-height: 1.7; color: var(--muted); }
.auth-status:not(:empty) { margin-top: 12px; }
.auth-switch { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--border); text-align: center; font-size: 12px; color: var(--muted); line-height: 1.8; }
.auth-switch a { color: #a6532e; font-weight: 600; }
.auth-switch a:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-home { display: block; width: fit-content; margin: 18px auto 0; padding: 10px; font-size: 11px; line-height: 1.5; color: var(--muted); }
.auth-home:hover { color: var(--ink); }
@media (max-width: 480px) {
  .auth-layout { padding: 36px 0 28px; }
  .auth-brand { margin-bottom: 24px; }
  .auth-card { padding: 26px 22px; }
  .auth-intro h1 { font-size: 26px; }
}

/* Login polish only; registration keeps its existing layout. */
.auth-login .auth-card { padding-block: 28px; }
.auth-login .auth-eyebrow { margin-bottom: 10px; }
.auth-login .auth-intro h1 { margin-bottom: 10px; }
.auth-login .auth-form { margin-top: 22px; }
.auth-login .auth-field { margin-bottom: 8px; }
.auth-login .auth-field > label { margin-bottom: 6px; }
.auth-login .auth-error { min-height: 18px; margin-top: 4px; }
.auth-login .auth-options { margin-bottom: 14px; }
.auth-login .auth-switch { margin-top: 20px; padding-top: 16px; }
.auth-login .auth-home { margin-top: 8px; }
.auth-login .password-field input { padding-right: 54px; }
.auth-login .password-toggle { top: 50%; bottom: auto; right: 7px; transform: translateY(-50%); min-width: 40px; min-height: 32px; padding: 5px 4px; font-size: 10px; line-height: 1.5; }
.auth-login #remember { appearance: none; position: relative; width: 16px; height: 16px; border: 1px solid #c7cbbf; border-radius: 4px; background: #fdfcf9; cursor: pointer; }
.auth-login #remember:checked { background: var(--ink); border-color: var(--ink); }
.auth-login #remember:checked::after { content: ''; position: absolute; top: 2px; left: 5px; width: 4px; height: 8px; border: solid #fff; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
@media (max-width: 480px) {
  .auth-login .auth-card { padding-block: 24px; }
}
@media (forced-colors: active) {
  .auth-login #remember { appearance: auto; }
  .auth-login #remember:checked::after { display: none; }
}

@media (max-width: 900px), (pointer: coarse) {
  .auth-login .password-toggle { min-height: 44px; min-width: 44px; right: 3px; }
  .auth-login .password-field input { padding-right: 56px; }
  .auth-options { flex-wrap: wrap; }
}

/* --- Phase 2A: the recovery-key step on register.html --------------------
   Reuses the existing card, typography and button tokens; nothing above is
   changed. The key itself is monospaced and allowed to wrap, because it is 68
   characters and must stay readable (and selectable) at phone width. */
.auth-recovery { margin-top: 26px; }
.auth-recovery .auth-intro h2 { margin: 0 0 12px; font-size: 22px; line-height: 1.25; font-weight: 650; letter-spacing: -.035em; }
.auth-recovery-key { margin: 22px 0 0; padding: 16px; border: 1px solid #dedfd6; border-radius: var(--radius-control); background: #fdfcf9; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; line-height: 1.9; letter-spacing: .04em; word-break: break-all; user-select: all; }
.auth-recovery-key:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.auth-recovery-actions { display: flex; gap: 10px; margin-top: 12px; }
.auth-recovery-button { flex: 1 1 0; min-width: 0; min-height: 40px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-control); background: #f5f4ef; color: var(--ink); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.auth-recovery-button:hover { background: #eeede6; }
.auth-recovery-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.auth-recovery-warning { margin: 16px 0 0; padding: 12px 14px; border-left: 2px solid var(--warning); background: #fdf8f3; color: var(--warning); font-size: 11px; line-height: 1.7; }
.auth-recovery .auth-terms { margin: 18px 0 20px; }
.auth-status[data-variant="error"] { color: var(--danger); }
.auth-status[data-variant="warning"] { color: var(--warning); }
@media (max-width: 480px) {
  .auth-recovery-actions { flex-direction: column; }
}

/* --- Phase 2A: reset-password choice + recovery-key textarea ------------- */
.auth-choice { margin: 0 0 20px; padding: 0; border: 0; }
.auth-choice legend { padding: 0; margin-bottom: 10px; font-size: 12px; font-weight: 600; line-height: 1.5; }
.auth-choice-option { display: flex; align-items: flex-start; gap: 10px; padding: 12px; margin-bottom: 8px; border: 1px solid #dedfd6; border-radius: var(--radius-control); background: #fdfcf9; cursor: pointer; }
.auth-choice-option:has(input:checked) { border-color: var(--ink); background: #fff; }
.auth-choice-option input { flex-shrink: 0; width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--ink); }
.auth-choice-option input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.auth-choice-option span { display: block; font-size: 12px; line-height: 1.6; }
.auth-choice-option strong { display: block; font-weight: 600; }
.auth-choice-option small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.auth-field textarea { width: 100%; min-width: 0; padding: 12px; border: 1px solid #dedfd6; border-radius: var(--radius-control); background: #fdfcf9; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; line-height: 1.7; letter-spacing: .03em; resize: vertical; }
.auth-field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.auth-field textarea[aria-invalid="true"] { border-color: var(--danger); }

/* --- Phase 2B: password strength meter ----------------------------------
   Reuses the existing tokens. The bar is decorative; the label is the live
   region a screen reader actually reads. */
.pw-meter { margin-top: 8px; }
.pw-meter-track { height: 4px; border-radius: 2px; background: #e8e7e1; overflow: hidden; }
.pw-meter-fill { height: 100%; width: 0; border-radius: 2px; background: var(--danger); transition: width .15s ease, background-color .15s ease; }
.pw-meter-fill[data-score="2"] { background: var(--warning); }
.pw-meter-fill[data-score="3"] { background: #7d8b53; }
.pw-meter-fill[data-score="4"] { background: var(--success); }
.pw-meter-label { margin: 6px 0 0; font-size: 11px; line-height: 1.6; color: var(--muted); }
.pw-meter-advice { margin: 3px 0 0; font-size: 11px; line-height: 1.6; color: var(--muted); }
.pw-meter-advice[data-variant="warning"] { color: var(--warning); }
@media (prefers-reduced-motion: reduce) { .pw-meter-fill { transition: none; } }
