/* FIDEWARD/BRANDS */
/* The look of every page Fideward draws. Two faces only: Anton for the one title, Archivo for
   everything else. Every page is one sheet of A4 on a ground, with filled fields, square buttons and
   soft shadows, never outlines. A brand's page (look-210by297) sits on 210 × 297's pale ground in
   Sashiko's green; Fideward's own backup (look-fideward) keeps its near-black ground with graph paper.
   Secondary facts are set in the ink colour at a readable size, never small and grey. */

@font-face { font-family: Anton; src: url("/fonts/anton.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: Archivo; src: url("/fonts/archivo.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --ink: #1f2221;
  --green: #2f6650;
  --green-deep: #234d3c;
  --green-pale: #e9f2ed;
  --trouble: #6d1f23;
  --trouble-pale: #f6e5e3;
  --well: #f1f2ef;
  --white: #ffffff;
  --ground: #f3f4f2;
  --lift: 0 1px 2px rgb(20 22 28 / 0.08), 0 3px 8px rgb(20 22 28 / 0.08);
  --float: 0 2px 6px rgb(20 22 28 / 0.06), 0 18px 48px rgb(20 22 28 / 0.12);
  --space: 24px;
  --control: 48px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 400 16px/1.5 Archivo, Arial, sans-serif; color: var(--ink); background: var(--ground); min-height: 100vh; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--green); font-weight: 600; }

/* The ground, the name in its corner, and the sheet of A4 */
.ground { min-height: 100vh; display: grid; place-items: center; padding: 104px 16px 48px; position: relative; }
.wordmark { position: absolute; top: 28px; left: 32px; text-decoration: none; color: var(--ink); }
.look-210by297 .wordmark { font: 400 26px/1 Anton, sans-serif; letter-spacing: 0.01em; }
.sheet { width: min(420px, 100%); min-height: 594px; background: var(--white); box-shadow: var(--float); padding: 56px 48px; display: flex; flex-direction: column; gap: var(--space); }
.sheet.wide { width: min(560px, 100%); }
h1 { font: 400 52px/0.95 Anton, sans-serif; text-transform: uppercase; margin: 0 0 8px; overflow-wrap: anywhere; }
h2 { font: 600 18px/1.3 Archivo, sans-serif; margin: 0; }
p { margin: 0; }
.part { display: grid; gap: 12px; }
.step, .step > form { display: flex; flex-direction: column; gap: var(--space); }

/* Fideward's own backup: its dark ground and graph paper */
.look-fideward { background: #15171c; }
.look-fideward .ground {
  background-image: linear-gradient(rgb(255 255 255 / 0.05) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / 0.05) 1px, transparent 1px);
  background-size: 24px 24px;
}
.look-fideward .wordmark { font: 600 20px/1 Archivo, sans-serif; color: #fdfcf9; }
.look-fideward .sheet { box-shadow: 0 24px 64px rgb(0 0 0 / 0.45); }

/* Fields: filled, no outline; the label above in ink */
.field { display: grid; gap: 8px; }
.field-label { font-weight: 600; }
.field-input { height: var(--control); border: 0; border-radius: 0; background: var(--well); padding: 0 14px; font-size: 17px; width: 100%; }
.field-input:focus { outline: none; background: var(--white); box-shadow: inset 0 0 0 2px var(--green); }

/* The six boxes of a code */
.code-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.code-boxes input { height: 56px; width: 100%; border: 0; background: var(--well); text-align: center; font: 400 28px Anton, sans-serif; padding: 0; }
.code-boxes input:focus { outline: none; background: var(--white); box-shadow: inset 0 0 0 2px var(--green); }

/* Buttons: square blocks. Green for the one thing to do, a filled well for the others, words in green for the least likely */
.go, .plain { min-height: var(--control); border: 0; border-radius: 0; display: flex; align-items: center; justify-content: center; padding: 0 18px; font-weight: 600; text-decoration: none; cursor: pointer; width: 100%; }
.go { background: var(--green); color: var(--white); box-shadow: var(--lift); }
.go:hover:not(:disabled) { background: var(--green-deep); }
.plain { background: var(--well); color: var(--ink); }
.plain:hover:not(:disabled) { background: var(--green-pale); }
.quiet { border: 0; background: none; padding: 0; color: var(--green); font-weight: 600; cursor: pointer; text-decoration: none; }
.quiet:hover { color: var(--green-deep); text-decoration: underline; }
.go:disabled, .plain:disabled, .quiet:disabled { opacity: 0.55; cursor: default; }
.links { display: flex; flex-wrap: wrap; gap: var(--space); }
.danger { background: var(--trouble); color: var(--white); }
.danger:hover:not(:disabled) { background: #571619; }

/* A notice: a pale fill and words in ink, green for news and red for trouble */
.notice { padding: 12px 14px; background: var(--green-pale); }
.notice.trouble { background: var(--trouble-pale); }
.notice-title { font-weight: 600; }

/* Lines: one thing per filled row (a passkey, a device), its action at the end */
.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.line { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; background: var(--well); }
.line-words { display: grid; }
.line-main { font-weight: 600; }
.lines-empty { padding: 12px 14px; background: var(--well); }
.sent { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; margin-top: -8px; }
.sent .quiet { margin-left: auto; }

/* Recovery codes, two columns, easy to copy down */
.code-list { margin: 0; padding: 12px 14px 12px 40px; background: var(--well); columns: 2; font: 600 17px/1.9 Archivo, monospace; font-variant-numeric: tabular-nums; }

/* Phones: the sheet becomes the page */
@media (max-width: 520px) {
  body, .look-210by297 .ground { background: var(--white); }
  .ground { place-items: start center; padding: 76px 16px 32px; }
  .wordmark { top: 22px; left: 16px; }
  .sheet, .sheet.wide { min-height: 0; box-shadow: none; padding: 8px 0; }
  .look-fideward .sheet { padding: 32px 20px; }
  h1 { font-size: 44px; }
}
