/* =========================================================
   Path to Purpose — Internship Application
   Design system: Montserrat (headings/UI) + Merriweather (body),
   palette from coolors.co/005b99-e68e27-007fc0-cfded9-5d6e6a.
   Built on: View Transitions API, CSS anchor positioning + Popover API,
             @property animated gradients, :has(), container queries,
             color-mix()/OKLCH, and a static SVG watermark background.
   ========================================================= */

@property --grad-pos {
  syntax: '<percentage>';
  initial-value: 0%;
  inherits: false;
}

:root {
  color-scheme: dark;

  /* Actual measured height of .progress-rail, kept in sync at runtime
     by a ResizeObserver in app.js. This value is what .stage uses to
     reserve clearance beneath the fixed rail — driving it from the
     rail's real rendered size (rather than a guessed pixel value)
     guarantees the rail can never overlap step content, regardless of
     font metrics, text wrapping, zoom level, or browser differences.
     64px is just a same-frame fallback before JS measures it. */
  --rail-height: 64px;

  /* --- brand palette: coolors.co/005b99-e68e27-007fc0-cfded9-5d6e6a --- */
  --c-navy: #005b99;
  --c-sky: #007fc0;
  --c-amber: #e68e27;
  --c-mist: #cfded9;
  --c-slate: #5d6e6a;

  --c-sky-l: oklch(from var(--c-sky) calc(l + 0.14) c h);
  --c-amber-l: oklch(from var(--c-amber) calc(l + 0.08) c h);

  --bg-0: color-mix(in oklch, var(--c-navy) 24%, black);
  --bg-1: color-mix(in oklch, var(--c-slate) 20%, black);
  --ink: #f4f7f6;
  --ink-dim: color-mix(in oklch, var(--c-mist) 82%, white 10%);
  --ink-dimmer: color-mix(in oklch, var(--c-mist) 55%, transparent);

  --glass: color-mix(in oklch, var(--c-mist) 10%, transparent);
  --glass-strong: color-mix(in oklch, var(--c-mist) 16%, transparent);
  --glass-border: color-mix(in oklch, var(--c-mist) 24%, transparent);

  --grad-brand: linear-gradient(115deg, var(--c-navy) 0%, var(--c-sky) 50%, var(--c-amber) 100%);
  --grad-brand-soft: linear-gradient(115deg, color-mix(in oklch, var(--c-navy) 55%, transparent), color-mix(in oklch, var(--c-sky) 55%, transparent) 45%, color-mix(in oklch, var(--c-amber) 55%, transparent));

  --font-heading: 'Montserrat', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Merriweather', Georgia, 'Times New Roman', serif;

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --shadow-card: 0 30px 80px -30px rgba(0,0,0,0.65), 0 2px 0 0 var(--glass-border) inset;

  /* tokens that flip direction between themes */
  --surface-dip: black;
  --hairline: white;

  --ease-out: cubic-bezier(.16,1,.3,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg-0: color-mix(in oklch, var(--c-mist) 45%, white 55%);
  --bg-1: color-mix(in oklch, var(--c-mist) 68%, white 32%);
  --ink: #172428;
  --ink-dim: color-mix(in oklch, var(--ink) 74%, transparent);
  --ink-dimmer: color-mix(in oklch, var(--ink) 46%, transparent);

  --glass: color-mix(in oklch, white 55%, transparent);
  --glass-strong: color-mix(in oklch, white 72%, transparent);
  --glass-border: color-mix(in oklch, var(--c-slate) 26%, transparent);

  --shadow-card: 0 24px 60px -28px rgba(23,36,40,0.18), 0 2px 0 0 var(--glass-border) inset;

  --surface-dip: white;
  --hairline: black;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--ink);
  background: var(--bg-0);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-heading); font-weight: 800; }

button, input, select {
  font-family: var(--font-heading);
  font-weight: 700;
  color: inherit;
}

/* ---------------- background layers ---------------- */

.path-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -4;
  display: block;
  pointer-events: none;
}

body::before {
  /* soft vignette so foreground cards stay readable over the artwork */
  content: '';
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 20%, transparent 40%, color-mix(in oklch, var(--bg-0) 70%, black) 100%);
}
:root[data-theme="light"] body::before {
  background: radial-gradient(120% 90% at 50% 20%, transparent 45%, color-mix(in oklch, var(--bg-0) 80%, white) 100%);
}

