/* =============================================================================
 * kc-door.css — /account, on the token layer
 * =============================================================================
 *
 * WHAT THIS FILE IS
 *
 * The only stylesheet /account loads on top of the token layer. It used to
 * serve /signin too; that door now wears the shared landing skin
 * (kc-landing-skin.css + kc-signin.css, 2026-09-13, "make the rest of the
 * entire platform look the same"), so the sign-in-only rules — the two-column
 * shell, the invitation, the tab strip, the providers, the truth panel — left
 * this file rather than being overridden there. What remains is what
 * account.html's markup wears.
 *
 * LOAD ORDER, and it matters
 *
 *   kc-theme.css   the register system: --fs-*, --r-*, --bw-*, the font slots
 *   kc-uplift.css  data-theme x data-surface, and LAYER 6 which paints the page
 *   kc-door.css    this file — components only, values only from the two above
 *
 * Tokens for every colour, radius, weight and size; layout numbers (max-widths,
 * gaps, one-off measures) are the only literals. There is not a single hex
 * value below, and no font name: the faces come from kc-theme.css, which now
 * names Comfortaa (display) and Nunito (everything else).
 *
 * THE FOUR MODES AND THE THREE REGISTERS
 *
 * Nothing here selects on data-theme or data-surface. It cannot need to: the
 * token layer resolves --plate, --inset, --ink1..3, --blur and --shadow per
 * mode, so a component written once holds in all four. `clear` is selected on
 * only for motion: --door-ease below is the single switch, and it is also 0s
 * under prefers-reduced-motion.
 *
 * EVERY INK/GROUND PAIRING BELOW IS ONE tools/contrast_audit.mjs MEASURES
 *
 *   --ink1/--ink2/--ink3  on --plate, --inset, --recess, --quiet, --acc-quiet,
 *                            --green-tint, --amber-wash, --crit-tint,
 *                            --page, --chrome
 *   --acc                 on --plate, --inset, --tint-acc, --acc-quiet, --quiet
 *   --green               on --plate, --green-tint
 *   --amber               on --plate, --amber-tint, --amber-wash
 *   --crit                on --plate, --crit-tint
 *   --on-grad             on --grad
 *   --on-acc              on --acc-deep
 *   --check-ink           on --check-bg
 *
 * Where a component would have put a semantic ink on an UNMEASURED ground the
 * ground was removed rather than the ink: `.rules` and `.methods li` carry a
 * rule and no fill precisely so that --crit and --green land on --plate.
 * ========================================================================== */


/* -----------------------------------------------------------------------------
 * The one authored motion value, and its two off switches.
 * -------------------------------------------------------------------------- */
:root {
  --door-ease: 140ms ease;
}
:root[data-presentation="clear"],
[data-presentation="clear"] {
  --door-ease: 0s;
}
@media (prefers-reduced-motion: reduce) {
  :root { --door-ease: 0s; }
}


/* -----------------------------------------------------------------------------
 * Ground rules. html/body background and colour are painted by kc-uplift
 * LAYER 6 with !important, so this sets only what that block does not.
 * -------------------------------------------------------------------------- */
* { box-sizing: border-box; }

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

/* A flex column so the footer sits ON the bottom of a tall viewport instead of
   floating in the middle of it. The old sheet did this with a min-height
   calculated from two hard-coded chrome heights; a column cannot go stale when
   `clear` makes the app bar taller. */
