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

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--sp-5);
  background: var(--page);
  color: var(--ink);
  font: var(--fs-body)/1.5 var(--display-font);
  /* Numerals must not shimmy between renders; the whole product is numbers. */
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

/* One panel per page. Sized in ch so the measure holds as type scales. */
.panel {
  width: 100%;
  max-width: 44ch;
  padding: var(--sp-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-panel);
  box-shadow: var(--elev-resting);
}

/* The lockup has a 180px floor in the identity rules. Below that the symbol is
 * the correct asset, not a smaller lockup — so this never shrinks past it. */
.mark {
  display: block;
  width: 180px;
  max-width: 100%;
  height: auto;
  margin-bottom: var(--sp-5);
}

h1 {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-title);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.lead {
  margin: 0 0 var(--sp-5);
  font-size: var(--fs-body);
  color: var(--muted);
}

form { margin: 0; }

label {
  display: block;
  margin-bottom: var(--sp-1);
  font-size: var(--fs-body);
  font-weight: 500;
}

/* A second field in the same form needs air above it. This is a class rather
 * than an inline style attribute because the page's own content-security policy
 * is style-src 'self' with no 'unsafe-inline' — an inline style is silently
 * dropped by the browser and logged as a violation. */
label.spaced { margin-top: var(--sp-4); }

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: var(--sp-3);
  /* 16px. Anything smaller and iOS Safari zooms the viewport on focus. */
  font: var(--fs-field)/1.4 var(--display-font);
  color: var(--ink);
  background: var(--surface);
  /* --border is a 10% wash and does not clear 3:1; a control's boundary must. */
  border: 1px solid var(--field-border);
  border-radius: var(--r-control);
}

input::placeholder { color: var(--muted); opacity: 1; }

/* The one-time code is typed from an email, often on a phone, often
 * transcribed. Wide tracking makes a mis-keyed character visible. */
input.code {
  font-size: var(--fs-lead);
  letter-spacing: 0.35em;
  text-align: center;
}

button {
  width: 100%;
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  font: 600 var(--fs-field)/1.4 var(--display-font);
  /* Ink, not cobalt. Cobalt on white measures 4.10:1 — under the 4.5:1 that
   * normal text needs. tokens.test.ts asserts that, so this is not folklore. */
  color: var(--surface);
  background: var(--ink);
  border: 1px solid transparent;
  border-radius: var(--r-control);
  cursor: pointer;
}

button.secondary {
  color: var(--ink);
  background: transparent;
  border-color: var(--field-border);
}

/* One ring, everywhere, no exceptions. The offset is load-bearing: a filled
 * button would otherwise draw the ring colour-on-colour against itself. */
:focus-visible {
  outline: var(--focus-width) solid var(--focus-color);
  outline-offset: var(--focus-offset);
}

/* Never remove the indicator for mouse users without replacing it. Browsers
 * that do not support :focus-visible fall back to their own ring. */
:focus:not(:focus-visible) { outline: none; }

.alt {
  margin: var(--sp-5) 0 0;
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
  font-size: var(--fs-body);
  color: var(--muted);
}

.alt a { color: var(--ink); }

.note {
  margin: var(--sp-4) 0 0;
  font-size: var(--fs-meta);
  color: var(--muted);
}

/* Errors are announced, not just coloured — colour alone is not a message. */
.error {
  margin: 0 0 var(--sp-4);
  padding: var(--sp-3);
  font-size: var(--fs-body);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--danger);
  border-left-width: 3px;
  border-radius: var(--r-control);
}

.error strong { color: var(--danger); }

.sent {
  margin: 0 0 var(--sp-4);
  font-size: var(--fs-body);
  color: var(--ink);
  word-break: break-word;
}