:root[data-theme="light"] .path-bg {
  opacity: .6;
  mix-blend-mode: multiply;
}

.cursor-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--x, 50%) var(--y, 30%), color-mix(in oklch, var(--c-sky) 10%, transparent), transparent 70%);
  transition: opacity .4s var(--ease-out);
  opacity: 0;
}
body.pointer-active .cursor-glow { opacity: 1; }

/* ---------------- theme toggle ---------------- */

.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 30;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-strong);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .3s, transform .25s var(--ease-spring);
}
.theme-toggle:hover { transform: scale(1.08); background: var(--glass); }
.theme-toggle:active { transform: scale(.92); }

.theme-toggle svg {
  position: absolute;
  width: 20px;
  height: 20px;
  transition: opacity .35s ease, transform .45s var(--ease-spring);
}
.theme-toggle .icon-moon { opacity: 1; transform: scale(1) rotate(0deg); }
.theme-toggle .icon-sun { opacity: 0; transform: scale(.4) rotate(-90deg); }
:root[data-theme="light"] .theme-toggle .icon-moon { opacity: 0; transform: scale(.4) rotate(90deg); }
:root[data-theme="light"] .theme-toggle .icon-sun { opacity: 1; transform: scale(1) rotate(0deg); }

/* ---------------- shell / layout ---------------- */

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.stage {
  flex: 1;
  position: relative;
  padding: clamp(16px, 4vw, 48px);
  /* reserve exactly the rail's real height plus a comfortable buffer,
     so the fixed rail can never sit on top of (or too close to) a
     step's content — see --rail-height above */
  padding-top: calc(var(--rail-height) + clamp(24px, 4vw, 48px));
}

/* the hero has no progress rail, so it doesn't need the extra top
   clearance reserved for it — reclaiming that space keeps the logo
   and headline from being pushed below the fold */
.stage:has(.screen--hero.is-active) {
  padding-top: clamp(16px, 4vw, 48px);
}

.screen {
  /* Every step is stacked in the same spot for the cross-fade
     transition. These used to share a CSS Grid cell, but a grid
     track sizes itself to the TALLEST item placed in it — even
     inactive, invisible ones — so the page's scroll height was being
     set by whichever step had the most content (Demographics,
     RIASEC, etc.), forcing a scroll on every step including the
     short hero. Absolute positioning removes inactive screens from
     layout sizing entirely: each step fills exactly the viewport
     (the .stage padding box) and, if its own content is taller than
     that, scrolls internally via overflow-y — without affecting any
     other step or the page's overall height. */
  position: absolute;
  inset: 0;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* `justify-content: center` (and even `safe center`, which isn't
     reliably supported for flexbox across browsers yet) traps the top
     of any content taller than the box — centering pushes part of it
     before the container's start edge, and scrolling can only ever
     reveal what's past the END edge. The bulletproof, universally-
     supported fix is to center via auto margins on the CHILD instead
     of justify-content on the container: auto margins collapse to 0
     the moment there isn't enough space, so oversized content simply
     starts flush at the top (fully reachable by scrolling) rather
     than being cut off. See the `margin-block: auto` rule below on
     the card/hero-copy wrapper each screen contains. */
  justify-content: flex-start;
  gap: 28px;
  padding-block: 24px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(14px) scale(.99);
  transition: opacity .5s var(--ease-out), transform .5s var(--ease-out), visibility 0s linear .5s;
}
.screen > .card {
  margin-top: 60px;
  margin-bottom: auto;
}
.screen > .hero-copy {
  margin-block: auto;
}

.screen.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: opacity .5s var(--ease-out), transform .5s var(--ease-out), visibility 0s linear 0s;
  view-transition-name: active-screen;
}

::view-transition-old(active-screen) {
  animation: screen-out .45s var(--ease-out) both;
}
::view-transition-new(active-screen) {
  animation: screen-in .5s var(--ease-out) both;
}
@keyframes screen-out { to { opacity: 0; transform: translateY(-18px) scale(.98); } }
@keyframes screen-in { from { opacity: 0; transform: translateY(18px) scale(.98); } }

/* ---------------- progress rail ---------------- */

.progress-rail {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: color-mix(in oklch, var(--bg-0) 55%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--glass-border);
  transform: translateY(-100%);
  opacity: 0;
  transition: transform .5s var(--ease-out), opacity .4s var(--ease-out);
}
.progress-rail[data-hidden="false"] { transform: translateY(0); opacity: 1; }