body {
  margin: 0;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  font-family: var(--font-sans);
  font-size: var(--fs-17);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2 { margin: 0; text-wrap: balance; }
p { text-wrap: pretty; }
button, input { font-family: inherit; }
a { color: var(--acc); }
a:hover { color: var(--acc-deep); }

[hidden] { display: none !important; }

/* One focus treatment for every focusable thing on both pages. An outline
   rather than a box-shadow: it is never clipped by an ancestor's overflow and
   it survives forced-colors, which a shadow does not. --bw-2 is 2px in vivid
   and focused and 3px in `clear`, which is the register asking. */
:focus-visible {
  outline: var(--bw-2) solid var(--acc);
  outline-offset: 3px;
}

/* The skip link is the first focusable element on both pages. */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 60;
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 18px;
  background: var(--plate);
  color: var(--ink1);
  border: var(--bw-1) solid var(--rule-firm);
  border-radius: 0 0 var(--r-12) 0;
  font: 600 var(--fs-13-5)/1 var(--font-sans);
  text-decoration: none;
}
.skip:focus { left: 0; }


/* =============================================================================
 * THE APP BAR
 * -----------------------------------------------------------------------------
 * kc-theme.css sets `header { background: var(--chrome-bg) !important }` and
 * LAYER 4 maps --chrome-bg onto --chrome, so the bar already resolves to the
 * uplift's chrome ramp without this file asking. What it does NOT do is match
 * the blur to the register: kc-theme.css hard-codes blur(18px) on every header
 * in the product, which `clear` may not have. --blur-chrome is `none` there and
 * a real blur in glass, so it is restated here — same specificity, later file,
 * no !important needed.
 * ========================================================================== */
header.top {
  position: sticky; top: 0; z-index: 30;
  -webkit-backdrop-filter: var(--blur-chrome, none);
  backdrop-filter: var(--blur-chrome, none);
}
header.top .in {
  max-width: 1080px; margin: 0 auto; padding: 0 24px;
  min-height: 68px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.mark {
  display: inline-flex; align-items: center; min-height: 44px;
  color: var(--ink1); text-decoration: none;
  font: 700 var(--fs-13)/1 var(--font-sans);
  letter-spacing: .22em;
}
.mark span { color: var(--ink3); font-weight: 500; letter-spacing: .22em; }
.top .back {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px;
  color: var(--ink2); text-decoration: none;
  font: 500 var(--fs-14)/1.2 var(--font-sans);
  transition: color var(--door-ease);
}
.top .back:hover { color: var(--ink1); }


/* =============================================================================
 * THE SHELL — /account is a single measured column (main.shell.one, below)
 * ========================================================================== */
main.shell {
  position: relative; z-index: 1;
  flex: 1 0 auto;
  max-width: 1080px; width: 100%; margin: 0 auto;
  padding: 44px 24px 76px;
  display: grid; gap: 40px; align-content: start;
}


/* =============================================================================
 * THE EDITORIAL COLUMN
 * ========================================================================== */
.eyebrow {
  margin: 0 0 20px;
  font: 500 var(--fs-11)/1.2 var(--font-sans);
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--acc);
}

h1 {
  font: 700 var(--fs-54)/1.06 var(--font-display);
  letter-spacing: -.02em;
  color: var(--ink1);
  max-width: 15ch;
}
.lede {
  margin: 22px 0 0;
  font-size: var(--fs-20);
  line-height: 1.55;
  color: var(--ink2);
  max-width: 46ch;
}


/* =============================================================================
 * THE PLATE
 * -----------------------------------------------------------------------------
 * One recipe, used by every section on /account. In
 * glass it is translucent over the page wash with --blur behind it and --shadow
 * as the luminous edge; in solid it is opaque with a cast shadow; in `clear`
 * LAYER 2 has already made --plate opaque, --blur none and --shadow none, and
 * the hairline is what is left, which is exactly what that register wants.
 * ========================================================================== */
.card {
  position: relative;
  width: 100%;
  background: var(--plate);
  -webkit-backdrop-filter: var(--blur, none);
  backdrop-filter: var(--blur, none);
  border: var(--bw-1) solid var(--rule-soft);
  border-radius: var(--r-22);
  box-shadow: var(--shadow, none);
  padding: 28px 26px;
}

