/* Platform pages (landing, sign-in, invite, reset) in Longwell's design system: paper, midnight, cobalt actions.
   Loads after /static/longwell/{fonts,tokens,components}.css; the Longwell layer at the end sets the shared shapes. */
:root {
  /* Longwell's roles under this file's short names (tokens.css is loaded first). Light only unless data-lw-theme="dark". */
  --paper: var(--lw-canvas); --ink: var(--lw-text); --ink-soft: var(--lw-text-muted); --line: var(--lw-border); --line-soft: var(--lw-border-subtle);
  --moss: var(--lw-primary); --moss-ink: var(--lw-on-primary); --panel: var(--lw-surface); --error: var(--lw-state-error-text);
  --error-soft: var(--lw-state-error-surface);
  --sans: var(--lw-font-ui);
  --serif: var(--sans);
}
* { box-sizing: border-box }
html, body { margin: 0 }
body { background: var(--paper); color: var(--ink); font: var(--lw-text-lg)/1.55 var(--sans); min-height: 100vh;
  padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)) }
a { color: inherit }
.bar { max-width: 1120px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding-block: 22px }
.wordmark { font: 600 var(--lw-text-xl)/1.2 var(--sans); text-decoration: none }
.bar nav { display: flex; gap: 20px; align-items: center; font-size: var(--lw-text-sm) }
.bar nav a { text-decoration: none; border-bottom: 1px solid var(--line) }
.bar nav a:hover { border-color: var(--ink) }
main { max-width: 1120px; margin: 0 auto }

/* landing */
.hero { padding-block: 48px 72px }
.thesis { font-family: var(--sans); font-weight: 600; font-size: clamp(2.75rem, 5.6vw, 5rem); line-height: 1.02;
  letter-spacing: -.025em; margin: 0; max-width: 14ch; text-wrap: balance }
.reciprocal { display: grid; grid-template-columns: 1fr minmax(180px, 340px) 1fr; align-items: center; gap: 12px; margin-block: 56px 40px }
.half { font-family: var(--sans); font-weight: 500; font-size: clamp(var(--lw-text-2xl), 3.1vw, var(--lw-text-4xl)); line-height: 1.15;
  letter-spacing: -.01em; margin: 0 }
.half.left { text-align: right }
.half.right { text-align: left }
.rings { width: 100%; height: auto; display: block }
.ring { stroke: var(--line); stroke-width: 1.4 }
.ring.faint { stroke: var(--line-soft) }
.ring.accent { stroke: var(--moss); stroke-width: 3 }
@media (prefers-reduced-motion: no-preference) {
  .ring { stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: draw 1.6s cubic-bezier(.3,.6,.2,1) forwards }
  .ring:nth-child(2) { animation-delay: .12s } .ring:nth-child(3) { animation-delay: .24s }
  .ring:nth-child(4) { animation-delay: .36s } .ring:nth-child(5) { animation-delay: .48s } .ring:nth-child(6) { animation-delay: .6s }
}
@keyframes draw { to { stroke-dashoffset: 0 } }
.lede { font-size: var(--lw-text-lg); color: var(--ink-soft); max-width: 56ch; margin: 0 0 28px }
.actions { margin: 0 }

/* controls */
.btn { display: inline-block; background: var(--ink); color: var(--paper); border: 0; border-radius: var(--lw-radius-pill);
  padding: 13px 26px; font: 600 var(--lw-text-base)/1 var(--sans); text-decoration: none; cursor: pointer }
.btn:hover { background: var(--moss); color: var(--moss-ink) }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--moss); outline-offset: 3px }
button.link { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; border-bottom: 1px solid var(--line) }
form.inline { display: inline }

