/* SRS Access portal — T-02-20260707-010.
   Design language: Senate Recording Studio control room. Federal navy ink on
   cool studio gray, engraved-brass accents (decorative strokes only, never
   body text), and the tally-lamp status system: green = on air / ready,
   amber = pending, red = attention. One signature moment (the two-door
   landing split); everything else stays quiet. */

:root {
  --ink: #17233b;
  --ink-muted: #5a6577;
  --surface: #edf0f4;
  --panel: #ffffff;
  --panel-edge: #d7dce4;
  --navy: #1f3257;
  --navy-deep: #17233b;
  --brass: #a88434;
  --brass-ink: #7c6023;
  --tally-green: #2e7d4f;
  --tally-amber: #b97a1d;
  --tally-red: #ba3b2c;
  --lamp-off: #9aa4b2;
  --focus: #2c5ec9;
  --radius: 10px;
  --font-display: Georgia, 'Iowan Old Style', 'Times New Roman', serif;
  --font-body: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Mono', 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--navy); color: #fff; padding: 8px 16px; z-index: 50;
}
.skip-link:focus { left: 8px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- shared primitives ---------- */

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: 0.01em; }
h1 { font-size: 1.9rem; margin: 0 0 4px; }
h2 { font-size: 1.35rem; margin: 0 0 8px; }
h3 { font-size: 1.05rem; margin: 0 0 6px; }
p { margin: 0 0 12px; }
a { color: var(--navy); }
code, .mono { font-family: var(--font-mono); font-size: 0.92em; }

.muted { color: var(--ink-muted); }
.small { font-size: 0.86rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: 0.95rem;
  border-radius: var(--radius); border: 1px solid transparent;
  padding: 10px 18px; cursor: pointer; text-decoration: none;
  background: var(--navy); color: #fff;
}
.btn:hover { background: var(--navy-deep); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.secondary { background: var(--panel); color: var(--navy); border-color: var(--panel-edge); }
.btn.secondary:hover { border-color: var(--navy); background: var(--panel); }
.btn.danger { background: var(--tally-red); }
.btn.link { background: none; border: none; color: var(--navy); text-decoration: underline; padding: 4px 6px; font-weight: 500; }
.btn.small-btn { padding: 6px 12px; font-size: 0.86rem; }

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.field .hint { font-weight: 400; color: var(--ink-muted); font-size: 0.82rem; margin-top: 3px; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="number"], input[type="search"], select, textarea {
  font: inherit; color: var(--ink);
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--panel-edge); border-radius: 8px; background: #fff;
}
input:focus, select:focus, textarea:focus { border-color: var(--navy); }

.card {
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  padding: 22px;
}

.error-note {
  background: #faeeec; border: 1px solid var(--tally-red); color: #7c2317;
  border-radius: 8px; padding: 10px 14px; margin: 0 0 14px;
}
.ok-note {
  background: #ecf4ef; border: 1px solid var(--tally-green); color: #1d5236;
  border-radius: 8px; padding: 10px 14px; margin: 0 0 14px;
}

/* Tally lamp — the portal's one status language. */
.lamp {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  background: var(--lamp-off);
  box-shadow: inset 0 -2px 3px rgba(0,0,0,0.28), 0 0 0 2px rgba(255,255,255,0.55);
  vertical-align: baseline; margin-right: 7px; flex: none;
}
.lamp.green { background: var(--tally-green); box-shadow: inset 0 -2px 3px rgba(0,0,0,0.25), 0 0 6px rgba(46,125,79,0.55); }
.lamp.amber { background: var(--tally-amber); box-shadow: inset 0 -2px 3px rgba(0,0,0,0.25), 0 0 6px rgba(185,122,29,0.5); }
.lamp.red   { background: var(--tally-red);   box-shadow: inset 0 -2px 3px rgba(0,0,0,0.25), 0 0 6px rgba(186,59,44,0.55); }
.lamp.big { width: 18px; height: 18px; }

.status-line { display: inline-flex; align-items: center; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%; border-collapse: collapse; font-size: 0.92rem; background: var(--panel);
}
table.data th {
  text-align: left; font-weight: 600; color: var(--ink-muted); font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 10px 12px; border-bottom: 2px solid var(--panel-edge);
}
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--panel-edge); vertical-align: top; }
table.data tr:last-child td { border-bottom: none; }

/* ---------- toast ---------- */
#toast-region { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 40; }
.toast {
  background: var(--navy-deep); color: #fff; border-radius: 8px;
  padding: 12px 18px; box-shadow: 0 6px 18px rgba(23,35,59,0.35); max-width: 380px;
}
.toast.error { background: var(--tally-red); }

/* ---------- public pages (landing, recovery, applicant, workspaces) ---------- */

.public-shell {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  padding: 0 20px 40px;
}

/* Slim public top bar: the wordmark is the way home; the right side shows
   live session state. */
.public-bar {
  width: 100%; max-width: 880px; display: flex; align-items: center; gap: 14px;
  padding: 14px 0 26px;
}
.public-bar.hero { justify-content: flex-end; padding-bottom: 0; }
.public-bar .spacer { flex: 1; }
.bar-brand {
  font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0.05em;
  color: var(--navy-deep); text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.bar-brand .brand-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brass); }
.bar-brand:hover { text-decoration: underline; }
.session-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 0.86rem; color: var(--ink-muted); }
.session-chip .mono { color: var(--ink); }
.public-shell .public-body { width: 100%; max-width: 880px; }
.public-shell.narrow .public-body { max-width: 460px; }

