/* ==========================================================================
   MindSense AI — Design tokens
   Palette: deep navy base, indigo/blue/cyan accent ramp, off-white surface.
   Type: Fraunces (display serif, warm + calm) / Manrope (UI sans).
   ========================================================================== */

:root {
  /* Color */
  --navy-950: #0A0F24;
  --navy-900: #0F1830;
  --navy-800: #172142;
  --ink: #141A2E;
  --ink-soft: #4B5271;
  --muted: #6B7290;
  --line: #E5E8F2;
  --line-soft: #EEF0F8;
  --bg: #F6F7FC;
  --surface: #FFFFFF;
  --surface-tint: #F1F3FB;

  --indigo: #7C67EE;
  --indigo-600: #6650DC;
  --blue: #3F73E8;
  --cyan: #2FC2D6;
  --cyan-soft: #E4F8FA;
  --grad-accent: linear-gradient(120deg, var(--blue), var(--indigo) 55%, var(--cyan));

  --ok: #2FAE7C;
  --warn: #E0A93E;
  --bad: #E1636B;

  /* Type */
  --font-display: 'Fraunces', 'Iowan Old Style', 'Georgia', serif;
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Radius scale — deliberately varied by hierarchy */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(15, 24, 48, 0.06), 0 1px 1px rgba(15, 24, 48, 0.04);
  --shadow-md: 0 12px 28px -12px rgba(20, 26, 46, 0.18);
  --shadow-lg: 0 24px 60px -20px rgba(15, 24, 64, 0.28);

  --header-h: 76px;
  --container-w: 1180px;

  color-scheme: light;
}

/* ==========================================================================
   Reset
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}
img, svg { display: block; max-width: 100%; }

/* Author rules below set their own `display` (flex/grid/inline-flex) on several
   classes (.btn, .field, .loading-card, etc). Those declarations win over the
   browser's built-in [hidden] rule unless we reassert it here explicitly. */
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }

.icon { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--navy-950); color: #fff; padding: 10px 16px; border-radius: var(--r-sm);
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 2.5px solid var(--indigo);
  outline-offset: 2px;
  border-radius: 4px;
}

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

.container { max-width: var(--container-w); margin-inline: auto; padding-inline: 24px; }
.container.narrow { max-width: 860px; }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  /* No backdrop-filter/transform directly on .site-header: either would make
     it the containing block for the fixed mobile nav below (a descendant),
     sizing that nav against the header's own small box instead of the
     viewport. The blur lives on a ::before layer instead, which the nav is
     not a descendant of. */
}
.site-header::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: rgba(10, 15, 36, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand-mark {
  width: 40px; height: 40px; border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--grad-accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.brand-mark .icon { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-display); font-size: 1.12rem; font-weight: 600; letter-spacing: 0.01em; }
.brand-text small { font-size: 0.72rem; color: rgba(255,255,255,0.62); }

.site-nav ul { display: flex; gap: 4px; }
.nav-link {
  display: inline-block; padding: 9px 14px; border-radius: var(--r-pill);
  text-decoration: none; font-weight: 500; font-size: 0.94rem;
  color: rgba(255,255,255,0.78);
  transition: background .18s ease, color .18s ease;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-link.active { color: #fff; background: rgba(255,255,255,0.14); }

.header-actions { display: flex; align-items: center; gap: 14px; }

.status-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 13px; border-radius: var(--r-pill);
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12);
  font-size: 0.8rem; font-weight: 500; color: rgba(255,255,255,0.85);
  white-space: nowrap;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.status-pill[data-state="online"] .status-dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(47,174,124,0.22); animation: pulse-dot 2.2s ease-in-out infinite; }
.status-pill[data-state="offline"] .status-dot { background: var(--bad); box-shadow: 0 0 0 3px rgba(225,99,107,0.22); }
.status-pill[data-state="checking"] .status-dot { background: var(--warn); animation: pulse-dot 1.1s ease-in-out infinite; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.nav-toggle {
  display: none; background: none; border: none; color: #fff; cursor: pointer;
  padding: 8px; border-radius: var(--r-sm);
}
.nav-toggle .icon { width: 22px; height: 22px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--r-pill);
  font-weight: 600; font-size: 0.96rem; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn .icon { width: 18px; height: 18px; }

.btn-primary {
  background: var(--grad-accent); color: #fff;
  box-shadow: 0 10px 24px -10px rgba(76, 84, 220, 0.55);
}
.btn-primary:hover { box-shadow: 0 14px 30px -10px rgba(76, 84, 220, 0.65); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }

.btn-secondary {
  background: var(--surface); color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover { border-color: var(--indigo); color: var(--indigo-600); }

.btn-ghost {
  background: transparent; color: var(--muted); border-color: transparent;
  padding-inline: 14px;
}
.btn-ghost:hover { color: var(--ink); background: var(--surface-tint); }
.btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-lg { padding: 15px 30px; font-size: 1.02rem; }

.hero .btn-secondary { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.25); }
.hero .btn-secondary:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,0.14); }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  background: radial-gradient(120% 140% at 15% 0%, #16224A 0%, var(--navy-950) 58%, var(--navy-950) 100%);
  color: #fff;
  padding: 76px 0 96px;
  overflow: hidden;
}