/* auth panels */
body.auth main, body.app main { display: grid; place-items: start center; padding-block: 40px 80px }
.panel { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--lw-radius-card); padding: 32px }
.panel.wide { max-width: 620px }
.panel h1 { font: 600 var(--lw-text-3xl)/1.2 var(--sans); margin: 0 0 8px }
.sub { color: var(--ink-soft); margin: 0 0 22px }
form { display: grid; gap: 8px }
label { font-size: var(--lw-text-sm); font-weight: 600 }
input[type=email], input[type=password], input.code, input[name=code] { font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--lw-radius-control); padding: 12px 14px; margin-bottom: 10px; width: 100% }
input.code { font-size: var(--lw-text-2xl); letter-spacing: .3em; font-variant-numeric: tabular-nums }
form .btn { justify-self: start; margin-top: 6px }
.error { background: var(--error-soft); color: var(--error); border-radius: var(--lw-radius-control); padding: 10px 14px; margin: 0 0 16px; font-size: var(--lw-text-sm) }
.aside { font-size: var(--lw-text-sm); color: var(--ink-soft); margin: 14px 0 0 }
.steps { padding-left: 22px; display: grid; gap: 18px; margin: 0 }
/* The SVG carries its own 4-module white quiet zone; the box only centers it and keeps it white in any theme. */
.qr { margin: 12px auto; background: var(--lw-palette-white); display: block; width: fit-content; max-width: 100%; padding: 8px; border-radius: var(--lw-radius-control) }
.qr svg { display: block; width: min(240px, 60vw); height: auto; aspect-ratio: 1; shape-rendering: crispEdges }
.secret code { font: var(--lw-text-sm)/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all }

@media (max-width: 720px) {
  .reciprocal { grid-template-columns: 1fr; text-align: left; margin-block: 36px 28px }
  .half.left, .half.right { text-align: left }
  .rings { max-width: 240px }
  .panel { padding: 24px }
}
.notice { background: color-mix(in srgb, var(--moss) 14%, transparent); border-radius: var(--lw-radius-control); padding: 10px 14px; margin: 0 0 16px; font-size: var(--lw-text-sm) }
/* admin pages carry a visible band so nobody mistakes them for a practice account */
body.admin { border-top: 6px solid var(--moss) }
body.admin .panel { border-color: var(--ink) }

/* r17: "Remember this computer" checkbox */
label.check { display: flex; gap: 10px; align-items: center; font-weight: 400; margin: 6px 0 2px; cursor: pointer }
label.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink) }
.aside.small { font-size: var(--lw-text-sm); margin: 0 0 8px }

/* r18: sign-in pages (staff, BI, admin, invite, password reset) in the BI look: warm canvas, white rounded card,
   one sans (Manrope, Longwell, since 2026-10-27) for every word, midnight ink, cobalt buttons, the same input style. */
body.auth { --paper: var(--lw-canvas); --panel: var(--lw-surface); --ink: var(--lw-text); --ink-soft: var(--lw-text-muted); --line: var(--lw-border);
  --line-soft: var(--lw-border-subtle); color-scheme: light; background: var(--lw-canvas); color: var(--ink); font: var(--lw-text-sm)/1.55 var(--sans) }
body.auth .bar { padding-block: 16px }
body.auth .wordmark { font: 600 var(--lw-text-xl)/1.2 var(--sans); letter-spacing: 0 }
body.auth main { padding-block: 32px 80px }
body.auth .panel { background: var(--lw-surface); border: 1px solid var(--lw-border-subtle); border-radius: var(--lw-radius-card); padding: 32px;
  box-shadow: var(--lw-shadow-card) }
body.auth .panel h1 { font: 600 var(--lw-text-3xl)/1.2 var(--sans); margin: 0 0 6px }
body.auth .sub { font-size: var(--lw-text-sm); color: var(--ink-soft); margin: 0 0 22px }
body.auth label { font: 600 var(--lw-text-sm) var(--sans); color: var(--ink-soft) }
body.auth label.check { font: 400 var(--lw-text-sm) var(--sans); color: var(--ink) }
body.auth input[type=email], body.auth input[type=password], body.auth input[type=text], body.auth input.code,
body.auth input[name=code] { font: var(--lw-text-sm) var(--sans); color: var(--ink); background: var(--lw-surface); border: 1px solid var(--lw-border);
  border-radius: var(--lw-radius-control); padding: 11px 14px; margin-bottom: 10px; width: 100% }
body.auth input.code, body.auth input[name=code] { font: 600 var(--lw-text-xl) var(--mono, ui-monospace, Menlo, monospace);
  letter-spacing: .3em }
