/* The entry pages (feature 030, slice E; on the brand since feature 038):
   sign in, registration with its invitation and join link modes, and the CLI
   approval, each a console hero beside worksheet paper (auth.css) or one card
   of paper. DESIGN.md's two materials. Colours and faces come from
   /brand/brand.css; the names below are this sheet's own, each an alias of a
   brand token. Signal colours say a state and nothing else; each material has
   one primary (white on console, ink on paper). The signed-in pages draw in
   the app's own sheet since the one host page (feature 057,
   admin-ui/src/shell/shell.css). */

:root {
  /* console */
  --bench: var(--tq-console); --chrome: var(--tq-console-raised); --chrome-chip: var(--tq-console-chip);
  --chrome-line: var(--tq-console-line); --chrome-strong: var(--tq-console-line-strong);
  --chrome-fg: var(--tq-console-text); --chrome-dim: var(--tq-console-text-dim); --chrome-mute: var(--tq-console-text-mute);
  --white: var(--tq-white);
  --signal: var(--tq-signal); --coral: var(--tq-fault);
  /* paper */
  --paper: var(--tq-paper); --foot: var(--tq-paper-foot); --card: var(--tq-paper-card);
  --ink: var(--tq-ink); --ink-hover: var(--tq-ink-hover); --text: var(--tq-ink-text); --mute: var(--tq-ink-mute);
  --rule: var(--tq-rule); --ring: var(--tq-ring);
  --fail: var(--tq-fail); --fail-field: var(--tq-fail-field); --fail-rule: var(--tq-fail-rule);
  --ui: var(--tq-font-ui);
  --mono: var(--tq-font-mono);
}

* { box-sizing: border-box; }
/* the approval's words before the login's id, out of sight; a style
   attribute would be blocked by style-src 'self' */
