/* scanner-login.css — the page's own rules for views/scanner/login.ejs.
   Moved out of the view's inline <style> on 2026-09-27 (the design-system rule:
   no per-page inline styles). Loaded from the view at the same point in the
   head the block occupied, so the cascade order is unchanged. Anything here
   that a second page needs belongs in app.css instead. */
/* ===== Scanner login — matches the main login (floating watch backdrop) ===== */
body.scanner-login-body {
    margin: 0;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
    overflow: hidden;
    font-family: var(--font-body, system-ui, sans-serif);
    color: var(--text);
}

/* theme.css ("Graphite" blue-slate) wins over app.css on this page by
   specificity, which tinted the backdrop AND the card/keypad surfaces
   bluer than the main login. Re-point the dark surface/border/text
   tokens to app.css's neutral-dark values so both sign-in pages read
   identically in dark mode. */
html[data-theme="dark"] body.scanner-login-body {
    --bg: #0f1216;
    --surface: #171b21;
    --surface-2: #1b2027;
    --border: #262c35;
    --border-strong: #323a45;
    --text: #e7eaee;
    --text-2: #a9b2bf;
    --muted: #aab4c2;
}

/* Card stack sits above the backdrop */
.scanner-login-bg { position: relative; z-index: 1; }

/* The login cards. login.js toggles .hidden between these. */
.scanner-login-card {
    width: 400px;
    max-width: 94vw;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-16, 20px);
    box-shadow: var(--shadow-lg);
    padding: 28px 26px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    animation: scanner-login-rise var(--dur-slow) var(--ease);
}
.scanner-login-card.pin-card { width: 400px; max-width: 94vw; }
@keyframes scanner-login-rise {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

/* Brand row */
.scanner-login-card .login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--font-display, sans-serif);
    font-weight: 700;
    font-size: var(--fs-20, 20px);
    color: var(--text);
    margin: 0 0 4px;
    letter-spacing: -0.01em;
}
.scanner-login-card .login-brand .brand-badge {
    width: 40px;
    height: 40px;
    border-radius: var(--r-12, 11px);
    display: grid;
    place-items: center;
    background: var(--accent);
    color: var(--accent-text);
}
.scanner-login-card .login-brand .brand-badge svg,.scanner-login-card .login-brand .brand-badge i[data-lucide] { width: 22px; height: 22px; }
.scanner-login-card .login-brand svg,.scanner-login-card .login-brand i[data-lucide] { width: 22px; height: 22px; }
.scanner-login-card .login-brand .logo-lockup { --logo-h: 60px; }  /* a step smaller: the PIN pad shares this card */

/* Divider under the logo — matches the main login's .ldiv */
.scanner-login-card .ldiv { height: 1px; background: var(--border); margin: 12px 0 4px; }

.scanner-login-card h2 {
    text-align: center;
    font-family: var(--font-display, sans-serif);
    font-size: var(--fs-16, 16px);
    font-weight: 600;
    color: var(--text-2);
    margin: 14px 0 18px;
    border-bottom: none;
    padding-bottom: 0;
    letter-spacing: -0.01em;
}
.scanner-login-card.pin-card h2 { margin: 14px 0 6px; }
.scanner-login-card .pin-subtitle {
    text-align: center;
    color: var(--muted);
    font-size: var(--fs-13, 13px);
    margin: 0 0 16px;
}
.scanner-login-card .pin-subtitle strong { color: var(--text); font-weight: 600; }

/* Wider card for the user picker so 3 columns stay comfortable */
#user-selection-view { width: 520px; }

