/* Kestrel Listen — shared portal design system.
 *
 * Replaces 16 templates' worth of copy-pasted <style> blocks (same hex
 * values retyped by hand in every file, no single source of truth) with
 * one stylesheet. Palette and type are grounded in what the network
 * actually produces -- a live RF spectrum waterfall -- not a generic
 * SaaS-dashboard blue. See docs/session-handovers/ for the design review
 * this replaced (2026-08-01).
 *
 * Font files: static/fonts/ (Ubuntu Font Family, Canonical Ltd, Ubuntu
 * Font Licence 1.0 -- see static/fonts/LICENCE.txt). Self-hosted
 * deliberately: no Google Fonts dependency on an authentication page.
 */

@font-face {
  font-family: 'UbuntuCond';
  src: url('fonts/Ubuntu-C.ttf') format('truetype');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'UbuntuBody';
  src: url('fonts/Ubuntu-R.ttf') format('truetype');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'UbuntuBody';
  src: url('fonts/Ubuntu-B.ttf') format('truetype');
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: 'UbuntuData';
  src: url('fonts/UbuntuMono-R.ttf') format('truetype');
  font-weight: 400; font-display: swap;
}

:root {
  --ink: #090d12;
  --ink-2: #04070a;
  --panel: #10161f;
  --border: #223040;
  --border-soft: #161e29;

  --signal: #2dd4bf;
  --signal-bright: #55e9d6;
  --signal-deep: #123a52;

  --warn: #e8a33d;
  --warn-bg: #2a2013;
  --crit: #ef5a6f;
  --crit-bg: #2a1519;
  /* Completes the base/bright hover pairing --signal already establishes
     -- was a hardcoded literal on button.danger:hover in my-node.html
     (MSF-UX-COHERENCE-01), same value, just never named. */
  --crit-bright: #ff7a8b;
  /* Deliberately distinct from --crit -- reserved for the one real
     safety-critical control (TX emergency stop), never routine danger
     buttons, so severity still reads at a glance instead of both
     collapsing into "the red one". */
  --emergency: #800000;
  --ok: #4ade80;
  --ok-bg: #10281c;

  --text: #c9d3da;
  --text-dim: #7789a0;
  --text-faint: #445162;

  --font-display: 'UbuntuCond', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'UbuntuBody', ui-sans-serif, system-ui, sans-serif;
  --font-data: 'UbuntuData', ui-monospace, 'SF Mono', Consolas, monospace;
}

/* Deliberately one dark world -- an instrument panel checked at odd
   hours, not a themeable SaaS product. Not an omission. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--signal); color: var(--ink); }
a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, input:focus-visible, button:focus-visible, select:focus-visible {
  outline: 2px solid var(--signal); outline-offset: 2px;
}
h1 {
  font-family: var(--font-display); font-weight: 400; font-size: 22px;
  letter-spacing: 2px; text-transform: uppercase; color: var(--text);
  margin: 0 0 8px;
}

/* ---- centred-card layout (auth flow: login, reset, enrol, etc.) ---- */

body.card-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 24px; position: relative;
}
.card {
  width: 100%; max-width: 420px;
  background: var(--panel); border: 1px solid var(--border);
  padding: 34px 32px 26px; border-radius: 2px;
}
.subtitle {
  color: var(--text-dim); font-size: 13px; line-height: 1.55;
  margin-bottom: 24px;
}
.subtitle a { color: var(--text-dim); }

/* ---- document layout (register, fleet lists) ---- */

body.doc { max-width: 680px; margin: 44px auto; padding: 0 20px 60px; }

/* ---- prose (manual.html -- the first body.doc page with real running
   text/lists rather than just a form, so these never had a home before) ---- */

body.doc h2 {
  font-family: var(--font-display); font-weight: 400; font-size: 17px;
  letter-spacing: 1px; text-transform: uppercase; color: var(--text);
  margin: 32px 0 10px;
}
body.doc h2:first-of-type { margin-top: 8px; }
body.doc p { font-size: 14px; line-height: 1.65; margin: 0 0 12px; color: var(--text); }
body.doc ul, body.doc ol { font-size: 14px; line-height: 1.65; margin: 0 0 12px; padding-left: 22px; }
body.doc li { margin-bottom: 8px; }
body.doc li b { color: var(--text); }

/* ---- back-link (standalone entry pages -- register/manual/login/
   login-landing had no path back to the public console at all, found
   live 2026-08-14) ---- */

.back-link {
  display: inline-block; margin-bottom: 16px; font-size: 12px;
  color: var(--text-dim);
}
.back-link:hover { color: var(--signal); }
body.card-page .back-link { position: absolute; top: 24px; left: 24px; }

/* ---- brand lockup (entry points only -- see the waterfall notes) ---- */