body.auth input:focus { border-color: var(--lw-border); outline: none; box-shadow: 0 0 0 3px var(--lw-border-subtle) }
body.auth a:focus-visible, body.auth button:focus-visible { outline: 3px solid var(--lw-primary); outline-offset: 2px }
body.auth .btn { background: var(--lw-primary); color: var(--lw-on-primary); border-radius: var(--lw-radius-control); padding: 11px 22px; font: 600 var(--lw-text-sm) var(--sans) }
body.auth .btn:hover { background: var(--lw-primary-hover); color: var(--lw-surface) }
body.auth .error { background: var(--lw-state-error-surface); color: var(--lw-state-error-text); border: 1px solid var(--lw-state-error-text); border-radius: var(--lw-radius-control) }
body.auth .notice { background: var(--lw-state-progress-surface); color: var(--lw-state-progress-text); border: 1px solid var(--lw-border-subtle); border-radius: var(--lw-radius-control) }
body.auth .aside { font-size: var(--lw-text-sm); color: var(--ink-soft) }
body.auth .aside.small { font-size: var(--lw-text-sm) }
body.auth .secret code { font: var(--lw-text-sm)/1.4 ui-monospace, SFMono-Regular, Menlo, monospace }
body.auth .qr { border: 1px solid var(--lw-border-subtle); border-radius: var(--lw-radius-card) }
body.auth.admin { border-top: 6px solid var(--lw-primary) }
body.auth.admin .panel { border-color: var(--lw-border-subtle) }

/* ---------- Longwell layer (2026-10-27): one button, field, focus and heading grammar for every platform page ---------- */
body { font-size: var(--lw-text-base); line-height: var(--lw-leading-body); -webkit-font-smoothing: antialiased }
.wordmark { display: inline-flex; align-items: center; gap: 10px; min-height: var(--lw-target); color: var(--lw-text); text-decoration: none;
  font: var(--lw-weight-semibold) var(--lw-text-base)/1.2 var(--sans) }
.wordmark img { display: block; height: 24px; width: auto }
.wordmark .area-name { padding-left: 10px; border-left: 1px solid var(--lw-border-subtle); font-weight: var(--lw-weight-semibold) }
body.auth .wordmark, body.pic .wordmark, body.console .wordmark { font: var(--lw-weight-semibold) var(--lw-text-base)/1.2 var(--sans) }
.bar nav a, button.link { display: inline-flex; align-items: center; min-height: var(--lw-target); color: var(--lw-link); font-weight: var(--lw-weight-semibold);
  text-decoration: underline; text-underline-offset: .2em; text-decoration-thickness: 1px; border: 0 }
.bar nav a:hover, button.link:hover { color: var(--lw-link-hover) }
:is(a, button, input, select, textarea, summary):focus-visible, body.auth :is(a, button):focus-visible { outline: 3px solid var(--lw-focus); outline-offset: 3px }
a.btn, .btn, body.auth .btn, body.pic .btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--lw-space-2);
  min-height: var(--lw-target); padding: .6875rem 1rem; border: 1px solid transparent; border-radius: var(--lw-radius-control);
  background: var(--lw-primary); color: var(--lw-on-primary); font: var(--lw-weight-semibold) var(--lw-text-sm)/1.35 var(--sans);
  text-decoration: none; cursor: pointer; transition: background var(--lw-duration-fast) var(--lw-ease-standard) }
a.btn:hover, .btn:hover, body.auth .btn:hover, body.pic .btn:hover { background: var(--lw-primary-hover); color: var(--lw-on-primary) }
.btn:disabled, .btn[aria-disabled="true"] { color: var(--lw-text-muted); background: var(--lw-surface-subtle); border-color: var(--lw-border-subtle); cursor: not-allowed }
.hero .btn { min-height: 3rem; padding-inline: var(--lw-space-6); font-size: var(--lw-text-base) }
body.auth .panel, .panel { background: var(--lw-surface); border: 1px solid var(--lw-border-subtle); border-radius: var(--lw-radius-card); padding: var(--lw-space-8);
  box-shadow: none }
body.auth .panel h1, .panel h1 { font: var(--lw-weight-semibold) var(--lw-text-3xl)/1.2 var(--sans); letter-spacing: var(--lw-tracking-heading); margin: 0 0 var(--lw-space-2) }
body.auth .sub, .sub { font-size: var(--lw-text-base); color: var(--lw-text-muted); margin: 0 0 var(--lw-space-6) }
form { gap: var(--lw-space-1-5) }
body.auth label, label { font: var(--lw-weight-semibold) var(--lw-text-sm)/1.35 var(--sans); color: var(--lw-text) }
body.auth label.check, label.check { font: var(--lw-weight-regular) var(--lw-text-sm) var(--sans); color: var(--lw-text); min-height: var(--lw-target); margin: 0 }
label.check input { width: 1.25rem; height: 1.25rem; accent-color: var(--lw-primary) }
body.auth input:is([type=email], [type=password], [type=text]), body.auth input.code, body.auth input[name=code],
input:is([type=email], [type=password]), input.code, input[name=code] {
  min-height: var(--lw-target); padding: .6875rem .875rem; margin-bottom: var(--lw-space-4); width: 100%; border: 1px solid var(--lw-border);
  border-radius: var(--lw-radius-control); background: var(--lw-surface); color: var(--lw-text); font: var(--lw-text-base)/1.4 var(--sans) }