/* User picker grid — login.js builds .scanner-user-btn tiles */
.scanner-user-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.scanner-user-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    padding: 18px 10px;
    border: 1px solid var(--border);
    border-radius: var(--r-16, 14px);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
    text-align: center;
}
.scanner-user-btn:hover {
    border-color: var(--avatar-color, var(--accent));
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
/* `html[data-theme]` outranks app.css's dark-mode `.user-avatar` rule (amber initials on
   a raised-surface fill), which turned these initials amber on the coloured gradient. */
.scanner-user-btn .user-avatar,
html[data-theme] .scanner-user-btn .user-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #fff;
    font-family: var(--font-display, sans-serif);
    font-weight: 600;
    font-size: var(--fs-16, 16px);
    box-shadow: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.scanner-user-btn .user-name {
    font-size: var(--fs-13, 13px);
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}

/* PIN keypad */
.pin-display {
    display: flex;
    gap: 14px;
    justify-content: center;
    align-items: center;
    height: auto;
    width: auto;
    background: transparent;
    border: none;
    border-radius: 0;
    margin: 4px 0 8px;
}
.pin-dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid var(--border-strong);
    transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.pin-dot.filled {
    background: var(--accent);
    border-color: var(--accent);
    transform: none;
}
/* A wrong PIN is felt, not only read (owner, 2026-11-17, round 2 of the design principles, Charles Liu's
   "exaggerated feedback"): the dots turn red and shake, then clear for the next try (src/scanner/public/login.js
   adds .is-wrong). Reduced motion: the tokens make it 1ms — the red stays for its moment. */
/* the mock's shake, measured (Charles Liu #10): 420ms, a head shake that swings widest in its middle */
@keyframes pin-shake {
    10%, 90% { translate: -2px 0; }
    20%, 80% { translate: 4px 0; }
    30%, 50%, 70% { translate: -7px 0; }
    40%, 60% { translate: 7px 0; }
}
.pin-display.is-wrong { animation: pin-shake calc(var(--dur-slow) * 1.6154) cubic-bezier(.36, .07, .19, .97); }
.pin-display.is-wrong .pin-dot { border-color: var(--red); }
.pin-display.is-wrong .pin-dot.filled { background: var(--red); border-color: var(--red); }
.pin-error {
    height: 20px;
    text-align: center;
    color: var(--red);
    font-size: var(--fs-12, 12.5px);
    font-weight: 600;
    margin: 0 0 8px;
}
.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 4px;
}
.pin-keypad button {
    height: 62px;
    border-radius: var(--r-16, 14px);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    font-family: var(--font-display, sans-serif);
    font-size: var(--fs-20, 22px);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--dur-instant) var(--ease), border-color var(--dur-instant) var(--ease), transform var(--dur-instant) var(--ease);
}
.pin-keypad button:hover { background: var(--surface); border-color: var(--accent); }
.pin-keypad button:active { transform: scale(.96); }
.pin-keypad button.utility {
    font-size: var(--fs-13, 13px);
    font-weight: 600;
    color: var(--text-2);
    background: var(--surface-2);
}
.pin-keypad button.utility:hover { background: var(--surface); color: var(--text); border-color: var(--accent); }
/* OK sends the typed PIN (login.js). Its fill and disabled look are the canonical
   .btn.primary / .btn:disabled — only size and placement here. */
.pin-ok {
    width: 100%;
    height: 56px;
    margin-top: 12px;
    justify-content: center;
    border-radius: var(--r-16, 14px);
    font-family: var(--font-display, sans-serif);
    font-size: var(--fs-17, 17px);
}

/* TOTP / setup forms */
.scanner-totp-form { display: flex; flex-direction: column; gap: 12px; align-items: stretch; margin-top: 8px; }
.scanner-totp-form input[type="text"] {
    width: 100%;
    height: 58px;
    border-radius: var(--r-12, 13px);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    text-align: center;
    font-family: var(--font-mono, monospace);
    font-size: var(--fs-30, 28px);
    letter-spacing: .5rem;
    outline: none;
    padding: 0 .4rem;
}
.scanner-totp-form input[type="text"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.scanner-totp-form .row { display: flex; gap: 10px; }
.scanner-totp-form .row > * { flex: 1; justify-content: center; }
.scanner-totp-form .keypad-btn,
.scanner-totp-form .utility {
    height: 46px;
    border-radius: var(--r-12, 12px);
    font-size: var(--fs-14, 14px);
    font-weight: 600;
    cursor: pointer;
}

.scanner-setup-qr {
    display: block;
    margin: 12px auto;
    width: 200px;
    height: 200px;
    image-rendering: pixelated;
    background: #fff;
    padding: 6px;
    border-radius: var(--r-12, 12px);
    border: 1px solid var(--border);
}
.scanner-setup-secret {
    font-family: var(--font-mono, monospace);
    font-size: var(--fs-14, 0.85rem);
    word-break: break-all;
    padding: .45rem .65rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-12, 10px);
    user-select: all;
    text-align: center;
    margin: 8px 0;
    color: var(--text);
}
.scanner-setup-help {
    font-size: var(--fs-12, 12.5px);
    color: var(--muted);
    line-height: 1.45;
    margin: 8px 0;
}
.scanner-setup-help strong { color: var(--text); }

/* Fixed theme toggle, mirrors the examples corner button */
.scanner-login-theme-btn {
    position: fixed;
    top: 18px;
    right: 18px;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: inherit;
    border-radius: var(--r-12, 10px);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 10;
}
.scanner-login-theme-btn:hover { border-color: var(--accent); color: var(--text); }
.scanner-login-theme-btn svg,.scanner-login-theme-btn i[data-lucide] { width: 18px; height: 18px; }