/* =============================================================================
 * FIELDS
 * -----------------------------------------------------------------------------
 * min-height, never height: `clear` sets --fs-16 to 20.2px and a fixed 52px box
 * would clip it. 16px is the floor in every register, which is what stops iOS
 * zooming the page on focus.
 * ========================================================================== */
.field { margin: 0 0 20px; }
.lrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

label {
  display: block; margin: 0 0 8px;
  font: 600 var(--fs-13)/1.4 var(--font-sans);
  color: var(--ink2);
}

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  min-height: 52px;
  padding: 13px 15px;
  background: var(--inset);
  color: var(--ink1);
  border: var(--bw-1) solid var(--rule-firm);
  border-radius: var(--r-13);
  font: 400 var(--fs-16)/1.35 var(--font-sans);
  transition: border-color var(--door-ease);
}
input::placeholder { color: var(--ink3); opacity: 1; }
input:focus { border-color: var(--acc); }
input[aria-invalid="true"] { border-color: var(--crit); }
input[disabled] { opacity: .6; }

.hint { margin: 9px 0 0; font-size: var(--fs-12-5); line-height: 1.5; color: var(--ink3); }

/* Show / hide. Pulled out to a 44px target without pushing the label row apart:
   the negative margin is exactly the padding that makes the target. */
.reveal {
  display: inline-flex; align-items: center;
  min-height: 44px; margin: -14px -6px; padding: 0 6px;
  background: none; border: 0; cursor: pointer;
  font: 600 var(--fs-12-5)/1 var(--font-sans);
  color: var(--acc);
  text-decoration: underline; text-underline-offset: 3px;
  transition: color var(--door-ease);
}
.reveal:hover { color: var(--acc-deep); }


/* =============================================================================
 * BUTTONS
 * -----------------------------------------------------------------------------
 * The gradient appears once per screen, on the primary action, which is the
 * one-hero rule about.html states. --on-grad is pinned by kc-uplift precisely
 * so that the ink on it is the same in every mode.
 * ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 52px; padding: 12px 24px;
  border: var(--bw-1) solid transparent; border-radius: var(--r-999);
  cursor: pointer; text-decoration: none;
  font: 600 var(--fs-15)/1.2 var(--font-sans);
  transition: filter var(--door-ease), border-color var(--door-ease),
              background var(--door-ease), color var(--door-ease);
}
.btn + .btn { margin-top: 10px; }
.btn.primary { background: var(--grad); color: var(--on-grad); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost {
  background: none; color: var(--ink1);
  border-color: var(--rule-firm);
}
.btn.ghost:hover { border-color: var(--acc); color: var(--acc); }
.btn[disabled],
.btn[aria-disabled="true"] { opacity: .6; cursor: default; filter: none; }

/* Sign out everywhere. Outlined rather than filled: a destructive action should
   read as destructive without being the loudest thing on the page. --crit on
   --plate and --crit on --crit-tint are both measured pairings. */
.btn.danger { background: none; color: var(--crit); border-color: var(--crit); }
.btn.danger:hover { background: var(--crit-tint); }

/* The in-button spinner. Under prefers-reduced-motion kc-theme.css freezes the
   animation, which leaves a static three-quarter ring — a legible state, not a
   half-drawn one. */
.spin {
  flex: 0 0 auto; width: 16px; height: 16px;
  border: var(--bw-2) solid currentColor;
  border-top-color: transparent;
  border-radius: var(--r-999);
}
@media (prefers-reduced-motion: no-preference) {
  @keyframes kcDoorSpin { to { transform: rotate(360deg); } }
  .spin { animation: kcDoorSpin .7s linear infinite; }
}


/* =============================================================================
 * MESSAGES
 * -----------------------------------------------------------------------------
 * In the DOM from first paint and aria-live, so it is announced when it fills.
 * Three kinds, three measured tint/ink pairs.
 * ========================================================================== */
