/* Staff sign-in gate, shared by every signed-in page and served as /staff-auth.css.
   Self-contained so it reads the same everywhere; a page may set --sa-accent to its own colour. */
.sa-gate {
  --sa-paper: #F3F5F8; --sa-sheet: #FFFFFF; --sa-ink: #161D2B; --sa-muted: #5C6577; --sa-faint: #8A93A5;
  --sa-rule: #E1E5EC; --sa-err: #C43349; --sa-accent-ink: #FFFFFF;
  position: fixed; inset: 0; z-index: 1000; overflow-y: auto;
  display: grid; place-items: center; padding: 32px max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px));
  background: var(--sa-paper); color: var(--sa-ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sa-gate {
    --sa-paper: #0E1218; --sa-sheet: #161B24; --sa-ink: #E6E9F0; --sa-muted: #9AA3B5; --sa-faint: #6D7689;
    --sa-rule: #262D3A; --sa-err: #F27D8F; --sa-accent-ink: #0E1218;
  }
}
:root[data-theme="dark"] .sa-gate {
  --sa-paper: #0E1218; --sa-sheet: #161B24; --sa-ink: #E6E9F0; --sa-muted: #9AA3B5; --sa-faint: #6D7689;
  --sa-rule: #262D3A; --sa-err: #F27D8F; --sa-accent-ink: #0E1218;
}
.sa-gate[hidden], .sa-gate [hidden] { display: none !important; }
.sa-gate * { box-sizing: border-box; }
.sa-gate h1, .sa-gate h2 { font-family: inherit; text-transform: none; color: inherit; }
.sa-card { width: 100%; max-width: 400px; background: var(--sa-sheet); border: 1px solid var(--sa-rule); border-radius: 14px; padding: 26px 24px; display: grid; gap: 14px; }
.sa-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.sa-brand svg { width: 28px; height: auto; flex: none; }
.sa-brand h1 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.1; }
.sa-brand small { display: block; color: var(--sa-muted); font-size: 13px; }
.sa-step, .sa-step form { display: grid; gap: 12px; }
.sa-gate h2 { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.2; }
.sa-gate p { margin: 0; color: var(--sa-muted); }
.sa-gate p b { color: var(--sa-ink); }
.sa-gate input { font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--sa-rule); background: var(--sa-paper); color: var(--sa-ink); width: 100%; }
.sa-gate input:focus { outline: 2px solid var(--sa-accent, #2742C4); outline-offset: 1px; }
.sa-btn { font: inherit; font-weight: 600; padding: 10px 14px; border-radius: 8px; border: 0; background: var(--sa-accent, #2742C4); color: var(--sa-accent-ink); cursor: pointer; }
.sa-btn:disabled { opacity: 0.6; cursor: default; }
.sa-link { font: inherit; background: none; border: 0; padding: 0; color: var(--sa-accent, #2742C4); font-weight: 600; cursor: pointer; justify-self: start; }
.sa-gate .sa-err { color: var(--sa-err); font-size: 14px; }

/* Code entry: Backpack's CodeEntryCard. One box per character, a drawn dash, one hidden field behind. */
.sa-code { position: relative; justify-self: start; }
.sa-boxes { display: flex; align-items: center; gap: 8px; }
.sa-boxes span { width: 44px; height: 54px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--sa-faint); display: grid; place-items: center; font-weight: 700; font-size: 26px; background: var(--sa-sheet); }
.sa-boxes span.next { box-shadow: inset 0 0 0 2px var(--sa-accent, #2742C4); }
.sa-boxes i { font-style: normal; font-weight: 700; font-size: 24px; color: var(--sa-muted); padding-inline: 3px; }
.sa-code input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.02; border: 0; padding: 0; background: transparent; color: transparent; caret-color: transparent; cursor: text; }
.sa-code input:focus { outline: none; }
.sa-code:not(:focus-within) .sa-boxes span.next { box-shadow: inset 0 0 0 1px var(--sa-faint); }
@media (max-width: 360px) { .sa-boxes span { width: 38px; height: 48px; font-size: 22px; } .sa-boxes { gap: 6px; } }
