/* ── css/auth-flow.css ───────────────────────────────
   Shared by the auth callback / reset-password page, the Forgot-password and
   magic-link-code views on the login page, the Profile "Security" card and the
   development-only local badge. Built on the same tokens and the same
   .auth-field / .auth-cta / .auth-error pieces as css/auth.css. */

/* Local development badge (only ever added by js/auth-env.js on localhost / 127.0.0.1 / [::1]). */
.gf-local-badge {
    position: fixed;
    left: 50%;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 40;
    max-width: calc(100vw - 24px);
    box-sizing: border-box;
    pointer-events: none;
    padding: 4px 10px;
    border: 1px dashed var(--gold, #d9a21b);
    border-radius: 999px;
    background: var(--bg, #0c0c0e);
    box-shadow: inset 0 0 0 999px rgba(217, 162, 27, 0.10);
    color: var(--gold, #d9a21b);
    font-size: 11px;
    letter-spacing: 0.04em;
    line-height: 1.3;
    text-align: center;
}
.gf-local-badge strong { font-weight: 700; letter-spacing: 0.08em; }
.auth-local-help {
    margin: 12px 0 0;
    font-size: 11px;
    line-height: 1.45;
    color: var(--text-hint);
    text-align: center;
}

/* Single-card layout for the callback page. */
.auth-flow-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: max(24px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(32px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
}
.auth-flow-card {
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 28px 24px;
}
.auth-flow-brand {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 16px;
    color: var(--text); text-decoration: none; margin-bottom: 20px;
}
.auth-flow-logo { color: var(--gold); flex: 0 0 auto; }
.auth-flow-view[hidden] { display: none; }
.auth-flow-view { text-align: left; }
.auth-flow-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 22px; font-weight: 600; line-height: 1.25;
    color: var(--text); margin: 0 0 8px;
    outline: none;
}
.auth-flow-text { font-size: 14px; line-height: 1.5; color: var(--text); margin: 0 0 16px; }
.auth-flow-note { font-size: 12px; line-height: 1.5; color: var(--text-hint); margin: 0 0 16px; }
.auth-flow-hint { font-size: 12px; line-height: 1.4; color: var(--text-hint); margin: 0 0 14px; }
.auth-flow-icon { font-size: 34px; line-height: 1; margin-bottom: 10px; }
.auth-flow-icon--ok { color: var(--green); }
.auth-flow-icon--warn { color: var(--gold); }
.auth-flow-cta { display: block; box-sizing: border-box; text-align: center; text-decoration: none; }
.auth-flow-spinner {
    width: 28px; height: 28px; margin-bottom: 12px;
    border: 3px solid var(--border); border-top-color: var(--gold); border-radius: 50%;
    animation: auth-flow-spin 0.9s linear infinite;
}
@keyframes auth-flow-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .auth-flow-spinner { animation: none; } }

/* Labels are announced by screen readers; the placeholder carries the visible text (same pattern as the login form). */
.auth-flow-label {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.auth-flow-view .auth-field input { padding-right: 64px; box-sizing: border-box; }
.auth-flow-toggle {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    min-width: 48px; min-height: 36px; padding: 0 8px;
    background: none; border: none; border-radius: var(--radius-sm);
    color: var(--gold); font-size: 12px; font-weight: 600; cursor: pointer;
}
.auth-flow-toggle:hover { text-decoration: underline; }
.auth-flow-card button:focus-visible, .auth-flow-card a:focus-visible, .auth-flow-card input:focus-visible,
.auth-secondary:focus-visible, .auth-link-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.auth-flow-cta, .auth-cta { min-height: 44px; }
.auth-flow-card .auth-error[hidden], .auth-flow-card .auth-ok[hidden] { display: none; }

/* Login page additions: divider, secondary button, in-panel Forgot / code views. */
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0; font-size: 11px; letter-spacing: 0.08em; color: var(--text-hint); }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-secondary {
    width: 100%; min-height: 44px; box-sizing: border-box;
    background: transparent; color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600; cursor: pointer;
}
.auth-secondary:hover { border-color: var(--gold); }
.auth-secondary[disabled] { opacity: 0.6; cursor: default; }
.auth-forgot--below { text-align: center; margin: 12px 0 0; }
.auth-forgot--below button, .auth-link-btn { background: none; border: none; padding: 4px 6px; font-size: 12px; color: var(--green); cursor: pointer; min-height: 32px; }
.auth-forgot--below button:hover, .auth-link-btn:hover { text-decoration: underline; }
.auth-ok {
    background: var(--green-dim, rgba(76, 175, 80, 0.12)); border: 1px solid var(--green-border, rgba(76, 175, 80, 0.4)); color: var(--text);
    border-radius: var(--radius-sm); padding: 8px 12px; font-size: 12px; line-height: 1.45; margin: 12px 0 0;
}
.auth-code-row { display: flex; gap: 8px; margin-top: 10px; }
.auth-code-row input { flex: 1; min-width: 0; border: 1px solid var(--border); padding: 10px 12px; font-size: 14px; letter-spacing: 0.15em; box-sizing: border-box; }
.auth-code-row button { flex: 0 0 auto; min-height: 44px; padding: 0 14px; border: none; border-radius: var(--radius-sm); background: var(--red); color: #fff; font-weight: 600; cursor: pointer; }
.auth-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Profile › Security card. */
.pf-security-form { display: grid; gap: 10px; max-width: 420px; }
.pf-security-form[hidden], #changePwNonceRow[hidden], .pf-security-msg[hidden] { display: none; }
.pf-security-btn {
    display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 20px; border: none;
    border-radius: var(--radius-md); background: var(--green); color: #fff; font-size: 13px; font-weight: 600; font-family: 'Inter', sans-serif; cursor: pointer;
}
.pf-security-btn:disabled { opacity: 0.6; cursor: default; }
.pf-security-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.pf-security-form label { font-size: 12px; color: var(--text-hint); }
.pf-security-form input {
    width: 100%; box-sizing: border-box; padding: 10px 12px; font-size: 14px;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-input, var(--bg)); color: var(--text);
}
.pf-security-msg { font-size: 12px; line-height: 1.45; margin: 0; }
.pf-security-msg--error { color: var(--red); }
.pf-security-msg--ok { color: var(--green); }