.msg {
  display: none; margin: 18px 0 0; padding: 12px 14px;
  border: var(--bw-1) solid transparent; border-radius: var(--r-12);
  font-size: var(--fs-14); line-height: 1.55;
}
.msg.on { display: block; }
.msg.err  { color: var(--crit);  background: var(--crit-tint);  border-color: var(--crit); }
.msg.ok   { color: var(--green); background: var(--green-tint); border-color: var(--green); }
.msg.info { color: var(--ink2);  background: var(--quiet);      border-color: var(--rule-soft); }


/* =============================================================================
 * SECONDARY ROUTES
 * ========================================================================== */
.alt {
  margin: 20px 0 0; padding-top: 16px;
  border-top: var(--bw-1) solid var(--rule-soft);
  font-size: var(--fs-14); color: var(--ink3);
}
.alt + .alt { margin-top: 10px; padding-top: 0; border-top: 0; }
.link {
  display: inline-flex; align-items: center; text-align: left;
  min-height: 44px; margin: -12px -4px; padding: 0 4px;
  background: none; border: 0; cursor: pointer;
  font: 600 var(--fs-14)/1.4 var(--font-sans);
  color: var(--acc);
  text-decoration: underline; text-underline-offset: 3px;
  transition: color var(--door-ease);
}
.link:hover { color: var(--acc-deep); }


/* =============================================================================
 * TERMINAL STATES — link sent, password saved, already signed in, dead link
 * ========================================================================== */
.done { text-align: left; }
.done .glyph {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; margin: 0 0 20px;
  border-radius: var(--r-999);
  background: var(--green-tint); color: var(--green);
  border: var(--bw-1) solid var(--green);
}
.done .glyph.wait {
  background: var(--tint-acc); color: var(--acc); border-color: var(--acc);
}
.done h2 {
  font: 600 var(--fs-24)/1.25 var(--font-display);
  letter-spacing: -.01em; color: var(--ink1); margin: 0 0 10px;
}
.done p { margin: 0 0 20px; font-size: var(--fs-15); line-height: 1.6; color: var(--ink2); }
.done .addr { color: var(--ink1); font-weight: 600; word-break: break-word; }

.who {
  display: flex; align-items: center; gap: 13px; margin: 0 0 22px; padding: 14px;
  background: var(--quiet);
  border: var(--bw-1) solid var(--rule-soft);
  border-radius: var(--r-14);
}
.who .av {
  flex: 0 0 auto; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-999);
  background: var(--tint-acc); color: var(--acc);
  border: var(--bw-1) solid var(--acc);
  font: 600 var(--fs-15)/1 var(--font-sans); text-transform: uppercase;
}
.who .txt { min-width: 0; }
.who .txt b { display: block; font: 600 var(--fs-14)/1.3 var(--font-sans); color: var(--ink1); word-break: break-word; }
.who .txt span { display: block; margin-top: 3px; font-size: var(--fs-12-5); color: var(--ink3); }


/* A link inside a sentence is the one target WCAG 2.5.8 exempts, and stretching
   this one to a 44px BOX would tear the paragraph apart. Vertical padding on an
   inline box grows the hit area without moving a single line of type, so the
   target is 44px+ tall and the sentence is unchanged. */
.card .note a,
.card .sub a { color: var(--acc); padding-block: 15px; }


/* =============================================================================
 * FOOTER
 * ========================================================================== */
footer {
  position: relative; z-index: 1;
  flex: 0 0 auto;
  border-top: var(--bw-1) solid var(--rule-soft);
}
footer .in {
  max-width: 1080px; margin: 0 auto; padding: 14px 24px 24px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 24px;
  font-size: var(--fs-12-5); color: var(--ink3);
}
footer .in > span { display: inline-flex; align-items: center; min-height: 44px; }
footer a {
  display: inline-flex; align-items: center; justify-content: center;
  /* min-width as well as min-height: "Privacy" and "Sign in" are 40-44px wide
     in `focused`, which is a target that fails on one axis only and is the kind
     that is never noticed until someone tries to hit it on a phone. */
  min-height: 44px; min-width: 44px; padding-inline: 4px;
  color: var(--ink3); text-decoration: underline; text-underline-offset: 3px;
  transition: color var(--door-ease);
}
footer a:hover { color: var(--ink1); }