.progress-rail__brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; flex: 0 0 auto; }
.brand-mark {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: .04em;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-name { font-family: var(--font-heading); font-weight: 600; font-size: .82rem; color: var(--ink-dim); display: none; }
@media (min-width: 640px) { .brand-name { display: inline; } }

.progress-track {
  flex: 1 1 auto;
  height: 6px;
  border-radius: 999px;
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  max-width: 420px;
}
.progress-track__fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--grad-brand);
  transition: width .5s var(--ease-out);
}
.progress-label {
  flex: 0 0 auto;
  white-space: nowrap;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: .78rem;
  color: var(--ink-dim);
}

/* ---------------- typography helpers ---------------- */

.gradient-text {
  font-family: var(--font-heading);
  font-weight: 800;
  background: var(--grad-brand);
  background-size: 220% 100%;
  background-position: var(--grad-pos) 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: grad-shift 9s ease-in-out infinite alternate;
}
@keyframes grad-shift { to { --grad-pos: 100%; } }

.eyebrow {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: .74rem;
  color: var(--c-sky-l);
  font-weight: 700;
}

/* Partner lockup: Path to Purpose + Sonoma County Office of Education.
   Both marks are dark-blue artwork, so they sit on a constant near-white
   plate — that keeps them legible on the dark hero without needing two
   separate light/dark logo files. */
.hero-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 3.4vw, 34px);
  margin-bottom: 4px;
  padding: clamp(14px, 2.4vw, 20px) clamp(20px, 3.2vw, 30px);
  border-radius: var(--radius-md);
  background: color-mix(in oklch, white 94%, var(--c-mist));
  border: 1px solid color-mix(in oklch, var(--c-slate) 20%, transparent);
  box-shadow: 0 20px 50px -28px rgba(0, 0, 0, 0.55);
}

.hero-logos__rule {
  flex: 0 0 auto;
  align-self: stretch;
  width: 1px;
  background: color-mix(in oklch, var(--c-slate) 34%, transparent);
}

.hero-logo {
  height: clamp(40px, 6vw, 58px);
  width: auto;
  display: block;
}

/* Stack the two marks on narrow screens so neither shrinks past the point
   where its tagline stops being readable. */
@media (max-width: 640px) {
  .hero-logos { flex-direction: column; gap: clamp(14px, 4vw, 20px); }
  .hero-logos__rule { align-self: center; width: min(190px, 60%); height: 1px; }
  .hero-logo { height: auto; width: clamp(190px, 58vw, 260px); }
}

/* ---------------- hero ---------------- */

.screen--hero { gap: 30px; text-align: center; max-width: 780px; margin: 0 auto; }

.hero-copy { display: flex; flex-direction: column; align-items: center; gap: 18px; }

.display-title {
  font-family: var(--font-heading);
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.display-title .line { display: block; }
.hero-title-white { color: #ffffff; }
:root[data-theme="light"] .hero-title-white { color: var(--ink); }

.lede {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--ink-dim);
  max-width: 56ch;
  line-height: 1.7;
}

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

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  font-family: var(--font-heading);
  font-size: .96rem;
  font-weight: 700;
  letter-spacing: .01em;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  isolation: isolate;
  transition: transform .25s var(--ease-spring), box-shadow .3s var(--ease-out);
}
.btn:active { transform: scale(.96); }
.btn-arrow { width: 18px; height: 18px; transition: transform .25s var(--ease-spring); }
.btn:hover .btn-arrow { transform: translateX(4px); }

.btn--primary {
  color: #05202e;
  background: var(--c-amber);
  box-shadow: 0 18px 40px -14px color-mix(in oklch, var(--c-amber) 55%, transparent);
}
.btn--primary:hover {
  background: color-mix(in oklch, var(--c-amber) 90%, black 10%);
  box-shadow: 0 22px 50px -12px color-mix(in oklch, var(--c-amber) 70%, transparent);
}

.btn--glow {
  animation: btn-pulse-glow 2.6s ease-in-out infinite;
}
@keyframes btn-pulse-glow {
  0%, 100% { box-shadow: 0 18px 40px -14px color-mix(in oklch, var(--c-amber) 55%, transparent); }
  50% { box-shadow: 0 20px 52px -10px color-mix(in oklch, var(--c-amber) 78%, transparent); }
}

