/* BridgeWell School Impact Calculator — direct port of the React/Tailwind
   codebase to vanilla CSS. Color tokens mirror src/index.css (HSL).
============================================================================ */

:root {
  --background: hsl(0 0% 100%);
  --foreground: hsl(144 26% 16%);
  --card: hsl(0 0% 100%);
  --card-fg: hsl(144 26% 16%);
  --primary: hsl(149 33% 14%);            /* #183025 forest */
  --primary-fg: hsl(83 53% 65%);          /* lime on dark */
  --secondary: hsl(28 92% 95%);           /* tan */
  --secondary-fg: hsl(149 33% 14%);
  --muted: hsl(76 60% 94%);
  --muted-fg: hsl(149 15% 35%);
  --accent: hsl(83 53% 65%);              /* #B1D675 lime */
  --accent-fg: hsl(149 33% 14%);
  --destructive: hsl(0 72% 50%);
  --destructive-fg: hsl(0 0% 100%);
  --positive: hsl(83 53% 45%);            /* deeper lime */
  --positive-fg: hsl(149 33% 14%);
  --warning: hsl(42 85% 65%);             /* amber */
  --warning-fg: hsl(149 33% 14%);
  --border: hsl(76 45% 84%);
  --border-soft: hsl(76 45% 90%);
  --input: hsl(76 45% 84%);
  --ring: hsl(83 53% 55%);
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 18px;
  --shadow-sm: 0 1px 2px rgba(24,48,37,.05), 0 1px 1px rgba(24,48,37,.04);
  --shadow-md: 0 4px 12px rgba(24,48,37,.08), 0 1px 2px rgba(24,48,37,.04);
  --shadow-lg: 0 12px 32px rgba(24,48,37,.12), 0 2px 4px rgba(24,48,37,.06);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--background);
  color: var(--foreground);
  font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}
h1,h2,h3,h4 { font-family: 'DM Sans', system-ui, sans-serif; letter-spacing: -.01em; margin: 0; }
button { font-family: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
.tabular { font-feature-settings: 'tnum' 1; font-variant-numeric: tabular-nums; }
.metric-glow { text-shadow: 0 0 30px hsl(149 33% 14% / .15); }

/* ============================================================================
   WIZARD
============================================================================ */
.wiz-root { min-height: 100vh; display: flex; flex-direction: column; background: var(--background); }
.wiz-progress {
  position: relative; width: 100%; height: 4px; background: var(--secondary);
}
.wiz-progress-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--primary);
  border-top-right-radius: 999px; border-bottom-right-radius: 999px;
  transition: width .4s cubic-bezier(.16,1,.3,1);
}
.wiz-skip {
  position: absolute; right: 18px; top: 14px;
  font-size: 12px; color: var(--muted-fg); background: transparent; border: 0;
  padding: 4px 8px;
  transition: color .18s;
}
.wiz-skip:hover { color: var(--foreground); }