.wordmark { text-align: center; margin: 34px 0; }
.wordmark .mark-title {
  font-family: var(--font-display); font-size: 2.3rem; letter-spacing: 0.04em;
  color: var(--navy-deep); margin: 0;
}
.wordmark .mark-sub {
  color: var(--ink-muted); letter-spacing: 0.24em; text-transform: uppercase;
  font-size: 0.72rem; margin-top: 6px;
}
.wordmark .mark-rule {
  width: 72px; height: 3px; background: var(--brass); border: none; margin: 14px auto 0;
}

/* The signature: two studio doors. */
.doors { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 26px; }
.door {
  display: block; text-align: left; text-decoration: none; cursor: pointer;
  background: var(--panel); color: var(--ink);
  border: 1px solid var(--panel-edge); border-top: 4px solid var(--navy);
  border-radius: var(--radius); padding: 26px 24px 22px;
  font: inherit; width: 100%;
}
.door:hover { border-top-color: var(--brass); box-shadow: 0 8px 22px rgba(23,35,59,0.12); }
.door .door-lamp { margin-bottom: 14px; }
.door .door-title { font-family: var(--font-display); font-size: 1.35rem; display: block; margin-bottom: 6px; }
.door .door-desc { color: var(--ink-muted); font-size: 0.94rem; }

.public-footer { margin-top: 26px; text-align: center; color: var(--ink-muted); font-size: 0.85rem; }

.signin-card { max-width: 460px; margin: 0 auto; }
.signin-card .actions { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; gap: 10px; flex-wrap: wrap; }

.qr-box { text-align: center; margin: 14px 0; }
.qr-box svg { width: 200px; height: 200px; }
.manual-key { word-break: break-all; }

/* ---------- portal shell ---------- */

.portal-shell { min-height: 100vh; display: flex; flex-direction: column; }
.portal-topbar {
  background: var(--navy-deep); color: #fff;
  display: flex; align-items: center; gap: 18px; padding: 10px 22px;
}
.portal-topbar .brand {
  font-family: var(--font-display); font-size: 1.15rem; letter-spacing: 0.05em;
  color: #fff; text-decoration: none; display: inline-flex; align-items: center; gap: 10px;
}
.portal-topbar .brand .brand-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brass); }
.portal-topbar .spacer { flex: 1; }
.portal-topbar .who { font-size: 0.88rem; color: #c4cddd; }
.portal-topbar .who .mono { color: #fff; }
.portal-topbar .btn.link { color: #dfe6f1; }

.portal-main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 28px 22px 48px; }
.portal-main .crumb { margin-bottom: 18px; }
.portal-main .crumb a { text-decoration: none; color: var(--ink-muted); }
.portal-main .crumb a:hover { color: var(--navy); text-decoration: underline; }

/* Seven-action home. */
.home-intro { margin-bottom: 24px; }
.home-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.tile {
  display: block; text-decoration: none; color: var(--ink); text-align: left;
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: var(--radius);
  padding: 22px 20px; cursor: pointer; font: inherit; width: 100%;
}
.tile:hover { border-color: var(--navy); box-shadow: 0 6px 18px rgba(23,35,59,0.10); }
.tile .tile-icon { width: 44px; height: 44px; margin-bottom: 12px; display: block; }
.tile .tile-icon svg { width: 100%; height: 100%; stroke: var(--brass-ink); }
.tile .tile-title { font-family: var(--font-display); font-size: 1.12rem; display: block; margin-bottom: 4px; }
.tile .tile-desc { color: var(--ink-muted); font-size: 0.88rem; }
.tile .tile-count { margin-top: 10px; font-size: 0.84rem; color: var(--ink-muted); display: flex; align-items: center; }
.tile .tile-count:empty { display: none; }

/* Wizard (Update a user). */
.wizard-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; padding: 0; list-style: none; }
.wizard-steps li {
  font-size: 0.82rem; color: var(--ink-muted);
  padding: 5px 12px; border: 1px solid var(--panel-edge); border-radius: 999px; background: var(--panel);
}
.wizard-steps li[aria-current="step"] { border-color: var(--brass); color: var(--ink); font-weight: 600; }

.result-list { list-style: none; margin: 0; padding: 0; }
.result-list li { border-bottom: 1px solid var(--panel-edge); }
.result-list li:last-child { border-bottom: none; }
.result-list button {
  display: flex; width: 100%; text-align: left; gap: 14px; align-items: center;
  background: none; border: none; font: inherit; padding: 12px 8px; cursor: pointer; border-radius: 6px;
}
.result-list button:hover { background: var(--surface); }

.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }

/* Stat tiles for management/monitoring views (quiet, not a dashboard wall). */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--panel); border: 1px solid var(--panel-edge); border-radius: var(--radius);
  padding: 14px 16px;
}
.stat .stat-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-muted); }
.stat .stat-value { font-family: var(--font-display); font-size: 1.7rem; margin-top: 2px; }

.section { margin-bottom: 26px; }

.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 22px; margin: 12px 0; }
.detail-grid dt { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-muted); margin: 0; }
.detail-grid dd { margin: 1px 0 8px; }

.pending-block { text-align: center; padding: 34px 20px; }
.pending-block .lamp { margin: 0 auto 14px; display: block; }
.spinner {
  width: 26px; height: 26px; border-radius: 50%; margin: 0 auto 14px;
  border: 3px solid var(--panel-edge); border-top-color: var(--navy);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 700px) {
  .doors { grid-template-columns: 1fr; }
  .portal-topbar { flex-wrap: wrap; }
  .public-shell { padding-top: 28px; }
}