.btn--ghost {
  background: var(--glass);
  color: var(--ink);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}
.btn--ghost:hover { background: var(--glass-strong); }

.btn--tiny {
  padding: 8px 14px;
  font-size: .8rem;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
}

.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

/* ---------------- cards ---------------- */

.card {
  container-type: inline-size;
  width: min(100%, 850px);
  /* mostly-opaque dark (or light, in light theme) surface with just a
     thin wash of the frosted glass tint layered on top — --glass/
     --glass-strong alone are only 10–16% opaque, which let the
     background art (especially the amber arrow) bleed straight
     through the form and fight with the text. Blending them into the
     already-opaque --bg-1 keeps the frosted-glass character while
     making the card itself solid enough to read easily. */
  background: linear-gradient(180deg,
    color-mix(in oklch, var(--bg-1) 80%, var(--glass-strong) 20%),
    color-mix(in oklch, var(--bg-1) 84%, var(--glass) 16%)
  );
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  /* Safari (and some Chromium builds) has a long-standing bug where
     backdrop-filter ignores the element's own border-radius, painting
     the blur as a hard-edged rectangle that pokes out past the
     rounded corners. clip-path clips with rounded corners while
     preserving normal overflow behavior for scrollable parent
     containers. */
  clip-path: inset(0 round var(--radius-lg));
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  box-shadow: var(--shadow-card);
  padding: clamp(24px, 4vw, 42px);
  display: flex;
  flex-direction: column;
  gap: 26px;
  animation: card-rise .6s var(--ease-out) both;
}
.card--wide { width: min(100%, 1160px); }

@keyframes card-rise {
  from { opacity: 0; transform: translateY(24px); }
}

.card-head { display: flex; flex-direction: column; gap: 8px; }
.step-tag {
  font-family: var(--font-heading);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-amber);
}
.card-head h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
.hint { font-family: var(--font-body); color: var(--ink-dim); font-size: .95rem; line-height: 1.65; }

.card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.card-actions .btn--ghost { margin-right: auto; }

.err-msg {
  font-family: var(--font-heading);
  color: var(--c-amber);
  font-size: .85rem;
  font-weight: 700;
}

/* ---------------- form fields ---------------- */

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@container (min-width: 480px) {
  .field-grid { grid-template-columns: 1fr 1fr; }
  .field--wide { grid-column: 1 / -1; }
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-family: var(--font-heading); font-size: .85rem; font-weight: 700; color: var(--ink-dim); }

.field input, .select-wrap select {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: color-mix(in oklch, var(--surface-dip) 20%, var(--glass));
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  outline: none;
  transition: border-color .25s, box-shadow .25s, background .25s;
}
.field input::placeholder { color: var(--ink-dimmer); font-family: var(--font-body); }
.field input:focus, .select-wrap select:focus {
  border-color: var(--c-sky);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--c-sky) 22%, transparent);
  background: color-mix(in oklch, var(--surface-dip) 10%, var(--glass));
}
.field:has(input:invalid:not(:placeholder-shown)) input {
  border-color: var(--c-amber);
}

.select-wrap { position: relative; }
.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.select-wrap select:invalid { color: var(--ink-dimmer); }
.select-chevron {
  position: absolute;
  right: 14px; top: 50%;
  width: 18px; height: 18px;
  transform: translateY(-50%);
  color: var(--ink-dim);
  pointer-events: none;
}

form:has(input:invalid:not(:placeholder-shown)) [data-next],
form:has(select:invalid) [data-next] {
  filter: saturate(.6);
}

.card--form { width: min(100%, 960px); }

.field-note { font-family: var(--font-body); font-size: .78rem; color: var(--ink-dimmer); }

/* ---------------- consent / eligibility blocks ---------------- */

.consent-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: color-mix(in oklch, var(--surface-dip) 14%, var(--glass));
  border: 1px solid var(--glass-border);
}
.consent-intro {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: .88rem;
  color: var(--ink);
}
.consent-list {
  margin: 0;
  padding-left: 1.2em;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--font-body);
  font-size: .9rem;
  line-height: 1.55;
  color: var(--ink-dim);
}
.consent-list strong { color: var(--ink); font-family: var(--font-heading); font-size: .82rem; }

