/* ═══════════════════════════════════════════════════════════════════════════
   BRAND — the recoveri. wordmark and the auth experience.
   The wordmark is the constant brand signal: lowercase, tight, with a full-stop
   in the skin accent so it flips health-blue <-> Sport-green with the theme. The
   logo lockup (circular person-and-hand mark) is used large on the auth hero.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── The logo lockup ──
   The demonstrator's REVERSED artwork (white + skin-accent on transparent) sits
   directly on the deep chrome - no chip, no plate. .brand-logo is the single
   reusable primitive; each placement (auth hero, sidebar) sizes it by context. */
.brand-logo { display: block; width: 100%; height: auto; }

/* The lockup = mark + LIVE tagline (so the tagline translates). Lives here, not in content.css,
   because the welcome picker loads brand.css alone. Health tagline white; sport in the accent. */
.brand-lockup { display: block; width: 100%; }
/* SVG text pinned to the viewBox width: the tagline is always exactly as wide as the mark, so its
   size follows the LOCKUP rather than the string. Colour is fill, not color. */
.brand-tagline {
  display: block; width: 100%; height: auto; margin-top: 3px;
  font-family: var(--font); font-weight: 600; letter-spacing: 0.01em; fill: #fff;
}
:root[data-domain="sport"] .brand-tagline { fill: var(--accent); }
.auth-mark .brand-tagline { margin-top: 6px; }

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: currentColor;
  text-decoration: none;
  white-space: nowrap;
}
.wordmark .dot { color: var(--accent); }
/* On the deep-blue chrome the accent dot needs a lighter blue to read. */
.sidebar .wordmark .dot { color: var(--health-light-blue); }
:root[data-domain="sport"] .sidebar .wordmark .dot { color: var(--accent); }
/* The reversed lockup sits directly on the deep sidebar, centred, like the
   demonstrator - filling the width available, no background. */
.sidebar-logo { display: flex; align-items: center; justify-content: center; }
.sidebar-logo a { display: block; width: 100%; }
.sidebar-logo .brand-lockup { max-width: 200px; margin: 0 auto; }

/* ── The org / skin switcher (sidebar) ── */
.org-switch {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.org-switch label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 6px;
}
.org-switch select {
  width: 100%;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%23fff' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.org-switch select option { color: #1a1a1a; }
.org-switch select:focus-visible {
  outline: 3px solid var(--focus, #ffdd00);
  outline-offset: 1px;
}

/* ── The split auth experience ── */
.auth {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  min-height: 100vh;
}
/* A grid and flex item defaults to min-width:auto, which means it REFUSES to shrink below its
   content - so one long unbreakable string (the MFA page's otpauth:// URI) widened the whole
   column and took the entire page sideways on a phone. min-width:0 lets the track win and the
   content wrap, which is what the wrapping rules below can then act on. */
.auth > *, .auth-card, .auth-foot { min-width: 0; }
.auth-card * { overflow-wrap: anywhere; }

/* LEFT — the brand panel. Deep skin colour, a faint recovery arc, the lockup. */
.auth-brand {
  position: relative;
  overflow: hidden;
  background: var(--brand-deep);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 56px;
}
/* The signature: a quiet recovery arc sweeping up across the panel, echoing the
   journey band. Drawn with a radial highlight + an SVG stroke overlay. */
.auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 15% 110%, rgba(65, 182, 230, 0.25), transparent 55%),
    linear-gradient(150deg, transparent 55%, rgba(0, 94, 184, 0.35) 130%);
  pointer-events: none;
}
:root[data-domain="sport"] .auth-brand::before {
  background:
    radial-gradient(120% 90% at 15% 110%, rgba(25, 195, 125, 0.22), transparent 55%),
    linear-gradient(150deg, transparent 55%, rgba(25, 195, 125, 0.18) 130%);
}
.auth-brand > * { position: relative; z-index: 1; }