.brand { display: flex; align-items: center; gap: 13px; margin-bottom: 26px; }
.brand .word {
  font-family: var(--font-display); font-weight: 400; font-size: 21px;
  letter-spacing: 3px; text-transform: uppercase; line-height: 1.1; color: var(--text);
}
.brand .sub {
  font-family: var(--font-data); font-size: 10px; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--text-dim); margin-top: 5px;
}

/* ---- waterfall header (login.html, login-landing.html,
   operator-login.html, register.html only -- the actual entry points.
   Everything reached by a specific link/action stays quiet: this is the
   one bold gesture, spent deliberately in a few places, not everywhere. ---- */

.waterfall {
  position: relative; height: 84px;
  display: flex; align-items: flex-end; gap: 2px;
  background: linear-gradient(180deg, var(--ink-2) 0%, var(--ink) 100%);
  border-bottom: 1px solid var(--border);
  overflow: hidden; padding: 0 1px;
  /* Cancels .card's own padding (34px 32px 26px) exactly, so the strip
     bleeds flush to the card's top/left/right edges regardless of what
     padding value .card ends up with -- change one, not two. */
  margin: -34px -32px 26px;
}
body.doc .waterfall { margin: 0 -20px 32px; }
.waterfall .bar {
  flex: 1 1 0; min-width: 2px; height: 100%; transform-origin: bottom;
  background: linear-gradient(180deg, var(--signal) 0%, var(--signal-deep) 100%);
  opacity: 0.82;
  animation-name: kestrel-pulse; animation-duration: 3.6s;
  animation-iteration-count: infinite; animation-timing-function: ease-in-out;
}
.waterfall .bar.hot {
  background: linear-gradient(180deg, var(--warn) 0%, var(--signal) 45%, var(--signal-deep) 100%);
  opacity: 0.95;
}
@keyframes kestrel-pulse {
  0%, 100% { transform: scaleY(var(--h1)); }
  50%      { transform: scaleY(var(--h2)); }
}
.sweep {
  position: absolute; top: 0; bottom: 0; left: -2%; width: 1px;
  background: var(--text); opacity: 0.5;
  box-shadow: 0 0 10px 1px var(--signal-bright);
  animation: kestrel-sweep 11s linear infinite;
}
@keyframes kestrel-sweep { from { left: -2%; } to { left: 102%; } }
@media (prefers-reduced-motion: reduce) {
  .waterfall .bar { animation: none; transform: scaleY(var(--h1)); }
  .sweep { display: none; }
}

/* ---- forms ---- */

label { display: block; margin-top: 16px; }
.field, label.field { display: block; margin-top: 16px; }
.field .label, label > span:first-child {
  display: block; font-family: var(--font-data); font-size: 10px;
  letter-spacing: 1.1px; text-transform: uppercase; color: var(--text-dim);
  margin-bottom: 6px;
}
input, select, textarea {
  width: 100%; padding: 10px 12px; margin-top: 4px;
  background: var(--ink); border: 1px solid var(--border); color: var(--text);
  font-family: var(--font-data); font-size: 13px; border-radius: 2px;
}
input:focus, select:focus, textarea:focus { border-color: var(--signal); }
/* Checkboxes/radios must not inherit the full-width text-input treatment
   above -- register.html's "I have a scanner" checkbox would otherwise
   stretch to the whole form width and render as a giant unusable box. */
input[type="checkbox"], input[type="radio"] {
  width: auto; margin: 0 8px 0 0; vertical-align: middle;
  accent-color: var(--signal);
}
.totp-hint { color: var(--text-faint); font-size: 11px; margin-top: 6px; display: block; }

button, a.button {
  margin-top: 22px; width: 100%; padding: 12px; border-radius: 2px;
  background: var(--signal); border: none; color: var(--ink-2);
  font-family: var(--font-display); font-weight: 400; font-size: 15px;
  letter-spacing: 2.2px; text-transform: uppercase; cursor: pointer;
  text-align: center; text-decoration: none; display: block; box-sizing: border-box;
}
button:hover, a.button:hover { background: var(--signal-bright); }
button.danger { background: var(--crit); color: var(--ink-2); }
button.danger:hover { background: #ff7a8b; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Honeypot -- a real user never sees or fills this in (CSS-hidden, not
   display:none/hidden, which some bots skip specifically because those
   are the obvious tells) -- BOT-MITIGATION-01, unchanged behaviour. */
.hp-field { position: absolute; left: -9999px; top: -9999px; }

/* ---- message boxes ---- */