.hero-bg { position: absolute; inset: 0; z-index: 0; }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.35; }
.blob-1 { width: 420px; height: 420px; background: var(--indigo); top: -140px; right: 8%; }
.blob-2 { width: 340px; height: 340px; background: var(--cyan); bottom: -160px; left: 2%; opacity: 0.22; }

.hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center;
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.1vw, 3.4rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  max-width: 15ch;
}

.hero-lead {
  margin-top: 20px;
  font-size: 1.08rem;
  color: rgba(255,255,255,0.72);
  max-width: 46ch;
  line-height: 1.6;
}

.hero-actions { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }

.disclaimer {
  margin-top: 30px;
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 0.83rem; color: rgba(255,255,255,0.5);
  max-width: 48ch; line-height: 1.5;
}
.disclaimer .icon { width: 16px; height: 16px; margin-top: 2px; }

.disclaimer-center { color: var(--muted); margin: 34px auto 0; max-width: 52ch; justify-content: center; text-align: left; }

/* Hero decorative visual */
.hero-visual { position: relative; height: 400px; }

.orb {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 230px; height: 230px;
}
.orb-core {
  position: absolute; inset: 0; margin: auto; width: 96px; height: 96px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad-accent);
  box-shadow: 0 0 60px 10px rgba(124, 103, 238, 0.45);
}
.orb-core .icon { width: 40px; height: 40px; color: #fff; }

.orbit { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed rgba(255,255,255,0.18); }
.orbit-1 { animation: spin 22s linear infinite; }
.orbit-2 { inset: -34px; animation: spin 30s linear infinite reverse; }
.orbit-3 { inset: -68px; border-style: solid; border-color: rgba(255,255,255,0.08); animation: spin 40s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.float-chip {
  position: absolute;
  display: flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: var(--r-pill);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  backdrop-filter: blur(6px);
  font-size: 0.82rem; font-weight: 500; color: #fff;
  animation: float 6s ease-in-out infinite;
}
.float-chip .icon { width: 15px; height: 15px; color: var(--cyan); }
.chip-sleep { top: 6%; left: 2%; animation-delay: 0s; }
.chip-study { top: 14%; right: 0%; animation-delay: 1.4s; }
.chip-screen { bottom: 16%; left: -2%; animation-delay: 0.7s; }
.chip-stress { bottom: 4%; right: 6%; animation-delay: 2.1s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ==========================================================================
   Sections / general
   ========================================================================== */

.section { padding: 88px 0; }
.section-about { background: var(--surface); border-top: 1px solid var(--line-soft); }

.section-head { max-width: 60ch; margin-bottom: 40px; }
.section-head h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.7rem, 2.6vw, 2.2rem);
  color: var(--ink); letter-spacing: -0.01em;
}
.section-head p { margin-top: 12px; color: var(--muted); font-size: 1.02rem; }
.section-head-wide { max-width: 68ch; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.noscript {
  background: #FDECEC; color: #922C33; border: 1px solid #F3C7C9;
  padding: 14px 18px; border-radius: var(--r-md); margin-bottom: 20px;
}

/* ==========================================================================
   Assessment form
   ========================================================================== */

.form-card { padding: 40px; }

.stepper {
  display: flex; justify-content: space-between; gap: 4px;
  margin-bottom: 40px; position: relative;
}
.stepper::before {
  content: ""; position: absolute; top: 19px; left: 6%; right: 6%; height: 2px;
  background: var(--line);
}
.step-item { position: relative; flex: 1; display: flex; justify-content: center; z-index: 1; }
.step-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer; color: var(--muted);
  padding: 0;
}
.step-dot {
  position: relative;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--line);
  color: var(--muted);
  transition: border-color .2s ease, background .2s ease, color .2s ease;
}
.step-dot .icon { width: 18px; height: 18px; }
.icon-check { display: none; }
.step-label { font-size: 0.78rem; font-weight: 600; }

