/* Archivr's own faces, embedded and served same-origin.
 *
 * These are the WOFF2 `latin` subsets already generated for the web UI
 * (ui/public/fonts/<family>/latin.woff2), copied in as artefacts — no
 * subsetting step, no Python in a Go repo. The portal is English-only
 * chrome, so `latin` is the whole requirement; latin-ext, cyrillic, greek
 * and vietnamese are ~200 KB of glyphs no screen here can render.
 *
 * All three are VARIABLE fonts. Verified by parsing each WOFF2's table
 * directory, which is uncompressed and so readable without decoding the
 * Brotli payload: every file carries `fvar` and `gvar` (Cormorant and
 * JetBrains also `avar`, Outfit also `MVAR`). So one declaration per family
 * across a weight RANGE is correct, and the browser interpolates real
 * letterforms rather than synthesising a bold — which on a display serif is
 * the visible failure this was worth checking for.
 *
 * The declared ranges below are MEASURED, not recalled. Each face was
 * rendered at 100..1000 in steps of 100 and probed two ways: advance width,
 * and ink coverage (summed alpha over the rasterised glyphs). A variable
 * font interpolates until it reaches an axis endpoint and then clamps, so
 * the weight at which the measurement stops changing IS the endpoint.
 *
 *   Cormorant Garamond  300..700   +56% ink across the range
 *   Outfit              100..900  +313% ink
 *   JetBrains Mono      400..800   +48% ink
 *
 * Width alone is the WRONG probe for JetBrains: a monospaced face holds its
 * advance fixed at every weight by design, so it measured flat (576.00 vs
 * 575.99) and would have read as static. Ink is what distinguishes a real
 * axis from synthesis for it.
 *
 * Declaring a range wider than the axis is harmless — the browser clamps —
 * but declaring the measured range documents what is actually there.
 */
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(/assets/fonts/cormorant-garamond-latin.woff2) format("woff2");
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(/assets/fonts/outfit-latin.woff2) format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/assets/fonts/jetbrains-mono-latin.woff2) format("woff2");
}

/* The account portal's stylesheet.
 *
 * Transcribed from cloud/docs/claim-page-mockup.html, which is normative for
 * layout and copy. Three deliberate departures from it, each with a reason:
 *
 *  1. The faces are Archivr's, served same-origin from the embedded tree
 *     (see the @font-face block above). This needs `font-src 'self'` in
 *     internal/portal.CSP — without it `default-src 'none'` refuses every
 *     face and the page silently renders platform fonts.
 *  2. Real controls. The mockup draws inputs as static divs. These are
 *     <input> and <textarea>, so they carry focus rings, placeholder colour
 *     and disabled states the drawing had no need for.
 *  3. The frame is gone. The mockup's `.page` is `height:100%;
 *     overflow:hidden` because it sits inside a drawn browser chrome. A real
 *     page scrolls.
 */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg:#141414; --panel:#1c1c1c; --card:#282828; --card2:#303030;
  --line:#3a3a3a; --line2:#4a4a4a;
  --tx:#f2f2f2; --tx2:#b9b9b9; --tx3:#8e8e8e;
  --gold:#e5a00d; --ok:#5ec26a; --bad:#ef5b5b; --warn:#e5a00d;

  --disp:'Cormorant Garamond','Iowan Old Style','Palatino Linotype',Palatino,Georgia,serif;
  --body:'Outfit',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,system-ui,sans-serif;
  --mono:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--tx);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
}

/* The icon sprite is markup, not a picture: it must occupy no space. */
.sprite { display: none; }

/* app.js toggles the `hidden` attribute to switch screens, and several
 * layout rules below set `display`, which would beat it. */
[hidden] { display: none !important; }

