:root { --brand-header: #0F3040; --brand-header-2: #184A60; --brand-accent: #C49A3C; --brand-accent-deep: #8B6914; --on-header: #fff; --brand-strong: #0F3040; --on-brand-strong: #fff; --brand-strong-2: #0c2836; --on-accent: #fff; --login-bg: #0F3040; --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; --bg: #F3F4F6; --surface: #fff; --text: #1C2430; --muted: #5B6472; --border: #D5DBE3; --danger: #B42318; color-scheme: light; }
@media (prefers-color-scheme: dark) { :root { --bg: #0E1418; --surface: #151D23; --text: #E6EAEE; --muted: #8A96A1; --border: #34444F; --danger: #F97066; color-scheme: dark; } }
* { box-sizing: border-box; }
body.auth { margin: 0; min-height: 100vh; display: grid; place-items: center; padding: 16px; font: 15px/1.5 var(--font); color: var(--text);
  background: var(--login-bg); background-image: linear-gradient(160deg, rgba(0,0,0,0), rgba(0,0,0,.28)); }
.auth-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.auth-card { width: 380px; max-width: 100%; background: var(--surface); border-radius: 16px; padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.auth-card.wide { width: 620px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 18px; }
.logo { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--brand-accent), var(--brand-accent-deep)); color: var(--on-accent); display: grid; place-items: center; font-weight: 800; flex: none; }
.brand-logo { max-height: 56px; max-width: 220px; width: auto; display: block; }
.brand.has-logo { flex-direction: column; align-items: flex-start; gap: 8px; }
.logo-for-dark { display: none; }
@media (prefers-color-scheme: dark) { .logo-for-light { display: none; } .logo-for-dark { display: block; } .back-link { color: var(--accent-text, #D1B168); } }
.lead { color: var(--muted); margin: -8px 0 12px; }
.below { text-align: center; color: rgba(255,255,255,.85); font-size: 13px; }
.below a { color: inherit; }
.below.on-light { color: rgba(0,0,0,.7); }
.support-line { margin-top: 16px; font-size: 12.5px; color: var(--muted); text-align: center; }
.support-line a { color: inherit; }
.powered-by { font-size: 12px; opacity: .8; }
.back-link { display: inline-block; margin-top: 12px; text-align: center; width: 100%; font-weight: 600; color: var(--brand-strong); text-decoration: none; }
h1 { font-size: 22px; margin: 0 0 16px; }
h2 { font-size: 15px; margin: 22px 0 6px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
label { display: block; margin: 10px 0; font-weight: 600; font-size: 13.5px; }
input { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; font: inherit; background: var(--surface); color: var(--text); }
input:focus { outline: none; border-color: var(--brand-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent) 30%, transparent); }
.btn { display: inline-block; margin-top: 14px; width: 100%; padding: 11px; border: 0; border-radius: 9px; background: var(--brand-strong); color: var(--on-brand-strong); font: inherit; font-weight: 700; cursor: pointer; text-align: center; text-decoration: none; }
.btn:hover { background: var(--brand-strong-2); }
.btn:disabled { opacity: .5; }
.err { background: #FDECEA; color: #8A1C12; border-radius: 8px; padding: 8px 12px; }
.warn { background: #FFF7E6; color: #5A4300; border-radius: 8px; padding: 8px 12px; }
.muted { color: var(--muted); font-size: 13px; }
.code { background: #0F3040; color: #F4E3B8; padding: 10px 12px; border-radius: 8px; overflow-x: auto; font-size: 12.5px; white-space: pre-wrap; word-break: break-all; }
.env { width: 100%; border-collapse: collapse; font-size: 13px; }
.env td { padding: 3px 0; border-bottom: 1px solid var(--border); }
.env .ok { color: #1E7B3A; font-weight: 700; text-align: right; }
.env .bad { color: var(--danger); font-weight: 700; text-align: right; }
.note { background: #EEF4FB; color: #1B3F66; border-radius: 8px; padding: 8px 12px; }
.code-step .lead { margin: 0 0 12px; }
.code-step input[name=code] { letter-spacing: 3px; font-size: 20px; text-align: center; }
.hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.btn.secondary { background: transparent; color: var(--brand-strong); border: 1px solid currentColor; }
.btn.secondary:hover { background: rgba(0, 0, 0, .04); }
.or-line { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; color: #5B6472; font-size: 13px; }
.or-line::before, .or-line::after { content: ''; flex: 1; height: 1px; background: #d5dbe3; }
.or-line[hidden], .pk-btn[hidden], #pk-err[hidden] { display: none; }

/* "Add to home screen": a standing offer, not a bar that appears once and can only be refused. */
.ia-wrap { margin: 18px 0 0; text-align: center; }
.ia-link {
  background: none; border: 0; padding: 6px 4px; font: inherit; font-size: 13px;
  color: var(--brand-strong); text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.ia-link:hover { opacity: .8; }
.ia-link:focus-visible { outline: 2px solid var(--brand-strong); outline-offset: 2px; border-radius: 4px; }
.ia-panel {
  margin: 10px 0 0; padding: 12px 14px; text-align: left;
  background: #EEF4FB; color: #1B3F66; border-radius: 10px; font-size: 13px; line-height: 1.5;
}
.ia-panel p { margin: 0 0 8px; }
.ia-panel ol { margin: 0; padding-left: 20px; }
.ia-panel li { margin: 0 0 4px; }
.ia-panel .ia-why { margin: 10px 0 0; color: #4A6B8C; font-size: 12px; }
.ia-panel .btn { margin: 2px 0 0; }
.forgot-link { display: block; margin-top: 10px; text-align: center; font-size: 14px; color: var(--brand-strong); }
@media (prefers-color-scheme: dark) { .forgot-link { color: var(--accent-text, #D1B168); } }
/* 3.40: staff sign-in steps (authenticator setup, backup codes) and the phone setup page */
.tf-qr { display: flex; justify-content: center; margin: 8px 0; }
.tf-qr svg { width: 220px; height: 220px; border: 1px solid #d0d4da; border-radius: 8px; background: #fff; }
.backup-codes { columns: 2; list-style: none; padding: 0; margin: 8px 0 14px; }
.backup-codes code, .settings-table code { font-size: 14px; }
.auth-card.wide { max-width: 640px; }
.settings-table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0; }
.settings-table th, .settings-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #e3e6ea; vertical-align: top; word-break: break-all; }
.device-list { list-style: none; padding: 0; }
.device-list li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid #e3e6ea; }
.device-list form.inline { margin-left: auto; }

/* 3.48: phones. The page is a one-column grid, so the 380px card used to set the column width and push the
   sign-in card 6-80px past the right edge on every iPhone. The column now shrinks to the screen. */
body.auth { grid-template-columns: minmax(0, 1fr); }
.auth-wrap { min-width: 0; max-width: 100%; }
@media (max-width: 420px) {
  body.auth { padding: 12px; }
  .auth-card { padding: 22px 18px; }
}
/* iPhones zoom the whole page in when you tap a box with text smaller than 16px, and it stays zoomed. */
@supports (-webkit-touch-callout: none) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size: max(16px, 1em); }
}