.offscreen { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
html, body { margin: 0; }
body { font: 400 .875rem/1.65 var(--ui); color: var(--text); background: var(--paper); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { color: var(--ink); margin: 0; }

/* One focus ring, brand.css's: ink on paper, and every console region below
   restates --tq-focus in signal-deep, because ink on the console reads as no
   ring at all. */

/* ---- the centred card (sign in, signup, accept, the CLI approval) ---------- */

.single { max-width: 380px; margin: 0 auto; padding: 56px 16px 80px; }
.single > .tq-mark { margin: 0 0 18px; font-size: 1.125rem; }
.single section {
  background: var(--card); border: 1px solid var(--rule); border-radius: 8px;
  padding: 14px 16px 16px;
}
.single h1 { font: 600 1rem/1.35 var(--ui); margin-bottom: 4px; }
.single .lede { font: 400 .8125rem/1.6 var(--ui); color: var(--mute); margin: 0 0 14px; }
.single .after { font: 400 .8125rem/1.6 var(--ui); color: var(--mute); margin: 14px 0 0; text-align: center; }
.single .after a, .field .note a { color: var(--ink); font-weight: 500; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* the account and the organisation the approval binds to, in the ink the rest
   of the sentence is not: they are what a wrong approval gets wrong */
.single .lede .bind { color: var(--ink); font-weight: 500; }
.match { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: 400 .8125rem/1.6 var(--ui); color: var(--mute); margin: 0 0 14px; }
.idchip {
  font: 500 .75rem/1.5 var(--mono); color: var(--ink); padding: 3px 8px;
  background: var(--foot); border: 1px solid var(--rule); border-radius: 4px;
}
.decide { display: flex; gap: 8px; }
.decide button { flex: 1; }

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

form { margin: 0; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field > span { font: 600 .8125rem/1.5 var(--ui); color: var(--ink); }
.field input {
  font: 400 .875rem var(--ui); color: var(--ink); padding: 8px 10px; width: 100%; min-height: 38px;
  background: var(--card); border: 1px solid var(--ring); border-radius: 6px;
}
.field input::placeholder { color: var(--mute); }
.field .note { font: 400 .75rem/1.5 var(--ui); color: var(--mute); }
/* how to get an access token is the one hint a visitor without one must
   not miss (feature 038) */

/* ---- buttons -------------------------------------------------------------- */

/* the paper's one primary, the action blue; a secondary is the ghost outline */
button, a.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: 500 .875rem/1 var(--ui); padding: 8px 14px; min-height: 36px; cursor: pointer;
  color: var(--tq-action-text); background: var(--tq-action); border: 1px solid var(--tq-action-rule); border-radius: 6px;
  text-decoration: none; transition: background .15s ease-out, border-color .15s ease-out, color .15s ease-out;
}
button:hover, a.button:hover { background: var(--tq-action-hover); border-color: var(--tq-action-hover-rule); }
button[disabled] { opacity: .55; cursor: default; }
button[aria-disabled="true"], a.button[aria-disabled="true"] { opacity: .6; cursor: progress; }
button.ghost, a.button.ghost { color: var(--ink); background: transparent; border-color: var(--ring); }
button.ghost:hover, a.button.ghost:hover { background: var(--foot); }
button.wide { width: 100%; }
a.button.provider { width: 100%; margin: 0 0 14px; } /* Continue with GitHub, above the form (feature 035) */
button svg, a.button svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- notices -------------------------------------------------------------- */

/* The api's own words, never reworded. A callout: 6px, a hairline in the
   kind's rule and its field behind, the kind said by its glyph, never a side
   stripe (feature 038). */
.notice { border-radius: 6px; padding: 10px 12px; margin: 0 0 12px; font-size: .875rem; line-height: 1.6; border: 1px solid; }
.notice.bad { background: var(--fail-field); border-color: var(--fail-rule); color: var(--ink); }
.notice.info { background: var(--foot); border-color: var(--rule); color: var(--ink); }
/* the kind's glyph is Lucide's (circle-alert, info; ISC
   licence, lucide.dev), its file unaltered as the mask of a box painted in
   the kind's colour, so no character stands in for an icon and nothing is
   fetched */
.notice { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; }
.notice::before {
  content: ""; width: 16px; height: 16px; margin-top: 3px; background: currentColor;
  -webkit-mask: var(--glyph) center / 16px no-repeat; mask: var(--glyph) center / 16px no-repeat;
}
.notice.bad::before { color: var(--fail); --glyph: url("/brand/icons/circle-alert.svg"); }
.notice.info::before { color: var(--mute); --glyph: url("/brand/icons/info.svg"); }
.notice > * { grid-column: 2; }
.notice p { margin: 0; }
.notice p + p { margin-top: 6px; }
.notice button { margin-top: 8px; justify-self: start; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* /confirm (feature 068): nearly blank, one state in the middle, the mark
   above it; the state is a ring while the link is spent, then Lucide's
   circle-check in the passed green or circle-alert in the failed red */
.confirm-page { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 24px 16px; text-align: center; }
.confirm-page .tq-mark { font-size: 1.125rem; margin-bottom: 14px; }
.confirm-page h1 { margin: 0; font: 600 1.375rem/1.3 var(--ui); color: var(--ink); }
.confirm-page .lede { margin: 6px 0 0; max-width: 34ch; font: 400 .9375rem/1.55 var(--ui); color: var(--mute); text-wrap: balance; }
.confirm-page .button { margin-top: 6px; }
.confirm-page [data-state="done"] ~ .button { background: transparent; color: var(--ink); border-color: var(--rule); }
.state { width: 44px; height: 44px; }
.state[data-state="working"] { border-radius: 50%; border: 3px solid var(--rule); border-top-color: var(--ink); animation: confirm-spin .8s linear infinite; }
.state[data-state="done"], .state[data-state="dead"] {
  background: currentColor; -webkit-mask: var(--glyph) center / 44px no-repeat; mask: var(--glyph) center / 44px no-repeat;
  animation: confirm-pop .35s cubic-bezier(.2, .9, .3, 1.3);
}
.state[data-state="done"] { color: var(--tq-pass); --glyph: url("/brand/icons/circle-check.svg"); }
.state[data-state="dead"] { color: var(--fail); --glyph: url("/brand/icons/circle-alert.svg"); }
@keyframes confirm-spin { to { transform: rotate(360deg); } }
@keyframes confirm-pop { from { transform: scale(.6); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .state { animation: none !important; }
}