.wiz-stage {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 32px 16px;
}
.wiz-card {
  width: 100%; max-width: 520px;
  display: flex; flex-direction: column; align-items: center;
}
.wiz-slide { width: 100%; }
.wiz-slide-enter { animation: wiz-slide-in .3s cubic-bezier(.16,1,.3,1) both; }
.wiz-slide-enter-back { animation: wiz-slide-in-back .3s cubic-bezier(.16,1,.3,1) both; }
@keyframes wiz-slide-in {
  from { opacity: 0; transform: translateX(80px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes wiz-slide-in-back {
  from { opacity: 0; transform: translateX(-80px); }
  to   { opacity: 1; transform: translateX(0); }
}

.wiz-icon-tile {
  width: 56px; height: 56px; border-radius: var(--radius-lg);
  background: hsl(149 33% 14% / .10);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
}
.wiz-icon-tile svg { width: 28px; height: 28px; color: var(--primary); }

.wiz-text { text-align: center; margin-bottom: 32px; }
.wiz-text h2 {
  font-size: clamp(22px, 2.6vw, 30px); font-weight: 700; color: var(--foreground);
  line-height: 1.18; margin: 0 0 12px; letter-spacing: -.015em;
}
.wiz-text p { color: var(--muted-fg); font-size: 16px; max-width: 420px; margin: 0 auto; }

.wiz-input-wrap { max-width: 280px; margin: 0 auto 32px; }

.wiz-num-input {
  width: 100%; height: 64px;
  background: hsl(28 92% 95% / .5); border: 1px solid var(--border-soft);
  border-radius: 999px;
  text-align: center; font-family: inherit;
  font-size: 30px; font-weight: 700; color: var(--foreground);
  font-feature-settings: 'tnum' 1; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.wiz-num-input:focus { border-color: var(--ring); box-shadow: 0 0 0 3px hsl(83 53% 55% / .15); }
.wiz-num-input::-webkit-outer-spin-button, .wiz-num-input::-webkit-inner-spin-button { margin: 0; }

.wiz-slider-value { text-align: center; }
.wiz-slider-value span {
  font-size: 48px; font-weight: 700; color: var(--primary);
  font-feature-settings: 'tnum' 1; letter-spacing: -.025em;
}
.wiz-slider-wrap { display: flex; flex-direction: column; gap: 18px; }
.wiz-slider-bounds { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted-fg); }

.wiz-radio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.wiz-radio-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 16px; border-radius: 999px;
  border: 2px solid var(--border-soft); background: hsl(28 92% 95% / .5);
  font-family: inherit; cursor: pointer;
  transition: background .18s, border-color .18s;
}
.wiz-radio-card:hover { background: var(--secondary); }
.wiz-radio-card.is-active {
  border-color: var(--primary); background: hsl(149 33% 14% / .10);
  box-shadow: var(--shadow-sm);
}
.wiz-radio-num { font-size: 28px; font-weight: 700; color: var(--foreground); letter-spacing: -.015em; }
.wiz-radio-lbl { font-size: 13px; color: var(--muted-fg); font-weight: 500; }

.wiz-teaser {
  max-width: 280px; margin: 0 auto 32px;
  padding: 14px 16px; border-radius: var(--radius);
  background: hsl(83 53% 45% / .08); border: 1px solid hsl(83 53% 45% / .15);
  text-align: center;
  animation: wiz-teaser-in .35s cubic-bezier(.16,1,.3,1) .2s both;
}
@keyframes wiz-teaser-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.wiz-teaser-lbl { font-size: 11px; color: var(--muted-fg); margin: 0 0 4px; }
.wiz-teaser-val {
  font-size: 24px; font-weight: 700; color: var(--positive);
  font-feature-settings: 'tnum' 1; margin: 0;
}

.wiz-nav { max-width: 280px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wiz-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 500; font-family: inherit;
  background: transparent; border: 0; color: var(--muted-fg);
  transition: background .15s, color .15s, transform .15s;
}
.wiz-btn:disabled { opacity: .4; cursor: not-allowed; }
.wiz-btn-ghost:hover:not(:disabled) { background: hsl(149 33% 14% / .05); color: var(--foreground); }
.wiz-btn-primary { background: var(--primary); color: var(--primary-fg); }
.wiz-btn-primary:hover:not(:disabled) { background: hsl(149 33% 14% / .9); }
.wiz-btn svg { width: 16px; height: 16px; }

.wiz-dots { display: flex; gap: 6px; }
.wiz-dot {
  height: 6px; border-radius: 999px;
  transition: width .25s, background .25s;
  background: var(--border);
  width: 6px;
}
.wiz-dot.is-current { width: 24px; background: var(--primary); }
.wiz-dot.is-done { width: 6px; background: hsl(149 33% 14% / .4); }

/* ============================================================================
   DASHBOARD
============================================================================ */
.dash-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--primary); color: var(--primary-fg);
  border-bottom: 2px solid hsl(83 53% 65% / .4);
}
.dash-header-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 32px;
  height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.dash-brand { display: flex; align-items: center; gap: 12px; }
