:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  /* Brand palette. Coral carries dark ink (7.5:1); white on coral is 2.8:1 and is never used. */
  /* The logo and app icon are red; the interface accent is coral. They are deliberately separate tokens. */
  --logo-red: #f1272e;
  --coral: #ff6b5e;
  --coral-pressed: #ed5d52;
  --ink: #171719;
  --paper: #f3f1ec;
  --surface: #1c1c1e;
  --text: #ffffff;
  --muted: #a1a1a6;
  --line: rgb(84 84 88 / 65%);
  --error: #ff9da1;
  --success: #9bdfb0;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #000; color: #fff; }
button, input { font: inherit; }
button { border: 0; cursor: pointer; }
button:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; }
input:focus-visible { outline: 0; }
.gate-shell { width: min(100%, 430px); min-height: 100svh; margin: auto; padding: max(16px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.gate-top { min-height: 52px; display: grid; grid-template-columns: 54px 1fr 54px; align-items: center; margin-bottom: 8px; }
/* The lockup is the vector mark plus real text, like the in-app header: crisp at any size, truly centred, no font file needed. */
.brand { grid-column: 2; grid-row: 1; justify-self: center; display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.brand img { width: 32px; height: 32px; flex: none; }
.brand strong { font-size: 20px; line-height: 24px; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; }
.brand strong span { color: var(--logo-red); }
.nav-back { min-width: 44px; min-height: 44px; padding: 0 6px; border-radius: 22px; background: var(--surface); color: #fff; font-size: 14px; font-weight: 600; }
#nav-back { width: 44px; padding: 0; display: grid; place-items: center; }
#nav-back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
#native-app-tools { grid-column: 1; grid-row: 1; }
#nav-back { grid-column: 1; grid-row: 1; }
.screen { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 15px; line-height: 20px; font-weight: 600; letter-spacing: -.016em; }
h1 { margin: 0; font-size: 34px; line-height: 41px; font-weight: 700; letter-spacing: -.022em; }
.intro { margin: 8px 0 24px; color: var(--muted); font-size: 17px; line-height: 22px; letter-spacing: -.024em; text-wrap: pretty; }
.choice-list { display: grid; gap: 10px; }
.choice { width: 100%; min-height: 80px; display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 24px; background: #2c2c2e; color: #fff; text-align: left; }
.choice img { width: 58px; height: 58px; flex: none; object-fit: contain; border-radius: 17px; background: var(--paper); }
.choice-copy { display: grid; gap: 3px; }
.choice strong { font-size: 17px; font-weight: 650; }
.choice small { color: var(--muted); font-size: 13px; line-height: 1.3; }
#choose-view { position: relative; overflow: hidden; margin: 0 -16px -18px; padding: 0 10px; }
.choose-stage { position: absolute; inset: 0; padding: 34px 16px; }
.choose-stage h2 { margin: 24px 0 20px; font-size: 32px; line-height: 1.1; }
.choose-stage > div { display: flex; align-items: center; gap: 14px; min-height: 80px; margin-bottom: 10px; padding: 10px; border-radius: 22px; background: var(--surface); font-size: 15px; }
.choose-stage img { width: 58px; height: 58px; object-fit: contain; border-radius: 15px; background: var(--paper); }
.choose-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.78); }
.role-sheet { position: relative; z-index: 1; width: calc(100% + 20px); margin: auto -10px 0; padding: 10px 16px 20px; border-radius: 36px 36px 0 0; background: var(--surface); }
.sheet-handle { display: block; width: 36px; height: 5px; margin: 0 auto 14px; border-radius: 3px; background: #6b6b70; }
.role-sheet h1 { margin: 0 0 18px; font-size: 17px; line-height: 1.35; letter-spacing: 0; text-align: center; }
.role-sheet .footer { margin: 12px 0 0; padding: 0; }
.hero-art { width: 88px; height: 88px; margin: 8px 0 24px; border-radius: 22px; object-fit: contain; background: var(--paper); }
.code-art { width: 100%; height: 176px; margin: 8px 0 24px; border-radius: 24px; object-fit: contain; background: var(--paper); }
.group { overflow: hidden; border-radius: 22px; background: var(--surface); }
.group-row { position: relative; display: flex; align-items: center; min-height: 52px; gap: 8px; padding: 0 16px; color: var(--text); font-size: 17px; letter-spacing: -.024em; transition: box-shadow 160ms ease; }
.group-row + .group-row::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; height: .5px; background: var(--line); }
/* The focused row is marked by a quiet inner line and the caret, not a ring around the field. */
.group-row:focus-within { box-shadow: inset 0 0 0 1px rgb(255 255 255 / 22%); }
.group-row:first-child:focus-within { border-radius: 22px 22px 0 0; }
.group-row:last-child:focus-within { border-radius: 0 0 22px 22px; }
.group-row > span:first-child, .group-row > label:first-child { width: 96px; flex: none; }
.group-row input { width: 100%; min-width: 0; min-height: 52px; padding: 0; border: 0; outline: none; background: transparent; color: var(--text); font-size: 17px; letter-spacing: inherit; caret-color: var(--coral); }
.group-row input[aria-invalid="true"] { box-shadow: inset 0 -2px var(--error); }
.show-password { min-width: 52px; min-height: 44px; margin-right: -8px; border-radius: 10px; background: transparent; color: var(--muted); font-size: 15px; font-weight: 500; letter-spacing: -.016em; }
.field-error, .status { margin: 8px 4px 0; color: var(--error); font-size: 13px; line-height: 18px; }
.status:empty { display: none; }
.status.success { color: var(--success); }
.primary-button { width: 100%; min-height: 52px; margin-top: 24px; padding: 0 20px; border-radius: 999px; background: var(--coral); color: var(--ink); font-size: 17px; font-weight: 600; letter-spacing: -.024em; transition: background-color 160ms ease, transform 160ms ease; }
.primary-button:active { background: var(--coral-pressed); transform: scale(.985); }
.primary-button:disabled { opacity: .6; cursor: wait; }
.text-button { min-height: 44px; padding: 0 6px; background: transparent; color: var(--coral); font-size: 17px; font-weight: 500; letter-spacing: -.024em; }
.forgot { display: block; margin: 8px auto 0; }
.subtle { color: var(--muted); font-size: 13px; line-height: 18px; text-wrap: pretty; }
#invite-help { max-width: 34ch; margin: 8px auto 0; text-align: center; }
.coach-note { margin: 10px 16px 0; }
.footer { margin: auto 0 0; padding: 24px 0 0; color: var(--muted); font-size: 15px; line-height: 20px; text-align: center; }
.footer .text-button { font-size: 15px; }
.footer .text-button { padding: 0 2px; font-size: inherit; }
.code-form { display: flex; flex: 1; flex-direction: column; }
.code-input { display: grid; gap: 4px; padding: 12px 16px; border: 0; border-radius: 22px; background: var(--surface); transition: box-shadow 160ms ease; }
.code-input:focus-within { box-shadow: inset 0 0 0 1px rgb(255 255 255 / 22%); }
.code-input span { color: var(--muted); font-size: 13px; }
.code-input input { width: 100%; min-height: 30px; padding: 0; border: 0; outline: none; background: transparent; color: var(--text); font-size: 17px; letter-spacing: .08em; caret-color: var(--coral); }
.code-hint { margin: 8px 16px 0; }
.code-form .primary-button { margin-top: auto; }
@media (max-height: 660px) { .gate-shell { min-height: 660px; } .footer { padding-top: 14px; } }

/* Trainee welcome: the onboarding figure on a paper tile with activity rings drawing in behind it.
   The sign-in script only shows the "Trainee sign in" eyebrow on that view, so the art follows it;
   no script change is needed and an already-cached script still works. */
.welcome-art { position: relative; width: 100%; height: 176px; margin: 8px 0 24px; overflow: hidden; border-radius: 24px; background: var(--paper); }
#auth-view:has(#gate-eyebrow[hidden]) .welcome-art { display: none; }
.welcome-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.welcome-art img { position: absolute; top: 8px; left: 50%; width: 300px; height: 300px; margin-left: -150px; }
.welcome-art circle { fill: none; }
.welcome-art .ring-track { stroke: rgb(23 23 25 / 7%); stroke-width: 10; }
.welcome-art .ring { stroke-width: 10; stroke-linecap: round; stroke-dasharray: 100; transform: rotate(-90deg); transform-origin: 160px 92px; }
.welcome-art .ring-a { stroke: var(--coral); stroke-dashoffset: 26; }
.welcome-art .ring-b { stroke: var(--ink); stroke-dashoffset: 42; opacity: .82; }
.welcome-art .spark { fill: var(--coral); transform-box: fill-box; transform-origin: center; }
.welcome-art .spark-b, .welcome-art .spark-d { fill: var(--ink); opacity: .55; }
@media (prefers-reduced-motion: no-preference) {
  .welcome-art .ring-a { animation: gate-ring-a 1500ms cubic-bezier(.25, .1, .25, 1) 250ms both; }
  .welcome-art .ring-b { animation: gate-ring-b 1700ms cubic-bezier(.25, .1, .25, 1) 450ms both; }
  .welcome-art img { animation: gate-float 6s ease-in-out 1.2s infinite; }
  .welcome-art .spark { animation: gate-twinkle 4.2s ease-in-out infinite; }
  .welcome-art .spark-b { animation-delay: 1.1s; }
  .welcome-art .spark-c { animation-delay: 2.1s; }
  .welcome-art .spark-d { animation-delay: 3.1s; }
  #auth-view > :is(.welcome-art, .eyebrow, h1, .intro, form) { animation: gate-rise 460ms cubic-bezier(.25, .1, .25, 1) both; }
  #auth-view > .eyebrow { animation-delay: 60ms; }
  #auth-view > h1 { animation-delay: 110ms; }
  #auth-view > .intro { animation-delay: 160ms; }
  #auth-view > form { animation-delay: 220ms; }
  @keyframes gate-ring-a { from { stroke-dashoffset: 100; } }
  @keyframes gate-ring-b { from { stroke-dashoffset: 100; } }
  @keyframes gate-float { 50% { transform: translateY(-4px); } }
  @keyframes gate-twinkle { 0%, 100% { opacity: .2; transform: scale(.7); } 50% { opacity: 1; transform: scale(1); } }
  @keyframes gate-rise { from { opacity: 0; transform: translateY(8px); } }
}

/* Increased contrast: brighter secondary text and a visible row outline. */
@media (prefers-contrast: more) {
  :root { --muted: #d1d1d6; --line: rgb(255 255 255 / 45%); }
  .group { box-shadow: inset 0 0 0 1px var(--line); }
}
/* Coach sign-in hides the intro line; keep the same gap between title and form. */
#gate-intro[hidden] + form { margin-top: 24px; }