.page {
  min-height: 100vh;
  padding: 32px 20px 64px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.col { width: 100%; max-width: 432px; }
.col.narrow { max-width: 404px; }

/* ---- brand ---- */
.brand { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.brandmark { width: 44px; height: 44px; flex: none; display: block; }
.brandname { font-family: var(--disp); font-size: 20px; font-weight: 600; line-height: 1.1; }
.brandsub { font-family: var(--mono); font-size: 11px; color: var(--tx3); }

/* ---- who is signed in ---- */
.acctbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px;
  padding: 8px 12px; margin-bottom: 14px; font-size: 12px; color: var(--tx2);
}
.who { display: flex; align-items: center; gap: 7px; min-width: 0; }
.who svg { color: var(--ok); flex: none; }
.who span { overflow-wrap: anywhere; }

/* ---- card ---- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 20px 20px 18px;
}
.card.tight { padding: 6px 18px 10px; }
.h1 { font-family: var(--disp); font-size: 26px; font-weight: 600; line-height: 1.18; margin: 0 0 6px; }
.pagetitle { margin-bottom: 12px; }
.lede { font-size: 13.5px; color: var(--tx2); line-height: 1.5; margin: 0 0 16px; }
.lede b { color: var(--tx); font-weight: 500; }

/* ---- fields ---- */
.fieldlab {
  display: block; font-size: 11.5px; color: var(--tx3);
  text-transform: uppercase; letter-spacing: .8px; font-weight: 600; margin-bottom: 5px;
}
.field {
  width: 100%; display: block;
  background: #151515; border: 1px solid var(--line2); border-radius: 9px;
  padding: 10px 12px; margin-bottom: 13px; min-height: 40px;
  color: var(--tx); font-family: var(--mono); font-size: 12.5px;
}
.field.body { font-family: var(--body); font-size: 14px; }
.field::placeholder { color: var(--tx3); }
.field:focus-visible, .cbox:focus-visible, .btn:focus-visible, .lnkbtn:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}
.field:focus { border-color: var(--gold); }
.field.dots { letter-spacing: 2px; }

/* The verification token is hex.EncodeToString(32 bytes) = 64 characters,
 * which cannot fit one line in this column, so the control WRAPS rather than
 * clipping. A field drawn narrower than its only possible value is a layout
 * that assumes a value that cannot occur. */
.tokenfield { resize: vertical; line-height: 1.55; overflow-wrap: anywhere; }
.fval.tok { font-size: 11.5px; }

/* ---- the eight claim-code boxes ---- */
.cboxes { display: flex; gap: 6px; justify-content: space-between; margin-bottom: 14px; }
.cbox {
  flex: 1; width: 100%; min-width: 0; height: 52px;
  border: 1px solid var(--line2); border-radius: 8px; background: #151515;
  text-align: center; text-transform: uppercase;
  font-family: var(--mono); font-size: 20px; color: var(--gold); padding: 0;
}
.cbox:focus { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(229, 160, 13, .18); }

/* ---- hints and inline messages ---- */
.hint { display: flex; gap: 8px; font-size: 12px; color: var(--tx2); line-height: 1.45; margin: 2px 0 14px; }
/* Every direct child of a flex container is its own column, so running text
 * must sit inside ONE span — never directly in .hint or .foot. */
.hint-t { flex: 1; min-width: 0; }
.hint svg { color: var(--gold); flex: none; margin-top: 2px; }
.hint b { color: var(--tx); }