.dash-brand-icon {
  width: 36px; height: 36px; border-radius: var(--radius);
  background: var(--accent); color: var(--accent-fg);
  display: flex; align-items: center; justify-content: center;
}
.dash-brand-icon svg { width: 20px; height: 20px; }
.dash-brand-mark { width: 32px; height: auto; display: block; flex: 0 0 32px; }
.dash-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.dash-brand-name { font-size: 18px; font-weight: 700; color: var(--accent); letter-spacing: -.015em; }
.dash-brand-sub { font-size: 12px; color: hsl(83 53% 65% / .7); }
.dash-reset {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 9px 16px; border-radius: 999px;
  background: transparent; border: 0; font-family: inherit;
  font-size: 14px; font-weight: 500; color: var(--accent);
  transition: background .15s;
}
.dash-reset:hover { background: hsl(83 53% 65% / .1); }
.dash-reset svg { width: 16px; height: 16px; }

.dash-main {
  max-width: 1280px; margin: 0 auto; padding: 32px;
  display: grid; grid-template-columns: 1fr; gap: 32px;
  animation: dash-in .5s cubic-bezier(.16,1,.3,1) both;
}
@keyframes dash-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@media (min-width: 860px) {
  .dash-main { grid-template-columns: minmax(280px, 4fr) minmax(0, 8fr); }
}
@media (min-width: 1200px) {
  .dash-main { grid-template-columns: minmax(280px, 3fr) minmax(0, 9fr); }
}

.dash-aside-inner {
  background: var(--card); border: 1px solid hsl(76 45% 84% / .6);
  border-radius: var(--radius-xl); padding: 24px;
  box-shadow: var(--shadow-sm);
}
@media (min-width: 860px) {
  .dash-aside-inner { position: sticky; top: 96px; }
}
.dash-cards {
  display: grid; grid-template-columns: 1fr; gap: 24px;
}
@media (min-width: 1200px) {
  .dash-cards { grid-template-columns: 1fr 1fr; }
}
.dash-card-wide { grid-column: 1 / -1; }

/* ============================================================================
   INPUT PANEL (sidebar)
============================================================================ */
.ip-head h2 { font-size: 18px; font-weight: 600; color: var(--foreground); margin: 0 0 4px; }
.ip-head p { font-size: 13px; color: var(--muted-fg); margin: 0; }
.ip-fields { display: flex; flex-direction: column; gap: 20px; margin-top: 24px; }
.ip-field { display: flex; flex-direction: column; gap: 8px; }
.ip-field-head { display: flex; align-items: center; gap: 8px; }
.ip-icon-tile {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--secondary);
  display: flex; align-items: center; justify-content: center; flex: 0 0 32px;
}
.ip-icon-tile svg { width: 16px; height: 16px; color: var(--primary); }
.ip-label {
  font-size: 13px; font-weight: 500; color: var(--foreground); white-space: nowrap;
}
.ip-label-block { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ip-label-sub { font-size: 11px; color: var(--muted-fg); line-height: 1.3; }
.ip-value { font-size: 13px; font-weight: 600; color: var(--primary); font-feature-settings: 'tnum' 1; white-space: nowrap; }
.ip-num {
  width: 100%; height: 42px; padding: 0 18px;
  background: hsl(28 92% 95% / .5); border: 1px solid hsl(76 45% 84% / .6);
  border-radius: 999px; font-family: inherit;
  font-size: 15px; font-weight: 500; color: var(--foreground);
  font-feature-settings: 'tnum' 1; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.ip-num:focus { border-color: var(--ring); box-shadow: 0 0 0 3px hsl(83 53% 55% / .15); }
.ip-radio { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ip-radio-card {
  display: flex; align-items: center; justify-content: center;
  padding: 11px; border-radius: 999px;
  border: 1px solid hsl(76 45% 84% / .6); background: hsl(28 92% 95% / .5);
  font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--muted-fg); cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.ip-radio-card:hover { background: var(--secondary); }
.ip-radio-card.is-active { border-color: var(--primary); background: hsl(149 33% 14% / .1); color: var(--foreground); }

/* Slider — used in wizard + input panel */
.bw-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 6px; outline: none;
  background: linear-gradient(90deg, var(--primary) var(--pct, 50%), var(--secondary) var(--pct, 50%));
  cursor: pointer;
}
.bw-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--background); border: 2px solid var(--primary);
  box-shadow: var(--shadow-sm); cursor: pointer;
}
.bw-slider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--background); border: 2px solid var(--primary);
  box-shadow: var(--shadow-sm); cursor: pointer;
}
.bw-slider.lg { height: 8px; border-radius: 8px; }
.bw-slider.lg::-webkit-slider-thumb { width: 22px; height: 22px; border-width: 3px; }
.bw-slider.lg::-moz-range-thumb { width: 22px; height: 22px; border-width: 3px; }

