/* The pages the server renders itself (pages.ts): signing in, an account
   with no access, and the relay handoff. Every other page is the web app's,
   with its own style sheet (packages/web/src/app.css). The colour tokens are
   the app's, with their dark variant; the rules are the app's, kept for what
   these pages show. */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e1e4ea;
  --text: #1b2230;
  --muted: #5f6979;
  --faint: #656e7d;
  --accent: #4f46e5;
  --accent-soft: #eceafd;
  --ok: #16a34a;
  --ok-soft: #e4f5ea;
  --warn: #d97706;
  --warn-soft: #fdf2e1;
  --bad: #dc2626;
  --bad-soft: #fce8e8;
  --info: #0284c7;
  --info-soft: #e1f1fa;
  --unknown: #64748b;
  --unknown-soft: #edf0f4;
  /* Chip text: the status colours, darkened to 4.5:1 on their soft backgrounds. */
  --ok-text: #157a3a; --warn-text: #b45309; --bad-text: #b91c1c; --info-text: #0369a1; --unknown-text: #566175;
  --c1: #6366f1; --c2: #0ea5e9; --c3: #14b8a6; --c4: #f59e0b; --c5: #a855f7;
  --code-bg: #f3f4f7;
  --add: #e6f6ea; --del: #fbe9e9;
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1117; --surface: #161a22; --surface-2: #1d222c; --border: #2a303c;
    --text: #e6e9ef; --muted: #9aa3b2; --faint: #8690a0;
    --accent: #8b85f4; --accent-soft: #23213d;
    --ok: #4ade80; --ok-soft: #132a1c; --warn: #fbbf24; --warn-soft: #2d2411;
    --bad: #f87171; --bad-soft: #321617; --info: #38bdf8; --info-soft: #0f2938;
    --unknown: #94a3b8; --unknown-soft: #212733;
    --ok-text: #4ade80; --warn-text: #fbbf24; --bad-text: #f87171; --info-text: #38bdf8; --unknown-text: #94a3b8;
    --c1: #818cf8; --c2: #38bdf8; --c3: #2dd4bf; --c4: #fbbf24; --c5: #c084fc;
    --code-bg: #11151c; --add: #13291c; --del: #321617;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
body.plain { display: block; overflow: auto; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--code-bg); padding: 1px 5px; border-radius: 4px; }
p code { overflow-wrap: anywhere; }
h1 { font-size: 19px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0 0 8px; }
.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }

.brand { font-weight: 750; font-size: 16px; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; width: 196px; flex: none; color: var(--text); }
.brand .mark { width: 24px; height: 24px; border-radius: 7px; background: var(--accent); color: #fff; display: grid; place-items: center; }
.brand .mark .i { width: 14px; height: 14px; }
.brand span { color: var(--accent); }
@media (max-width: 860px) {
  .brand { width: auto; }
  .brand .word { display: none; }
}

main { overflow-y: auto; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; min-width: 0; }
.stack > * + * { margin-top: 16px; }
form.stack > * + * { margin-top: 12px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none; }
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.btn { font: inherit; font-size: 13px; }
.muted { color: var(--muted); }
.notice { border-radius: var(--radius); padding: 10px 14px; font-size: 13px; background: var(--info-soft); margin-bottom: 16px; }
.notice.bad { background: var(--bad-soft); color: var(--text); }
.login { max-width: 360px; margin: 12vh auto 0; }
.login .brand { width: auto; justify-content: center; margin-bottom: 18px; font-size: 22px; }

/* Keyboard focus is always visible: 3 px of the accent, at least 5:1 on the surfaces. */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
