/* The signed-out auth card: /login and /mfa.
 *
 * LIFTED VERBATIM OUT OF login.php ON 2026-11-15, when /mfa needed the same
 * card and the alternative was a second copy of it. The signed-out pages
 * deliberately do not load main.css — they carry their own palette in their own
 * token names — so this is NOT part of the Open Props system and must not start
 * spending its ramps: it is the one sheet the two pages nobody has signed in to
 * yet are allowed to share.
 *
 * Promoted rather than copied, for the reason CLAUDE.md gives about
 * op-utilities.css: a second copy of a muted-paragraph rule is drift waiting to
 * be edited once. Both pages link it with ?v=filemtime, and there is no CDN in
 * front of this box (checked 2026-11-14), so a change is served immediately.
 *
 * /mfa's own controls are at the foot, prefixed .mfa-, and they are LITERAL
 * colours like everything above them. The dashboard's copies of the same three
 * or four controls live in mfa.css and are TOKENS — which is not duplication
 * for its own sake: the signed-out card is reached before any Open Props sheet
 * is in play, so a var(--text-faint) here resolves to nothing, while a hex
 * literal there is a colour the palette cannot remap and scripts/test_admin_render.php
 * refuses it. One sheet cannot satisfy both, and the first version of this
 * tried. Neither surface loads the other's sheet, so the names never collide. */

/* MUTED TEXT, DECLARED ONCE AND DARK ENOUGH TO READ.
 *
 * It was #94a3b8 in seven rules: the subtitle under the wordmark, the footer
 * under every form, the language switch, /mfa's hint and rule label, and the
 * note under the sign-up button that carries the Terms link. On the card's
 * white that is 2.56:1 — the same literal and the same figure CLAUDE.md
 * records as "failing AA on every page in the product" when the dashboard's
 * palette moved. These pages never load main.css, so the fix that landed there
 * never reached them, and nothing measured it: the contrast gate reads sheets
 * a $pageCss page loads, and no signed-out page declares one.
 *
 * #676e76 is 5.16:1, and is the value the product already chose for this job,
 * so "what colour is muted text" has one answer on both sides of the login.
 * A literal repeated seven times is how the next change misses one, which is
 * why it is a property now. scripts/test_signed_out_card.php measures every
 * pair this sheet states. */
:root { --muted: #676e76; }

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, system-ui, 'Segoe UI', Roboto, sans-serif; background: #f5f6fb; color: #16172b;
       display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }
.card { background: #fff; border: 1px solid #e4e7f1; border-radius: 14px;
        padding: 40px; width: 100%; max-width: 400px; box-shadow: 0 2px 4px rgba(22,23,43,.04), 0 20px 50px rgba(22,23,43,.08); }