.auth-lockup { display: flex; flex-direction: column; align-items: flex-start; gap: 28px; max-width: 34ch; }
.auth-mark { display: block; width: 240px; }
.auth-mark .brand-logo { width: 100%; }
.auth-thesis {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.auth-thesis .accent { color: var(--health-light-blue); }
:root[data-domain="sport"] .auth-thesis .accent { color: var(--accent); }
.auth-sub { font-size: 16px; line-height: 1.6; color: rgba(255, 255, 255, 0.82); max-width: 42ch; }

.auth-trust { display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; color: rgba(255, 255, 255, 0.72); }
.auth-trust div { display: flex; align-items: center; gap: 10px; }
.auth-trust svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--health-light-blue); }
:root[data-domain="sport"] .auth-trust svg { color: var(--accent); }

/* RIGHT — the sign-in card.
   COLUMN, not the default row. This holds two children - the card and the legal/language
   footer - and as a row they sat SIDE BY SIDE: on a phone the password fields were squeezed
   to half the screen with the links floating in the gap beside them. */
.auth-form-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: var(--bg);
}
.auth-card { width: 100%; max-width: 380px; }
/* The footer tracks the card's width so it wraps with it rather than across the whole column. */
.auth-foot { width: 100%; max-width: 380px; margin-top: 14px; text-align: center; font-size: 13px; }
.auth-foot > * { margin: 0 6px; }
.auth-card h1 { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-card .lede { color: var(--text-muted); margin-bottom: 28px; }
.auth-card .field { margin-bottom: 18px; }
.auth-card label { font-size: 14px; }
.auth-card input { padding: 12px 14px; font-size: 16px; }
.auth-card .btn-block { margin-top: 4px; }
.auth-links { margin-top: 20px; font-size: 15px; }
.auth-links a { display: inline-block; }

/* MOBILE — stack the brand band above the form. */
@media (max-width: 880px) {
  .auth { grid-template-columns: 1fr; min-height: 100vh; }
  .auth-brand {
    padding: 28px 24px 32px;
    flex-direction: column;
    gap: 24px;
    justify-content: flex-start;
  }
  .auth-lockup { align-items: center; text-align: center; max-width: none; }
  .auth-mark { width: 168px; }
  .auth-thesis { font-size: 26px; }
  .auth-trust { display: none; }
  .auth-form-side { padding: 32px 20px 48px; }
  .auth-card, .auth-foot { max-width: 460px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PICKER — the pre-login "one platform, two worlds" chooser. Skin-neutral: a
   deep premium field with a Health card (teal) and a Sport card (green). The
   reversed logos sit on the dark cards with no plate, as everywhere else.
   ═══════════════════════════════════════════════════════════════════════════ */
/* Vertical rhythm scales with the viewport height (vh clamps) so the picker is
   big and proud on a desktop yet compresses to fit an iPad without ever spilling
   past 100vh. No inner scroll — the whole chooser is always one screen. */
.picker {
  --pk-health: #41B6E6;
  --pk-sport: #19E39A;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 4.5vh, 44px);
  padding: clamp(20px, 4vh, 56px) 24px;
  background:
    radial-gradient(90% 70% at 20% 0%, rgba(0, 94, 184, 0.30), transparent 60%),
    radial-gradient(90% 70% at 100% 100%, rgba(25, 195, 125, 0.18), transparent 55%),
    #0B1524;
  color: #fff;
}
.picker-head { text-align: center; max-width: 44ch; }
.picker-eyebrow {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: clamp(11px, 1.3vw, 13px);
  color: rgba(255, 255, 255, 0.55);
}
.picker-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 5.2vw, 56px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: clamp(8px, 1.4vh, 14px) 0;
}
.picker-lede { font-size: clamp(15px, 1.7vw, 19px); line-height: 1.6; color: rgba(255, 255, 255, 0.78); }

.picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(20px, 2.6vw, 40px);
  /* Width tracks the viewport so the cards stay well-proportioned (wide, never
     tall-narrow) and the whole composition scales up on big screens. */
  width: min(1080px, 92vw);
}
.picker-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(16px, 1.8vw, 28px);
  padding: clamp(30px, 4vw, 60px) clamp(24px, 3vw, 48px);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-decoration: none;
  color: #fff;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.picker-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.4);
}
.picker-card-health:hover { border-color: var(--pk-health); }
.picker-card-sport:hover { border-color: var(--pk-sport); }
.picker-card:focus-visible { outline: 3px solid var(--focus, #FFDD00); outline-offset: 3px; }

.picker-logo { display: flex; justify-content: center; }
/* Both marks are drawn on the same 925-unit canvas, so sizing by WIDTH renders the two wordmarks at
   an identical scale - and the tagline, which fills the lockup, then matches the mark exactly. The
   box takes the TALLER artwork's ratio (sport, 925:800) and contains the shorter one inside it, so
   both cards' bodies still start on the same row. Sizing by height cannot do this: the two aspects
   differ, so equal heights mean unequal widths and the tagline can only match one of them. */
.picker-logo .brand-lockup { width: clamp(127px, 12.8vw, 195px); }
.picker-logo .brand-logo { width: 100%; height: auto; aspect-ratio: 925 / 800; object-fit: contain; }
.picker-logo .brand-tagline { margin-top: 6px; }
.picker-card-sport .brand-tagline { fill: var(--pk-sport); } /* the page root is health; the card carries the sport accent */
.picker-card-body { display: flex; flex-direction: column; align-items: center; gap: clamp(6px, 0.8vw, 10px); }
.picker-card-name { font-family: var(--font-display); font-size: clamp(22px, 2.8vw, 32px); font-weight: 700; }
.picker-card-desc {
  font-size: clamp(14px, 1.55vw, 17px);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
  max-width: 36ch;
  /* Reserve three lines so both cards' CTAs sit on the same row despite the
     descriptions wrapping to different lengths. */
  min-height: calc(1.55em * 3);
}
.picker-card-go {
  margin-top: clamp(6px, 1vw, 14px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: clamp(15px, 1.6vw, 18px);
}
.picker-card-health .picker-card-go { color: var(--pk-health); }
.picker-card-sport .picker-card-go { color: var(--pk-sport); }
.picker-card-go svg { width: 18px; height: 18px; transition: transform 0.15s ease; }
.picker-card:hover .picker-card-go svg { transform: translateX(4px); }

.picker-foot { font-size: clamp(11px, 1.2vw, 13px); color: rgba(255, 255, 255, 0.5); text-align: center; }

@media (max-width: 680px) {
  .picker-grid { grid-template-columns: 1fr; max-width: 400px; }
}
@media (prefers-reduced-motion: reduce) {
  .picker-card, .picker-card-go svg { transition: none; }
  .picker-card:hover { transform: none; }
  .picker-card:hover .picker-card-go svg { transform: none; }
}

/* ── Onboarding — the subject's focused first-run card (post-login, skinned) ── */
.onboard {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background:
    radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%),
    var(--bg);
}
.onboard-card {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: clamp(26px, 4vw, 44px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.10);
}
.onboard-eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; color: var(--text-muted); font-size: 13px; }
.onboard-eyebrow .wordmark { font-size: 18px; }
.onboard-card h1 { font-family: var(--font-display); font-size: clamp(24px, 3.2vw, 30px); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; }
.onboard-lede { color: var(--text-muted); margin-bottom: 22px; line-height: 1.55; }
.onboard-consent { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0 6px; }
.onboard-consent input { margin-top: 3px; width: 18px; height: 18px; flex-shrink: 0; }
.onboard-consent label { font-size: 14.5px; line-height: 1.5; }
.onboard-next { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 13.5px; line-height: 1.5; }

/* Onboarding questionnaire (template-driven) */
.onboard-q { margin-bottom: 24px; }
.onboard-q-title { font-family: var(--font-display); font-weight: 700; font-size: 18px; margin-bottom: 4px; }
.onboard-q-text { color: var(--text-muted); font-size: 14px; line-height: 1.55; margin-bottom: 12px; }
.onboard-q-prompt { font-weight: 600; margin-bottom: 10px; }
.onboard-options { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.onboard-option { display: flex; gap: 11px; align-items: flex-start; padding: 13px 15px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 15px; }
.onboard-option:last-child { border-bottom: none; }
.onboard-option:hover { background: var(--surface-hover); }
.onboard-option input { margin-top: 3px; flex-shrink: 0; }
.onboard-option:has(input:checked) { background: color-mix(in srgb, var(--accent) 12%, transparent); font-weight: 600; }
.onboard-complete-icon { width: 44px; height: 44px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