/* =============================================================================
 * =============================================================================
 * /account ONLY — one measured column, six plates
 * =============================================================================
 * ========================================================================== */

main.shell.one {
  display: block;
  max-width: 680px;
  padding: 40px 24px 84px;
}
@media (min-width: 940px) {
  main.shell.one { padding: 60px 24px 96px; }
}

.head { margin: 0 0 28px; max-width: 34rem; }
.head h1 { font-size: var(--fs-40); max-width: 18ch; }
.head .lede { margin: 18px 0 0; font-size: var(--fs-18); max-width: 48ch; }

main.shell.one .card { margin: 0 0 18px; }
main.shell.one .card:last-of-type { margin-bottom: 0; }

.card h2 {
  font: 600 var(--fs-21)/1.25 var(--font-display);
  letter-spacing: -.01em; color: var(--ink1); margin: 0 0 7px;
}
.card .sub { margin: 0 0 20px; font-size: var(--fs-14); line-height: 1.6; color: var(--ink2); }
.card .note { margin: 15px 0 0; font-size: var(--fs-12-5); line-height: 1.6; color: var(--ink3); }
.card .note + .note { margin-top: 10px; }

/* Up before anything else can paint, and down the moment we know. */
.card.wait { display: flex; flex-direction: column; gap: 16px; }
.card.wait p { margin: 0; font-size: var(--fs-14); color: var(--ink2); }
.card.wait .bar {
  height: 4px; border-radius: var(--r-999);
  background: var(--track); overflow: hidden;
}
.card.wait .bar i {
  display: block; height: 100%; width: 35%;
  border-radius: var(--r-999); background: var(--acc-deep);
}
/* Motion only where motion is welcome. Under `reduce` the bar stays a static
   35% stub in the track rather than sliding, and the sentence beside it is what
   actually reports the state. */
@media (prefers-reduced-motion: no-preference) {
  @keyframes kcDoorWait { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }
  .card.wait .bar i { animation: kcDoorWait 1.15s ease-in-out infinite; }
}
[data-presentation="clear"] .card.wait .bar i { animation: none; width: 100%; }

/* Readonly, and it has to LOOK readonly without looking disabled: a password
   manager needs the username to file the credential under, and the member needs
   to see which account they are about to change. */
#username {
  background: var(--recess);
  color: var(--ink2);
  cursor: default;
}
#username:focus { border-color: var(--rule-firm); }

/* The requirements, before anybody types. No fill: --crit and --check-bg both
   land on --plate here, which is a measured ground. */
.rules {
  margin: 0 0 22px; padding: 16px 18px;
  border: var(--bw-1) solid var(--rule-soft);
  border-radius: var(--r-14);
}
.rulesH {
  margin: 0 0 12px;
  font: 500 var(--fs-10-5)/1.2 var(--font-sans);
  letter-spacing: .15em; text-transform: uppercase; color: var(--ink3);
}
.rules ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.rules li {
  display: flex; gap: 11px; align-items: flex-start;
  font-size: var(--fs-13-5); line-height: 1.5; color: var(--ink2); text-wrap: pretty;
}
.rules .tick {
  position: relative; flex: 0 0 auto;
  width: 18px; height: 18px; margin-top: 2px;
  border: var(--bw-1-5) solid var(--ink3); border-radius: var(--r-999);
  transition: border-color var(--door-ease), background var(--door-ease);
}
.rules li[data-state="ok"] { color: var(--ink1); }
.rules li[data-state="ok"] .tick { border-color: var(--check-bg); background: var(--check-bg); }
.rules li[data-state="ok"] .tick::after {
  content: ""; position: absolute; left: 5.2px; top: 2.2px;
  width: 4px; height: 8px;
  border: solid var(--check-ink); border-width: 0 var(--bw-2) var(--bw-2) 0;
  transform: rotate(42deg);
}
.rules li[data-state="bad"] { color: var(--crit); }
.rules li[data-state="bad"] .tick { border-color: var(--crit); }
.rules li[data-state="bad"] .tick::before,
.rules li[data-state="bad"] .tick::after {
  content: ""; position: absolute; left: 7.2px; top: 3.4px;
  width: 1.8px; height: 8.4px; border-radius: 2px; background: var(--crit);
}
.rules li[data-state="bad"] .tick::before { transform: rotate(-45deg); }
.rules li[data-state="bad"] .tick::after  { transform: rotate(45deg); }