.error {
  background: var(--crit-bg); border: 1px solid var(--crit); color: var(--crit);
  padding: 10px 14px; border-radius: 2px; margin-bottom: 18px; font-size: 13px;
}
.notice, .sent {
  background: var(--ok-bg); border: 1px solid #1c6b45; color: var(--ok);
  padding: 10px 14px; border-radius: 2px; margin-bottom: 18px; font-size: 13px; line-height: 1.55;
}
.warning {
  background: var(--warn-bg); border: 1px solid #96701f; color: #f3c375;
  padding: 10px 14px; border-radius: 2px; margin: 16px 0 20px; font-size: 13px; line-height: 1.55;
}
.note, .privacy-note, .hint {
  font-size: 11.5px; color: var(--text-faint); margin-top: 6px; line-height: 1.5;
}
.privacy-note { color: var(--text-dim); }
.grid-preview {
  margin-top: 8px; padding: 8px 12px; border-radius: 2px; display: none;
  background: var(--ink); border: 1px solid var(--border);
  font-family: var(--font-data); font-size: 15px; color: var(--signal);
}
.grid-preview.visible { display: block; }

/* ---- data display: credentials, secrets, codes ---- */

.box {
  background: var(--panel); border: 1px solid var(--border); border-radius: 2px;
  padding: 20px; margin: 20px 0;
}
.box .label { color: var(--text-dim); font-size: 11px; }
.box .value, .value {
  color: var(--signal); font-family: var(--font-data); font-size: 15px; margin-top: 2px;
}
.qr { text-align: center; margin: 20px 0; }
.qr img { background: #fff; padding: 12px; border-radius: 4px; width: 200px; height: 200px; }
.secret {
  text-align: center; font-family: var(--font-data); font-size: 13px;
  background: var(--ink); border: 1px solid var(--border); border-radius: 2px;
  padding: 10px; margin: 12px 0 20px; word-break: break-all; color: var(--signal);
}
.codes {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  background: var(--ink); border: 1px solid var(--border); border-radius: 2px;
  padding: 16px; font-family: var(--font-data); font-size: 14px; color: var(--signal);
  font-variant-numeric: tabular-nums;
}

/* ---- links, footers ---- */

.foot, .footer {
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-soft);
  font-family: var(--font-data); font-size: 10.5px; color: var(--text-faint);
  line-height: 1.7; text-align: left;
}
.footer { text-align: center; }
.foot a, .footer a { color: var(--text-dim); }
.links { margin-top: 14px; text-align: center; font-size: 12px; }
.choice {
  display: block; padding: 14px; margin-top: 14px; border-radius: 2px;
  background: var(--ink); border: 1px solid var(--border); color: var(--text);
  text-decoration: none;
}
.choice:hover { border-color: var(--signal); text-decoration: none; }
.choice strong {
  color: var(--signal); display: block; font-size: 14px;
  font-family: var(--font-display); letter-spacing: 0.5px; text-transform: uppercase;
}
.choice span { color: var(--text-dim); font-size: 12px; }

/* ---- tables + status pills (fleet / device lists) ---- */

table { width: 100%; border-collapse: collapse; margin-top: 12px; }
th {
  text-align: left; color: var(--text-dim); font-size: 11px;
  letter-spacing: 0.5px; text-transform: uppercase;
  padding: 7px 8px; border-bottom: 1px solid var(--border);
  font-family: var(--font-data); font-weight: 400;
}
td { padding: 9px 8px; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.empty { color: var(--text-faint); font-style: italic; padding: 14px 0; }

.status {
  display: inline-block; padding: 2px 9px; border-radius: 10px;
  font-family: var(--font-data); font-size: 10.5px; letter-spacing: 0.3px;
}
.status.approved, .status.provisioned { background: var(--ok-bg); color: var(--ok); }
.status.pending { background: var(--warn-bg); color: var(--warn); }

a.manage, a.open { font-size: 12px; margin-right: 12px; }

/* ---- confirmation modal ---- */

.modal {
  display: none; position: fixed; inset: 0; background: rgba(4,7,10,0.75); z-index: 100;
}
.modal.open { display: flex; align-items: center; justify-content: center; }
.modal-box {
  background: var(--panel); border: 1px solid var(--border); border-radius: 2px;
  padding: 24px; min-width: 340px;
}
.modal-box h3 {
  margin: 0 0 10px; color: var(--crit); font-family: var(--font-display);
  letter-spacing: 1px; text-transform: uppercase; font-weight: 400; font-size: 17px;
}
.modal-box .actions { margin-top: 16px; display: flex; gap: 8px; }
.modal-box .actions button { margin-top: 0; width: auto; padding: 9px 18px; font-size: 12px; letter-spacing: 1.5px; }
.modal-box .actions button:not(.danger) { background: var(--border); color: var(--text); }
.modal-box .actions button:not(.danger):hover { background: var(--border-soft); }

@media (max-width: 480px) {
  .card { padding: 26px 20px 20px; }
  body.doc { margin: 24px auto; }
}