/* ---------------- checkbox / radio rows ---------------- */

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 4px 2px;
}
.check-row input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-box {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  margin-top: 1px;
  border-radius: 7px;
  border: 1.5px solid var(--glass-border);
  background: color-mix(in oklch, var(--surface-dip) 16%, var(--glass));
  display: flex; align-items: center; justify-content: center;
  color: transparent;
  transition: background .25s, border-color .25s, color .25s;
}
.check-box svg { width: 14px; height: 14px; }
.check-row input:checked ~ .check-box,
.check-row input:checked + .check-box {
  background: var(--c-amber);
  border-color: var(--c-amber);
  color: #05202e;
}
.check-row:has(input:focus-visible) .check-box { box-shadow: 0 0 0 4px color-mix(in oklch, var(--c-sky) 30%, transparent); }
.check-label { font-family: var(--font-body); font-size: .92rem; line-height: 1.55; color: var(--ink); }

.check-row--compact { padding: 2px 2px; }
.check-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px 18px;
}
@container (min-width: 560px) {
  .check-list { grid-template-columns: 1fr 1fr; }
}
@container (min-width: 820px) {
  .check-list { grid-template-columns: 1fr 1fr 1fr; }
}
.check-row--other { align-items: center; flex-wrap: wrap; }

.radio-list { display: flex; flex-direction: column; gap: 4px; }
.radio-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 6px 2px;
  font-family: var(--font-body);
  font-size: .92rem;
  color: var(--ink);
  flex-wrap: wrap;
}
.radio-row input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.radio-dot {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--glass-border);
  background: color-mix(in oklch, var(--surface-dip) 16%, var(--glass));
  position: relative;
  transition: border-color .25s;
}
.radio-dot::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--c-amber);
  transform: scale(0);
  transition: transform .2s var(--ease-spring);
}
.radio-row input:checked ~ .radio-dot { border-color: var(--c-amber); }
.radio-row input:checked ~ .radio-dot::after { transform: scale(1); }
.radio-row:has(input:focus-visible) .radio-dot { box-shadow: 0 0 0 4px color-mix(in oklch, var(--c-sky) 30%, transparent); }
.radio-row--other { align-items: center; }

.inline-other {
  margin-left: 4px;
  padding: 8px 12px;
  min-width: 180px;
  flex: 1 1 200px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: color-mix(in oklch, var(--surface-dip) 20%, var(--glass));
  color: var(--ink);
  font-family: var(--font-body);
  font-size: .88rem;
  outline: none;
  transition: opacity .2s, border-color .2s;
}
.inline-other:disabled { opacity: .4; cursor: not-allowed; }
.inline-other:focus { border-color: var(--c-sky); }

/* ---------------- question groups ---------------- */

.qgroup { display: flex; flex-direction: column; gap: 10px; }
.qgroup-title { font-family: var(--font-heading); font-weight: 700; font-size: .92rem; color: var(--ink); }
.qgroup-sub { font-family: var(--font-body); font-size: .82rem; color: var(--ink-dimmer); margin-top: -6px; }
.req-star { color: var(--c-amber); }
.opt-tag {
  font-family: var(--font-heading);
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink-dimmer);
}

.text-input {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: color-mix(in oklch, var(--surface-dip) 20%, var(--glass));
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1rem;
  outline: none;
  transition: border-color .25s, box-shadow .25s, background .25s;
}
.text-input::placeholder { color: var(--ink-dimmer); }
.text-input:focus {
  border-color: var(--c-sky);
  box-shadow: 0 0 0 4px color-mix(in oklch, var(--c-sky) 22%, transparent);
}
.textarea { resize: vertical; min-height: 64px; line-height: 1.55; }

/* ---------------- star rating (RIASEC) ---------------- */