body.auth input.code, body.auth input[name=code], input.code { font: var(--lw-weight-semibold) var(--lw-text-2xl)/1.2 ui-monospace, Menlo, monospace; letter-spacing: .3em }
body.auth input:focus { border-color: var(--lw-border); box-shadow: none }
body.auth input:focus-visible { outline: 3px solid var(--lw-focus); outline-offset: 3px }
body.auth .error, .error { background: var(--lw-state-error-surface); color: var(--lw-state-error-text); border: 1px solid currentColor;
  border-radius: var(--lw-radius-control); padding: var(--lw-space-3) var(--lw-space-4); font-size: var(--lw-text-sm) }
body.auth .notice, .notice { background: var(--lw-state-done-surface); color: var(--lw-state-done-text); border: 1px solid currentColor;
  border-radius: var(--lw-radius-control); padding: var(--lw-space-3) var(--lw-space-4); font-size: var(--lw-text-sm) }
body.auth .aside, .aside { font-size: var(--lw-text-sm); color: var(--lw-text-muted) }
body.auth .qr, .qr { border: 1px solid var(--lw-border-subtle); border-radius: var(--lw-radius-control); background: var(--lw-palette-white) }
/* Admin pages keep a visible band so nobody mistakes them for a practice account: midnight, the brand's own field. */
body.admin, body.auth.admin { border-top: 6px solid var(--lw-palette-midnight) }
body.admin .panel, body.auth.admin .panel { border-color: var(--lw-border-subtle) }
/* The landing page is the one marketing moment: Fraunces for the statement, still drawings. */
.thesis { font-family: var(--lw-font-editorial); font-variation-settings: "SOFT" 0, "WONK" 0; font-optical-sizing: auto; font-weight: var(--lw-weight-regular);
  font-size: clamp(2.75rem, 5.6vw, 5rem); line-height: 1.05; letter-spacing: var(--lw-tracking-display); max-width: 16ch }
.half { font-family: var(--lw-font-editorial); font-variation-settings: "SOFT" 0, "WONK" 0; font-weight: var(--lw-weight-regular); letter-spacing: -.005em }
.lede { font-size: clamp(1.125rem, 1.5vw, 1.25rem); line-height: 1.55; color: var(--lw-text-muted) }
.ring { animation: none !important; stroke-dasharray: none !important; stroke-dashoffset: 0 !important }
.ring.accent { stroke: var(--lw-palette-jade) }

/* r23: self-serve sign-up by invitation (/start/<token>): the admin form fields (admin/_field.html), stacked */
body.start .cform { display: grid; gap: 18px; margin-top: 20px }
body.start .cf-field { display: grid; gap: 6px }
body.start .cf-field > :is(p, input, select) { margin: 0 }
body.start select, body.start input[type=tel] { font: var(--lw-text-base)/1.4 var(--sans); color: var(--ink); background: var(--lw-surface);
  border: 1px solid var(--lw-border); border-radius: var(--lw-radius-control); padding: 11px 12px; width: 100%; box-sizing: border-box }
body.start .cf-field.bad :is(input, select) { border: 2px solid var(--lw-state-error-text) }
body.start .cf-hint { font-size: var(--lw-text-xs); color: var(--ink-soft) }
body.start .cf-err { font: 600 var(--lw-text-sm) var(--sans); color: var(--lw-state-error-text) }
body.start .cf-summary { border: 2px solid var(--lw-state-error-text); background: var(--lw-state-error-surface); border-radius: var(--lw-radius-card); padding: 14px 18px; margin-top: 16px }
body.start .cf-summary h2 { margin: 0 0 6px; font-size: var(--lw-text-base); color: var(--lw-state-error-text) }
body.start .cf-summary ul { margin: 0; padding-left: 20px }
body.start .cf-summary a { color: var(--lw-state-error-text); font-weight: 600 }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