/* Length, and only length. The bar says nothing it cannot measure honestly. */
.meter { margin: 12px 0 0; }
.meter .track { height: 6px; border-radius: var(--r-999); background: var(--track); overflow: hidden; }
.meter .track i {
  display: block; height: 100%; width: 0;
  border-radius: var(--r-999); background: var(--acc-deep);
  transition: width var(--door-ease), background var(--door-ease);
}
.meter .track i[data-short="1"] { background: var(--crit-fill); }
.meter .track i[data-full="1"] { background: var(--green-fill); }
.meterNote { margin: 10px 0 0; font-size: var(--fs-12); line-height: 1.55; color: var(--ink3); }

/* How you sign in. Filled with --quiet, which carries all three inks measured;
   the icon disc is the only accent and it is a measured fill pair. */
.methods { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.methods li {
  display: flex; align-items: center; gap: 13px; padding: 13px 15px;
  background: var(--quiet);
  border: var(--bw-1) solid var(--rule-soft);
  border-radius: var(--r-14);
}
.methods .ic {
  flex: 0 0 auto; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-11);
  background: var(--recess); color: var(--ink2);
  border: var(--bw-1) solid var(--rule-soft);
}
.methods .ic.on { background: var(--acc-deep); color: var(--on-acc); border-color: var(--acc-deep); }
.methods .tx { min-width: 0; }
.methods .tx b { display: block; font: 600 var(--fs-14)/1.3 var(--font-sans); color: var(--ink1); }
.methods .tx span { display: block; margin-top: 3px; font-size: var(--fs-12-5); line-height: 1.5; color: var(--ink3); text-wrap: pretty; }

/* Five statements, each checked against this product. */
.facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.facts li {
  position: relative; padding-left: 18px;
  font-size: var(--fs-13-5); line-height: 1.6; color: var(--ink3); text-wrap: pretty;
}
.facts li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 7px; height: 7px; border-radius: var(--r-999); background: var(--acc-deep);
}
.facts b { display: block; margin-bottom: 4px; color: var(--ink2); font-weight: 600; }

main.shell.one .card.done { text-align: left; }
main.shell.one .card.done .btn { width: auto; }


/* =============================================================================
 * NARROW
 * -----------------------------------------------------------------------------
 * One breakpoint for type and one for padding. Everything else is already
 * fluid, and every touch target is a min-height rather than a height so that
 * `clear`'s larger scale grows the control instead of overflowing it.
 * ========================================================================== */
@media (max-width: 720px) {
  main.shell { padding: 32px 18px 64px; gap: 32px; }
  main.shell.one { padding: 30px 18px 72px; }
  header.top .in { padding: 0 18px; }
  footer .in { padding: 14px 18px 24px; }
  h1 { font-size: var(--fs-38); }
  .head h1 { font-size: var(--fs-32); }
  .lede { font-size: var(--fs-17); }
  .head .lede { font-size: var(--fs-16); }
  .card { padding: 22px 18px; border-radius: var(--r-18); }
  .done h2 { font-size: var(--fs-21); }
}
@media (max-width: 520px) {
  .mark span { display: none; }
  .top .back { font-size: var(--fs-13); }
}