.riasec-list { display: flex; flex-direction: column; gap: 18px; }
.riasec-item {
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: color-mix(in oklch, var(--surface-dip) 14%, var(--glass));
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.riasec-item__head { display: flex; flex-direction: column; gap: 4px; }
.riasec-item__head h3 { font-size: 1rem; color: var(--ink); font-family: var(--font-heading); }
.riasec-item__head p { font-family: var(--font-body); font-size: .86rem; color: var(--ink-dim); line-height: 1.5; }
.riasec-item__head .examples { font-style: italic; color: var(--ink-dimmer); }

.star-rating { display: flex; align-items: center; gap: 6px; }
.star-rating button {
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: var(--glass-border);
  transition: transform .18s var(--ease-spring), color .18s;
}
.star-rating button svg { width: 26px; height: 26px; display: block; }
.star-rating button:hover { transform: scale(1.15); }
.star-rating button.is-filled { color: var(--c-amber); }
.star-rating-label { font-family: var(--font-heading); font-size: .76rem; color: var(--ink-dimmer); margin-left: 6px; }

/* ---------------- file uploads ---------------- */

.upload-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@container (min-width: 560px) {
  .upload-grid { grid-template-columns: 1fr 1fr; }
}
.file-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 26px 16px;
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--glass-border);
  background: color-mix(in oklch, var(--surface-dip) 12%, var(--glass));
  color: var(--ink-dim);
  cursor: pointer;
  transition: border-color .25s, background .25s, color .25s;
}
.file-drop svg { width: 26px; height: 26px; color: var(--c-sky-l); }
.file-drop:hover { border-color: var(--c-sky); background: color-mix(in oklch, var(--surface-dip) 6%, var(--glass)); }
.file-drop.has-file { border-color: var(--c-amber); border-style: solid; color: var(--ink); }
.file-drop__text { font-family: var(--font-body); font-size: .84rem; line-height: 1.5; }
.file-input-hidden {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------------- CTE bubble field ---------------- */

.bubble-field {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  padding: 6px 0 4px;
}

.bubble {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 148px;
  height: 148px;
  padding: 16px 12px;
  text-align: center;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #004080 0%, #005B99 50%, #007FC0 100%);
  color: #ffffff;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: .85rem;
  font-weight: 700;
  line-height: 1.3;
  transition: transform .3s var(--ease-spring), box-shadow .35s, filter .35s;
  box-shadow: 0 8px 24px -6px rgba(0, 91, 153, 0.25);
}

/* The bubbles used to float on a looping "bob" keyframe. It's been removed:
   the grid now sits still, and the only movement is the spring transition
   into the selected state below. */

.bubble .icon { width: 32px; height: 32px; opacity: 1; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1)); }

/* No hover state on the bubbles by design — the only visual change
   should be the selected/ranked state below. */

.bubble.is-selected {
  background: linear-gradient(135deg, #004080 0%, #005B99 50%, #007FC0 100%);
  color: #ffffff;
  border-color: transparent;
  transform: scale(1.12) translateY(-8px);
  box-shadow: 0 20px 40px -10px rgba(0, 91, 153, 0.5);
  filter: brightness(1.2) drop-shadow(0 0 8px rgba(0, 91, 153, 0.4));
}
.bubble.is-selected .icon { opacity: 1; color: #ffffff; }

.bubble .rank-badge {
  position: absolute;
  top: -6px; right: -6px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: #05202e;
  color: var(--c-amber-l);
  border: 2px solid var(--c-amber);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading);
  font-size: .78rem;
  font-weight: 800;
  opacity: 0;
  transform: scale(.4);
  transition: opacity .25s, transform .25s var(--ease-spring);
}
.bubble.is-selected .rank-badge { opacity: 1; transform: scale(1); }

.bubble .info-btn {
  position: absolute;
  bottom: 8px; right: 8px;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: color-mix(in oklch, var(--surface-dip) 30%, transparent);
  color: var(--ink-dim);
  font-family: var(--font-heading);
  font-size: .7rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  anchor-name: --bubble-anchor;
}
.bubble.is-selected .info-btn { background: color-mix(in oklch, var(--surface-dip) 45%, transparent); color: #05202e; border-color: transparent; }

.sector-popover {
  position: fixed;
  max-width: 240px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: color-mix(in oklch, var(--bg-1) 92%, var(--surface-dip));
  border: 1px solid var(--glass-border);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: .82rem;
  line-height: 1.55;
  box-shadow: var(--shadow-card);
  margin: 0;
  inset: unset;
}
.sector-popover::backdrop { background: transparent; }
.sector-popover strong {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-heading);
  color: var(--c-sky-l);
  font-size: .85rem;
}

@supports (anchor-name: --a) {
  .sector-popover { position-anchor: --bubble-anchor; }
}

.selection-count { font-family: var(--font-heading); text-align: center; color: var(--ink-dim); font-size: .9rem; font-weight: 600; }
.selection-count #selCount { color: var(--c-sky-l); font-weight: 800; }

/* ---------------- calendar ---------------- */

.card--calendar { gap: 20px; }

.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.cal-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-dim);
}
.swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; margin-right: 2px; }
.swatch--open { background: var(--c-amber); }
.swatch--none { background: color-mix(in oklch, var(--c-mist) 35%, transparent); border: 1px solid color-mix(in oklch, var(--c-mist) 55%, transparent); }