.step-item[data-state="current"] .step-dot { border-color: var(--indigo); color: var(--indigo-600); box-shadow: 0 0 0 5px rgba(124,103,238,0.14); }
.step-item[data-state="current"] .step-label { color: var(--ink); }
.step-item[data-state="done"] .step-dot { background: var(--grad-accent); border-color: transparent; color: #fff; }
.step-item[data-state="done"] .icon-step { display: none; }
.step-item[data-state="done"] .icon-check { display: block; }
.step-item[data-state="done"] .step-label { color: var(--ink); }
.step-btn:disabled { cursor: default; }

.step-panel { border: none; margin: 0; padding: 0; animation: step-in .35s ease; }
@keyframes step-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.panel-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 26px; }
.panel-icon {
  width: 42px; height: 42px; border-radius: var(--r-sm); flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--cyan-soft); color: var(--indigo-600);
}
.panel-title { font-family: var(--font-display); font-size: 1.28rem; font-weight: 600; color: var(--ink); outline: none; }
.panel-head p { margin-top: 4px; color: var(--muted); font-size: 0.92rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 22px; }
.span-2 { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 0.88rem; font-weight: 600; color: var(--ink); }

.field input[type="text"],
.field input[type="number"],
.field select {
  padding: 12px 14px; border-radius: var(--r-sm);
  border: 1.5px solid var(--line);
  background: var(--surface-tint);
  font-size: 0.96rem; color: var(--ink);
  transition: border-color .16s ease, background .16s ease;
  width: 100%;
}
.field input:hover, .field select:hover { border-color: #CBD1E8; }
.field input:focus, .field select:focus { border-color: var(--indigo); background: var(--surface); outline: none; }

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7290' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 38px;
}

.field.invalid input, .field.invalid select { border-color: var(--bad); background: #FDF3F3; }
.field-error { font-size: 0.8rem; color: var(--bad); min-height: 1.1em; }

/* Range / slider cards */
.range-card {
  background: var(--surface-tint);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px 20px;
}
.range-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.range-head label { display: flex; align-items: center; gap: 8px; }
.range-head .icon { width: 17px; height: 17px; color: var(--indigo-600); }

.range-readout { display: flex; align-items: baseline; gap: 6px; }
.range-number {
  width: 70px; text-align: right; font-weight: 700; font-size: 1.1rem;
  border: none; background: transparent; color: var(--indigo-600);
  padding: 2px 4px; border-radius: 6px;
}
.range-number:focus { outline: none; background: var(--surface); box-shadow: 0 0 0 2px var(--indigo); }
.range-unit { font-size: 0.82rem; color: var(--muted); font-weight: 600; }

.range-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: var(--r-pill);
  background: var(--line);
  outline: none;
  margin: 6px 0;
  accent-color: var(--indigo);
}
.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface);
  border: 4px solid var(--indigo);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(20,26,46,0.2);
  transition: transform .12s ease;
}
.range-slider::-webkit-slider-thumb:hover { transform: scale(1.08); }
.range-slider::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); border: 4px solid var(--indigo); cursor: pointer;
}
.range-scale { display: flex; justify-content: space-between; font-size: 0.74rem; color: var(--muted); }