.inerr {
  display: flex; gap: 8px; background: #2c1212; border: 1px solid #6b2626;
  border-radius: 9px; padding: 10px 12px; font-size: 12px; color: #f0cccc;
  line-height: 1.45; margin-bottom: 14px;
}
.inerr svg { color: var(--bad); flex: none; margin-top: 2px; }
.inerr b { color: #fff; }

.inok {
  display: flex; gap: 8px; background: #13290f; border: 1px solid #2f5c28;
  border-radius: 9px; padding: 10px 12px; font-size: 12px; color: #cfe6cc;
  line-height: 1.45; margin-bottom: 14px;
}
.inok svg { color: var(--ok); flex: none; margin-top: 2px; }

.inwarn {
  display: flex; gap: 9px; background: #2e2109; border: 1px solid #6b4f12;
  border-radius: 9px; padding: 11px 13px; font-size: 12px; color: #e8d9b4;
  line-height: 1.5; margin-bottom: 13px;
}
.inwarn svg { color: var(--warn); flex: none; margin-top: 2px; }
.inwarn b { color: #fff2d4; }

/* ---- banners ---- */
.banner { display: flex; gap: 11px; border-radius: 11px; padding: 13px 15px; margin-bottom: 14px; align-items: flex-start; }
.b-ok { background: #13290f; border: 1px solid #2f5c28; }
.b-warn { background: #2e2109; border: 1px solid #6b4f12; }
.bicon { flex: none; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.b-ok .bicon { background: var(--ok); color: #0d2410; }
.b-warn .bicon { background: var(--warn); color: #1a1400; }
.btitle { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.bbody { font-size: 12.5px; color: var(--tx2); line-height: 1.45; }

/* ---- the "one step left" row ---- */
.nextrow {
  display: flex; gap: 10px; background: var(--card2); border: 1px solid var(--line);
  border-radius: 9px; padding: 11px 13px; margin-bottom: 13px;
}
.nextrow svg { color: var(--gold); flex: none; margin-top: 2px; }
.ed1 { font-size: 12.5px; color: var(--tx); }
.ed2n { font-size: 12px; color: var(--tx2); margin-top: 3px; line-height: 1.45; }

/* ---- buttons and links ---- */
.btn {
  display: block; font-family: var(--body); font-size: 14px; font-weight: 500;
  border-radius: 9px; padding: 11px 18px; border: 1px solid transparent;
  cursor: pointer; letter-spacing: .2px;
}
.btn.wide { width: 100%; }
.btn.pri { background: var(--gold); color: #1a1400; border-color: var(--gold); }
.btn.ghost { background: transparent; color: var(--tx); border-color: var(--line2); }
.btn.off { background: #2a2a2a; color: var(--tx3); border-color: var(--line); cursor: not-allowed; }
.btn[disabled] { background: #2a2a2a; color: var(--tx3); border-color: var(--line); cursor: not-allowed; }
.btnrow { display: flex; gap: 10px; margin-top: 14px; }
.btnrow .btn { flex: 1; text-align: center; }

.lnk { color: var(--gold); font-size: 12px; }
.lnkbtn {
  background: none; border: none; padding: 0; margin: 0;
  font-family: var(--body); cursor: pointer;
}
.alt {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 14px; border-top: 1px solid var(--line); padding-top: 13px;
}

/* ---- the server list ---- */
.srow {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--line); font-size: 12.5px;
}
.srow:last-child { border-bottom: none; }
.skey { color: var(--tx); font-size: 13.5px; font-weight: 500; flex: none; }
.sval { color: var(--tx2); font-family: var(--mono); font-size: 12px; flex: 1; min-width: 0; text-align: right; overflow-wrap: anywhere; }
.sval.ok { color: var(--ok); }
.sempty { padding: 12px 0; font-size: 12.5px; color: var(--tx2); }

.srvnote {
  display: flex; gap: 8px; font-size: 12px; color: #e8d9b4; line-height: 1.45;
  background: rgba(229, 160, 13, .10); border: 1px solid rgba(229, 160, 13, .30);
  border-radius: 9px; padding: 11px 13px; margin-top: 13px;
}
.srvnote svg { color: var(--gold); flex: none; margin-top: 2px; }

/* ---- footer note ---- */
.foot {
  font-size: 11.5px; color: var(--tx3); text-align: center; margin-top: 16px;
  display: flex; align-items: center; justify-content: center; gap: 6px; line-height: 1.45;
}
.foot-t { min-width: 0; }
.foot b { color: var(--tx2); }

@media (max-width: 420px) {
  .cbox { height: 46px; font-size: 17px; }
  .h1 { font-size: 23px; }
}