.cal-wrap {
  position: relative;
  overflow: auto;
  max-height: 58vh;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: color-mix(in oklch, var(--surface-dip) 18%, transparent);
  -webkit-mask-image: linear-gradient(180deg, transparent, black 14px, black calc(100% - 14px), transparent);
  mask-image: linear-gradient(180deg, transparent, black 14px, black calc(100% - 14px), transparent);
}

.calendar-grid {
  display: grid;
  grid-template-columns: 58px repeat(7, minmax(52px, 1fr));
  user-select: none;
  -webkit-user-select: none;
  min-width: 520px;
}

.cal-corner, .cal-daylabel {
  position: sticky;
  top: 0;
  z-index: 2;
  background: color-mix(in oklch, var(--bg-1) 88%, var(--surface-dip));
  padding: 8px 4px;
  text-align: center;
  font-family: var(--font-heading);
  font-size: .72rem;
  font-weight: 700;
  color: var(--ink-dim);
  border-bottom: 1px solid var(--glass-border);
}
.cal-corner { left: 0; z-index: 3; }

.cal-timelabel {
  position: sticky;
  left: 0;
  z-index: 1;
  background: color-mix(in oklch, var(--bg-1) 82%, var(--surface-dip));
  font-family: var(--font-heading);
  font-size: .66rem;
  font-weight: 600;
  color: var(--ink-dimmer);
  text-align: right;
  padding-right: 8px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  border-right: 1px solid var(--glass-border);
}

.cal-cell {
  height: 16px;
  border-bottom: 1px solid color-mix(in oklch, var(--hairline) 6%, transparent);
  border-right: 1px solid color-mix(in oklch, var(--hairline) 6%, transparent);
  background: color-mix(in oklch, var(--c-mist) 7%, transparent);
  cursor: pointer;
  touch-action: none;
  transition: background .12s ease-out;
}
.cal-cell.hour-start { border-top: 1px solid color-mix(in oklch, var(--hairline) 14%, transparent); }
.cal-cell:hover { background: color-mix(in oklch, var(--c-sky) 20%, transparent); }
.cal-cell.is-available {
  background: repeating-linear-gradient(135deg, var(--c-amber), var(--c-amber) 6px, color-mix(in oklch, var(--c-amber) 80%, black) 6px, color-mix(in oklch, var(--c-amber) 80%, black) 12px);
}
.cal-cell.is-available:hover { filter: brightness(1.1); }

/* ---------------- review ---------------- */

.review-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@container (min-width: 560px) {
  .review-grid { grid-template-columns: 1fr 1fr; }
}
.review-item {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: color-mix(in oklch, var(--surface-dip) 16%, var(--glass));
  border: 1px solid var(--glass-border);
}
.review-item.span-2 { grid-column: 1 / -1; }
.review-item .rlabel {
  font-family: var(--font-heading);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--c-sky-l);
  font-weight: 700;
  margin-bottom: 4px;
  display: block;
}
.review-item .rvalue { font-family: var(--font-body); font-size: .95rem; line-height: 1.6; }
.review-item .rvalue.muted { color: var(--ink-dimmer); font-style: italic; }

.review-week { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-top: 4px; }
.review-week .rday { font-family: var(--font-body); font-size: .8rem; }
.review-week .rday b { font-family: var(--font-heading); color: var(--c-amber); display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }

/* ---------------- thanks screen ---------------- */

.screen--thanks { text-align: center; max-width: 560px; margin: 0 auto; gap: 20px; }
.thanks-mark svg { width: 84px; height: 84px; }
.check-circle {
  stroke: var(--c-sky);
  stroke-width: 2.5;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: draw 0.7s var(--ease-out) forwards;
}
.check-mark {
  stroke: var(--c-sky);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 36;
  stroke-dashoffset: 36;
  animation: draw 0.5s var(--ease-out) .55s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------------- misc ---------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

@media (max-width: 520px) {
  .stage {
    padding: 12px;
    padding-top: calc(var(--rail-height) + 12px);
  }
  .stage:has(.screen--hero.is-active) {
    padding-top: 12px;
  }
  .card {
    width: 100%;
    max-width: 100%;
  }
  .bubble { width: 104px; height: 104px; font-size: .72rem; }
}