/* ============================================================================
   CARDS — shared
============================================================================ */
.card {
  background: var(--card); color: var(--card-fg);
  border: 1px solid hsl(76 45% 84% / .6);
  border-radius: var(--radius-xl); padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s, box-shadow .25s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.card-icon {
  width: 40px; height: 40px; border-radius: var(--radius);
  background: hsl(149 33% 14% / .1); color: var(--primary);
  display: flex; align-items: center; justify-content: center; flex: 0 0 40px;
}
.card-icon svg { width: 20px; height: 20px; }
.card-icon.positive { background: hsl(83 53% 45% / .12); color: var(--positive); }
.card-icon.neutral { background: var(--secondary); color: var(--muted-fg); }
.card-title { font-size: 16px; font-weight: 600; color: var(--foreground); margin: 0; }
.card-sub { font-size: 12px; color: var(--muted-fg); margin: 2px 0 0; }

.card-rule { height: 1px; background: hsl(76 45% 84% / .6); margin: 20px 0; }

/* ============================================================================
   FINANCIAL CARD
============================================================================ */
.fin-amount {
  font-size: clamp(40px, 4.2vw, 52px); font-weight: 700; color: var(--positive);
  font-feature-settings: 'tnum' 1; line-height: 1; letter-spacing: -.025em;
}
.fin-amount-sub { font-size: 14px; color: var(--muted-fg); margin: 6px 0 0; }

.fin-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fin-cell {
  padding: 14px; border-radius: var(--radius);
  background: hsl(28 92% 95% / .6);
}
.fin-cell-lbl { font-size: 11px; color: var(--muted-fg); margin: 0 0 4px; }
.fin-cell-val {
  font-size: 22px; font-weight: 700; color: var(--foreground);
  font-feature-settings: 'tnum' 1; line-height: 1.1; margin: 0;
}
.fin-cell-val.muted { color: var(--muted-fg); }
.fin-cell-detail { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.fin-cell-detail-row { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted-fg); }
.fin-cell-foot { font-size: 11px; color: var(--muted-fg); margin: 8px 0 0; }

.fin-bars { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.fin-bar-row { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.fin-bar-label { width: 130px; flex: 0 0 130px; color: var(--muted-fg); }
.fin-bar-track { flex: 1; height: 28px; background: hsl(76 45% 84% / .3); border-radius: 6px; overflow: hidden; }
.fin-bar-fill {
  height: 100%; border-radius: 0 6px 6px 0;
  transition: width .5s cubic-bezier(.16,1,.3,1);
  display: flex; align-items: center; justify-content: flex-end; padding-right: 8px;
  font-size: 11px; font-weight: 600; color: var(--background);
  white-space: nowrap;
}
.fin-bar-fill.positive { background: var(--positive); }
.fin-bar-fill.muted { background: hsl(149 15% 35% / .35); color: var(--foreground); }

.fin-roi { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.fin-roi-cell {
  padding: 12px; border-radius: var(--radius);
  background: hsl(83 53% 45% / .08); border: 1px solid hsl(83 53% 45% / .15);
}
.fin-roi-eyebrow { font-size: 11px; color: var(--muted-fg); margin: 0 0 4px; }
.fin-roi-lbl { font-size: 11px; color: var(--muted-fg); margin: 0; }
.fin-roi-val {
  font-size: 18px; font-weight: 700; color: var(--foreground);
  font-feature-settings: 'tnum' 1; margin: 0;
}
.fin-roi-net {
  font-size: 12px; font-weight: 600; margin: 6px 0 0;
  font-feature-settings: 'tnum' 1;
}
.fin-roi-net.positive { color: var(--positive); }
.fin-roi-net.negative { color: var(--destructive); }

.fin-callout {
  display: flex; align-items: center; gap: 10px;
  padding: 14px; border-radius: var(--radius);
  background: hsl(83 53% 45% / .1); color: var(--positive);
}
.fin-callout svg { width: 18px; height: 18px; flex: 0 0 18px; }
.fin-callout p { font-size: 14px; font-weight: 600; margin: 0; }

/* ============================================================================
   OPERATIONAL CARD
============================================================================ */
.op-big {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 24px;
}
.op-big-num {
  font-size: clamp(40px, 4.2vw, 52px); font-weight: 700; color: var(--foreground);
  font-feature-settings: 'tnum' 1; line-height: 1; letter-spacing: -.025em;
}
.op-big-unit { font-size: 22px; color: var(--muted-fg); font-weight: 500; }

.op-rows { display: flex; flex-direction: column; gap: 14px; font-size: 14px; }
.op-row { display: flex; justify-content: space-between; }
.op-row-lbl { color: var(--muted-fg); }
.op-row-val { color: var(--foreground); font-weight: 600; font-feature-settings: 'tnum' 1; }

/* ============================================================================
   CLINICAL CARD
============================================================================ */
.cl-rows { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.cl-row { display: flex; align-items: center; justify-content: space-between; }
.cl-row-l { display: flex; align-items: center; gap: 10px; }
.cl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex: 0 0 8px; }
.cl-dot.crit { background: var(--destructive); }
.cl-row-lbl { font-size: 14px; color: var(--muted-fg); }
.cl-row-r { display: flex; align-items: center; gap: 8px; }
.cl-row-val { font-size: 19px; font-weight: 600; color: var(--foreground); font-feature-settings: 'tnum' 1; }
.cl-row-val.crit { color: var(--destructive); }
.cl-row-pct { font-size: 12px; color: var(--muted-fg); }

.cl-crisis {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px; border-radius: var(--radius);
  background: hsl(0 72% 50% / .08); border: 1px solid hsl(0 72% 50% / .15);
}
.cl-crisis svg { width: 18px; height: 18px; color: var(--destructive); margin-top: 1px; flex: 0 0 18px; }
.cl-crisis-lbl { font-size: 14px; font-weight: 500; color: var(--foreground); margin: 0; }
.cl-crisis-val {
  font-size: 22px; font-weight: 700; color: var(--foreground);
  font-feature-settings: 'tnum' 1; margin: 4px 0 0;
}

/* ============================================================================
   CONTACT CARD
============================================================================ */
.contact-card {
  background: var(--primary); color: var(--primary-fg);
  border: 0;
  padding: 32px;
  position: relative; overflow: hidden;
}
.contact-card:hover { transform: none; }
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: center; }
@media (min-width: 720px) {
  .contact-card { padding: 36px 40px; }
  .contact-grid { grid-template-columns: minmax(0, 1.4fr) auto; }
}
.contact-eyebrow {
  font-size: 11px; text-transform: uppercase; letter-spacing: .2em;
  color: var(--accent); font-weight: 600; margin: 0 0 12px;
}
.contact-title {
  font-size: clamp(22px, 2.4vw, 28px); font-weight: 700; color: var(--accent);
  line-height: 1.15; letter-spacing: -.015em; margin: 0 0 12px;
}
.contact-body {
  color: hsl(83 53% 65% / .8); font-size: 16px; line-height: 1.55;
  max-width: 46ch; margin: 0;
}
.contact-actions { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
@media (min-width: 720px) { .contact-actions { align-items: flex-end; } }
.contact-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 24px; border-radius: 999px;
  background: var(--accent); color: var(--accent-fg);
  font-weight: 600; font-size: 14.5px;
  transition: background .15s;
  white-space: nowrap;
}
.contact-btn:hover { background: hsl(83 53% 60%); }
.contact-btn svg { width: 16px; height: 16px; }

/* ============================================================================
   Responsive nudges
============================================================================ */
@media (max-width: 720px) {
  .wiz-text h2 { font-size: 22px; }
  .fin-pair, .fin-roi { grid-template-columns: 1fr; }
  .dash-main { padding: 24px 16px; }
  .dash-header-inner { padding: 0 16px; }
}