.brand-mark { display: flex; justify-content: center; margin-bottom: 12px; }
.brand-mark svg { display: block; }
.logo { font-family: 'SF Mono', ui-monospace, monospace; font-size: 19px; font-weight: 700; letter-spacing: 2px;
        text-align: center; margin-bottom: 8px; color: #16172b; }
.subtitle { text-align: center; font-size: 12px; color: var(--muted); margin: 0 0 32px;
            text-transform: uppercase; letter-spacing: 1px; font-weight: 400; }

/* Both cards carry exactly one h1 naming the page. On /mfa the subtitle IS that
 * heading, so the element changes and the margin and weight above have to hold
 * against the browser's h1 defaults. On /login the subtitle is a tagline, so
 * the heading is here instead, read and not seen. Not display:none, which
 * removes it from the accessibility tree along with everything else. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
           overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
label { display: block; font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 6px; margin-top: 16px; }
input, select { width: 100%; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px;
        padding: 10px 12px; color: #0f172a; font-size: 14px; outline: none; }
input:focus, select:focus { border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,0.12); }
/* The select came in with /register on 2026-11-15. It takes the input's box so
 * the two sit in one column without a seam; only the arrow and the height
 * differ, and those are the browser's. */
select { appearance: auto; }
/* ── the password field ────────────────────────────────────────────────────── */

/* The input keeps its own box and the button sits inside its right-hand
 * padding — but the width of that padding is NOT declared here. auth.js is
 * what creates the button, so it is also what knows how wide the word on it
 * came out in this language, and it sets the gutter from that measurement. A
 * constant here would be a guess about French, and it was: 68px held "Show"
 * and "Hide" and left "Masquer" one pixel over the typed value.
 *
 * It follows that a browser which never runs that script gets no gutter beside
 * a button that is not there, which is the behaviour we want anyway. */
.pw-field { position: relative; }
/* Longhands, not the font shorthand: `font: 600 12px/1 inherit` is invalid —
 * the family slot will not take `inherit` — so the browser drops the whole
 * declaration and the button keeps its UA font. Measured at 13.3px Arial 400
 * before this was written, which is the only way that kind of fault is ever
 * found: nothing errors, the text is simply the wrong one. */
.pw-toggle { position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
             background: none; border: 0; padding: 4px 6px; border-radius: 4px;
             font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1;
             color: #4f46e5; cursor: pointer; }
.pw-toggle:hover { color: #4338ca; background: #f5f6fb; }
.pw-toggle:focus-visible { outline: 2px solid #4f46e5; outline-offset: 1px; }

.btn { display: block; width: 100%; padding: 12px; background: #4f46e5; color: #fff;
       border: none; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer;
       margin-top: 24px; }
.btn:hover { background: #4338ca; }
.error { background: #fef2f2; border: 1px solid #fca5a5;
         color: #b91c1c; border-radius: 6px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
/* A refusal that carries its own next step keeps that step in the refusal's
 * voice: same colour, its own line, heavier than the sentence around it. An
 * accent-blue link inside a red box reads as a second, unrelated thing. */
.error a { display: inline-block; margin-top: 4px; color: inherit; font-weight: 600; }
.notice { background: #eff6ff; border: 1px solid #bfdbfe;
          color: #1e40af; border-radius: 6px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }
/* /register's one good outcome. Roomier than the other two because it is the
 * whole content of the card once it appears, rather than a line above a form. */
.success { background: #ecfdf5; border: 1px solid #a7f3d0;
           color: #15803d; border-radius: 6px; padding: 16px; font-size: 13px;
           line-height: 1.5; margin-bottom: 16px; }

/* What you are agreeing to by pressing the button above it: small, but not so
 * small that it reads as something hidden. */
.auth-note { font-size: 11px; color: var(--muted); line-height: 1.55; margin: 14px 0 0; }
.auth-note a { color: #4f46e5; }
/* ── /login's footer ───────────────────────────────────────────────────────── */

/* Two ways back into an account you have, then — below a rule — the way to
 * start one you do not. They were three identical lines, two of them carrying
 * an inline margin-top to undo the margin this rule sets, on a page whose
 * stylesheet is right here. */
.auth-footer { margin-top: 28px; padding-top: 18px; border-top: 1px solid #e4e7f1;
               display: flex; flex-direction: column; align-items: center; gap: 10px;
               text-align: center; font-size: 13px; color: var(--muted); }
.auth-footer a { color: #4f46e5; }
.auth-footer-alt { margin: 4px 0 0; padding-top: 14px; border-top: 1px solid #e4e7f1;
                   width: 100%; }
.lang-bar { text-align: right; margin-bottom: 20px; font-size: 12px; }
.lang-bar a { color: var(--muted); }
.lang-bar a:hover { color: #4f46e5; }

/* ── shared: the focus ring ────────────────────────────────────────────────── */

/* `input { outline: none }` above is safe only because the focus rule under it
 * paints a border and a ring. Nothing else on either card had a focus state at
 * all, so a keyboard user tabbing from the code field to Continue lost the
 * cursor entirely. :focus-visible, so a mouse click does not draw it. */
.btn:focus-visible,
.lang-bar a:focus-visible,
.auth-footer a:focus-visible,
.auth-note a:focus-visible,
select:focus-visible,
.mfa-footer a:focus-visible,
.mfa-footer button:focus-visible,
.mfa-remember input:focus-visible { outline: 2px solid #4f46e5; outline-offset: 2px; }

/* ── /mfa's own controls ───────────────────────────────────────────────────── */

/* The card is centre-weighted from the mark down, so everything on it is
 * centred and the two things that were not — the field labels and the hints —
 * read as strays sitting left of a centred input. */

.mfa-subtitle { margin-bottom: 14px; }

/* WHO IS SIGNING IN. A pill rather than a line of text: it is a fact about the
 * session, not a sentence to read, and it has to survive an address far longer
 * than the card is wide — hence the ellipsis and the title attribute that gives
 * the whole of it back. */
.mfa-who { width: fit-content; max-width: 100%; margin: 0 auto 20px; padding: 5px 12px;
           background: #f5f6fb; border: 1px solid #e4e7f1; border-radius: 999px;
           font-family: 'SF Mono', ui-monospace, monospace; font-size: 12px; color: #475569;
           overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mfa-lede { font-size: 13px; color: #475569; line-height: 1.5; margin: 0 0 20px; text-align: center; }
.mfa-field-label { text-align: center; }
.mfa-hint { font-size: 12px; color: var(--muted); margin: 8px 0 0; line-height: 1.45; text-align: center; }

/* The one sentence on this card that is a consequence rather than a hint, so it
 * is the one that is not grey. Shown on the recovery screen only, and only to
 * someone who actually has a remembered computer to lose. */
.mfa-consequence { font-size: 12px; line-height: 1.45; margin: 14px 0 0; padding: 10px 12px;
                   background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px;
                   color: #92400e; text-align: left; }

/* The passkey button when the person has one: .btn already carries the fill and
 * the geometry, this only makes room for the icon and drops the top margin,
 * since it is the first control on the card rather than a form's last. */
.mfa-btn-icon { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 0; }
.mfa-btn-icon svg { flex: none; }

/* ...and the code form's button when the passkey above IS the fast path. The
 * fill is swapped, nothing else: same width, same padding, same radius, same
 * top margin. Quiet, never disabled-looking — a passkey on a phone is no help
 * on a desktop with no Bluetooth, and that person needs this button. */
.mfa-btn-quiet { background: #fff; color: #16172b; border: 1px solid #cbd5e1; }
.mfa-btn-quiet:hover { background: #fff; border-color: #4f46e5; color: #4f46e5; }

/* A rule with the word "or" sitting in it. The pseudo-elements carry the line so
 * the label has a real background behind it and the rule does not strike it
 * through. */
.mfa-or { display: flex; align-items: center; gap: 12px; margin: 24px 0 4px;
          font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.mfa-or::before, .mfa-or::after { content: ''; flex: 1; height: 1px; background: #e4e7f1; }

/* THE SIX DIGITS ARE THE PAGE. Wide tracking and tabular figures so a mistyped
 * code is visible before it is submitted, which is most of what makes this field
 * forgiving — and at a size that says this is the thing you came here to do.
 *
 * text-indent answers the classic letter-spacing bug: the tracking is applied
 * after the last glyph too, so centred text sits half a space left of centre.
 * The indent is the half-space back. */
.mfa-code { font-family: 'SF Mono', ui-monospace, monospace; font-size: 28px; font-weight: 700;
            letter-spacing: 8px; text-indent: 8px; text-align: center; padding: 14px 12px;
            font-variant-numeric: tabular-nums; }
.mfa-code::placeholder { color: #cbd5e1; font-weight: 400; }

/* The recovery code is the same kind of thing — something copied from elsewhere
 * and checked character by character — so it is set the same way, smaller
 * because it is four times as long. */
.mfa-secret { font-family: 'SF Mono', ui-monospace, monospace; font-size: 15px;
              letter-spacing: 1px; text-indent: 1px; text-align: center; padding: 12px; }
.mfa-secret::placeholder { color: #cbd5e1; letter-spacing: 1px; }

/* A decision about this computer, not about the field above it: ruled off, and
 * centred like everything else. assets/js/mfa.js copies the tick onto the
 * passkey form, so it governs both routes through the page. */
.mfa-remember { display: flex; align-items: flex-start; justify-content: center; gap: 8px;
                margin: 20px 0 0; padding-top: 18px; border-top: 1px solid #e4e7f1;
                font-size: 13px; color: #475569; font-weight: 400; }
/* flex-start, not center: the French label wraps to two lines on a phone, and a
 * centred box then floats between them instead of marking the line it belongs
 * to. The 2px puts it on the first line's cap height when the label fits. */
.mfa-remember input { width: auto; margin: 2px 0 0; flex: none; }

/* The way out of this screen, and the way out of this account. Below a rule and
 * at the size of a footnote, because neither is what the card is for. */
.mfa-footer { margin-top: 28px; padding-top: 18px; border-top: 1px solid #e4e7f1;
              display: flex; flex-direction: column; align-items: center; gap: 10px;
              text-align: center; font-size: 13px; }
.mfa-footer a { color: #4f46e5; }
.mfa-footer form { margin: 0; }
.mfa-footer button { background: none; border: 0; padding: 0; font: inherit;
                     color: var(--muted); cursor: pointer; text-decoration: underline; }
.mfa-footer button:hover { color: #4f46e5; }

/* Shown only when the browser has no WebAuthn, set by assets/js/mfa.js. The
 * default is HIDDEN and the script reveals it: a browser with no JavaScript at
 * all still has the code field, which works without any script, so announcing
 * "passkeys unavailable" by default would be wrong more often than right. */
.mfa-no-passkey { display: none; }
.mfa-no-passkey.is-shown { display: block; }
.mfa-passkey-block.is-hidden { display: none; }

/* ── the narrow card ───────────────────────────────────────────────────────── */

/* 40px of card padding inside 24px of body padding leaves 232px of content on a
 * 360px phone, and the digits are the first thing that stops fitting. Last in
 * the file, so it needs no extra specificity to win. */
@media (max-width: 420px) {
    body { padding: 16px; }
    .card { padding: 28px 20px; }
    .mfa-code { font-size: 24px; letter-spacing: 6px; text-indent: 6px; }
}