/* Stress selector */
.stress-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stress-card { position: relative; cursor: pointer; }
.stress-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.stress-body {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 22px 12px; border-radius: var(--r-md);
  border: 1.5px solid var(--line); background: var(--surface-tint);
  text-align: center;
  transition: border-color .16s ease, background .16s ease, transform .12s ease;
  position: relative;
}
.stress-body:hover { border-color: #CBD1E8; transform: translateY(-1px); }
.stress-check { position: absolute; top: 10px; right: 10px; width: 16px; height: 16px; color: var(--indigo-600); opacity: 0; }
.stress-name { font-weight: 700; font-size: 0.92rem; color: var(--ink); }

.meter { display: flex; gap: 4px; }
.meter i { width: 8px; height: 18px; border-radius: 3px; background: var(--line); display: block; }
.meter[data-level="1"] i:nth-child(1) { background: var(--ok); }
.meter[data-level="2"] i:nth-child(1),
.meter[data-level="2"] i:nth-child(2) { background: var(--warn); }
.meter[data-level="3"] i:nth-child(1),
.meter[data-level="3"] i:nth-child(2),
.meter[data-level="3"] i:nth-child(3) { background: #E08A45; }
.meter[data-level="4"] i { background: var(--bad); }

.stress-card input:checked + .stress-body {
  border-color: var(--indigo); background: #F4F2FE;
  box-shadow: 0 0 0 4px rgba(124,103,238,0.12);
}
.stress-card input:checked + .stress-body .stress-check { opacity: 1; }
.stress-card input:focus-visible + .stress-body { outline: 2.5px solid var(--indigo); outline-offset: 2px; }

/* Form nav */
.form-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 36px; padding-top: 26px; border-top: 1px solid var(--line-soft);
  gap: 14px;
}
.form-progress { font-size: 0.84rem; color: var(--muted); font-weight: 500; }
.btn-analyze { position: relative; }
.btn-spinner {
  display: none; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff;
  animation: spin-fast .7s linear infinite;
}
.btn-analyze.is-loading .btn-spinner { display: inline-block; }
.btn-analyze.is-loading .btn-label { opacity: 0.85; }
@keyframes spin-fast { to { transform: rotate(360deg); } }

/* Loading panel */
.loading-card {
  padding: 64px 32px; text-align: center; display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  animation: step-in .3s ease;
}
.loader { position: relative; width: 120px; height: 120px; margin-bottom: 10px; }
.loader svg { width: 100%; height: 100%; }
.loader-track { fill: none; stroke: var(--line-soft); stroke-width: 8; }
.loader-arc {
  fill: none; stroke: url(#loader-grad); stroke: var(--indigo);
  stroke-width: 8; stroke-linecap: round;
  stroke-dasharray: 314; stroke-dashoffset: 220;
  transform-origin: 60px 60px;
  animation: loader-spin 1.4s ease-in-out infinite;
}
@keyframes loader-spin {
  0% { transform: rotate(0deg); stroke-dashoffset: 260; }
  50% { transform: rotate(180deg); stroke-dashoffset: 60; }
  100% { transform: rotate(360deg); stroke-dashoffset: 260; }
}
.loader-core {
  position: absolute; inset: 0; margin: auto; width: 44px; height: 44px;
  border-radius: 50%; background: var(--grad-accent); display: grid; place-items: center;
  animation: pulse-core 1.8s ease-in-out infinite;
}
.loader-core .icon { width: 22px; height: 22px; color: #fff; }
@keyframes pulse-core { 0%, 100% { box-shadow: 0 0 0 0 rgba(124,103,238,0.35); } 50% { box-shadow: 0 0 0 12px rgba(124,103,238,0); } }

.loading-card h3 { font-family: var(--font-display); font-size: 1.2rem; margin-top: 6px; }
.loading-card p { color: var(--muted); font-size: 0.92rem; }

.progress { width: 220px; height: 5px; border-radius: var(--r-pill); background: var(--line-soft); overflow: hidden; margin-top: 14px; }
.progress span {
  display: block; height: 100%; width: 30%; border-radius: var(--r-pill);
  background: var(--grad-accent);
  animation: progress-slide 1.3s ease-in-out infinite;
}
@keyframes progress-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(330%); }
}

/* ==========================================================================
   Results
   ========================================================================== */

.results { animation: step-in .4s ease; }
.print-only { display: none; }

.score-card {
  padding: 44px; margin-top: 6px;
  display: grid; grid-template-columns: auto 1fr; gap: 44px; align-items: center;
}

.gauge { position: relative; width: 220px; height: 220px; flex-shrink: 0; }
.gauge svg { width: 100%; height: 100%; }
.gauge-track { fill: none; stroke: var(--line-soft); stroke-width: 14; }
.gauge-fill {
  fill: none; stroke: url(#gauge-grad); stroke-width: 14; stroke-linecap: round;
  stroke-dasharray: 578; stroke-dashoffset: 578;
  transition: stroke-dashoffset 1.1s cubic-bezier(.22,.9,.3,1);
}
.gauge-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
}
.gauge-value { font-family: var(--font-display); font-size: 2.6rem; font-weight: 600; color: var(--ink); line-height: 1; }
.gauge-max { font-size: 0.8rem; color: var(--muted); font-weight: 500; }

.band-badge {
  display: inline-block; padding: 5px 14px; border-radius: var(--r-pill);
  background: var(--cyan-soft); color: var(--indigo-600);
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em;
  margin-bottom: 12px;
}
.score-text { font-size: 1.02rem; color: var(--ink-soft); max-width: 48ch; }

.scale { margin-top: 22px; }
.scale-bar { display: flex; height: 8px; border-radius: var(--r-pill); overflow: visible; position: relative; background: var(--line-soft); }
.seg { display: block; height: 100%; }
.seg[data-band="lower"] { background: #D9DEF0; border-radius: var(--r-pill) 0 0 var(--r-pill); }
.seg[data-band="moderate"] { background: #A9B4E8; }
.seg[data-band="higher"] { background: var(--blue); }
.seg[data-band="very-high"] { background: var(--indigo); border-radius: 0 var(--r-pill) var(--r-pill) 0; }
.scale-marker {
  position: absolute; top: -5px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--ink); transform: translateX(-50%);
  left: 0%; transition: left 1.1s cubic-bezier(.22,.9,.3,1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.band-list { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.band-list li { font-size: 0.76rem; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.band-list li strong { color: var(--ink); font-size: 0.8rem; }
.band-list li[data-active="true"] strong { color: var(--indigo-600); }
.score-note { margin-top: 12px; font-size: 0.8rem; color: var(--warn); }

.summary-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
  margin-top: 24px;
}
.summary-card { padding: 24px; }
.summary-icon {
  width: 38px; height: 38px; border-radius: var(--r-sm);
  display: grid; place-items: center; background: var(--surface-tint); color: var(--indigo-600);
  margin-bottom: 14px;
}
.summary-card h3 { font-size: 0.84rem; font-weight: 700; color: var(--muted); text-transform: none; }
.summary-value { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; color: var(--ink); margin-top: 6px; }
.summary-meta { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
#sum-stress-meter { margin-top: 10px; }
#sum-stress-meter i { height: 8px; width: 20px; }

.result-actions { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }

/* ==========================================================================
   About
   ========================================================================== */

.about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.about-card { padding: 30px; }
.about-card h3 { font-family: var(--font-display); font-size: 1.08rem; font-weight: 600; margin-top: 16px; }
.about-card p { margin-top: 10px; color: var(--muted); font-size: 0.92rem; }
.about-card .summary-icon { background: var(--cyan-soft); }

.developer-card {
  margin-top: 22px;
  padding: 34px 38px;
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, var(--surface) 55%, var(--surface-tint));
}
.developer-eyebrow { font-size: 0.78rem; font-weight: 700; color: var(--indigo-600); letter-spacing: 0.01em; }
.developer-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; color: var(--ink); margin-top: 6px; }
.developer-title { font-size: 0.88rem; color: var(--muted); font-weight: 600; margin-top: 2px; }
.developer-bio { margin-top: 12px; color: var(--ink-soft); font-size: 0.95rem; max-width: 52ch; line-height: 1.6; }
.developer-contact { flex-shrink: 0; }
.developer-contact .icon { color: var(--indigo-600); }

[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
[data-reveal].in-view { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   Toasts
   ========================================================================== */

.toast-region {
  position: fixed; top: 20px; right: 20px; z-index: 300;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(380px, calc(100vw - 40px));
}
.toast {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 15px 16px; border-radius: var(--r-md);
  background: var(--navy-950); color: #fff;
  box-shadow: var(--shadow-lg);
  animation: toast-in .3s ease;
  border-left: 3px solid var(--bad);
}
.toast.toast-success { border-left-color: var(--ok); }
.toast .icon { width: 20px; height: 20px; margin-top: 1px; color: var(--bad); flex-shrink: 0; }
.toast.toast-success .icon { color: var(--ok); }
.toast-body strong { display: block; font-size: 0.9rem; margin-bottom: 3px; }
.toast-body p { font-size: 0.82rem; color: rgba(255,255,255,0.7); }
.toast-close { margin-left: auto; background: none; border: none; color: rgba(255,255,255,0.5); cursor: pointer; padding: 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
.toast.toast-out { animation: toast-out .25s ease forwards; }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer { background: var(--navy-950); color: rgba(255,255,255,0.6); padding: 36px 0; }
.footer-inner { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: space-between; }
.brand-footer { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 700; font-family: var(--font-display); }
.brand-footer .icon { width: 18px; height: 18px; color: var(--cyan); }
.footer-inner p { font-size: 0.84rem; max-width: 46ch; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { height: 300px; order: -1; }
  .about-grid { grid-template-columns: 1fr 1fr; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  :root { --header-h: 64px; }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 0 0;
    background: var(--navy-950);
    padding: 24px;
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
  }
  .site-nav.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .site-nav ul { flex-direction: column; gap: 4px; }
  .nav-link { display: block; padding: 14px 16px; font-size: 1.05rem; }
  .nav-toggle { display: inline-flex; }
  .status-pill span:not(.status-dot) { display: none; }
  .status-pill { padding: 8px; }

  .hero { padding: 48px 0 64px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }

  .section { padding: 56px 0; }
  .form-card { padding: 24px 18px; }
  .grid-2 { grid-template-columns: 1fr; }
  .stress-options { grid-template-columns: 1fr 1fr; }
  .stepper { overflow-x: auto; }
  .step-label { display: none; }

  .form-nav { flex-wrap: wrap; }
  .form-progress { order: 3; width: 100%; text-align: center; }
  #btn-back, #btn-next, #btn-submit { flex: 1; }

  .score-card { grid-template-columns: 1fr; text-align: center; padding: 30px 22px; }
  .gauge { margin-inline: auto; }
  .band-list { justify-content: flex-start; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .developer-card { flex-direction: column; align-items: flex-start; padding: 26px 22px; }
  .developer-contact { width: 100%; justify-content: center; }

  .result-actions { flex-direction: column; }
  .result-actions .btn { width: 100%; }

  .toast-region { left: 12px; right: 12px; max-width: none; }
}

@media (max-width: 420px) {
  .summary-grid { grid-template-columns: 1fr; }
  .stress-options { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================================
   Print
   ========================================================================== */

@media print {
  .site-header, .site-footer, .hero, #about, .form-nav, .result-actions, .toast-region, #assessment-flow { display: none !important; }
  .print-only { display: block; font-size: 0.85rem; color: #555; margin-bottom: 14px; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  .section { padding: 20px 0; }
}
