/* CleverConsult Time-Savings Calculator — brand tokens from
   docs/superpowers/specs/2026-07-14-time-savings-calculator-design.md */

:root {
  --bg: #b6e3f0;
  --card: #ffffff;
  --teal-deep: #115959;
  --teal-deeper: #0a3d3d;
  --teal-bright: #009895;
  --yellow: #f4dc62;
  --text: #09090b;
  --text-soft: #444444;
  --text-muted: #767676;
  --line: #f0f0f0;
  --control-line: #d4d4d4;
  --track: #e4e4e4;
  --shadow: 0 2px 10px rgba(17, 89, 89, 0.1);
  --font-heading: "Kumbh Sans", sans-serif;
  --font-mono: "Roboto Mono", monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-heading);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Navbar: floating white pill, logo only ---------- */

.navbar-wrap { padding: 20px 20px 0; }

.navbar {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  max-width: 880px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 6px rgba(17, 89, 89, 0.08);
}

.navbar a { display: inline-flex; }

.logo { height: 20px; width: auto; display: block; }

/* ---------- Headline ---------- */

.headline { text-align: center; padding: 44px 20px 28px; }

.headline h1 {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0;
}

.tagline {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--teal-deep);
  margin: 10px 0 0;
}

/* ---------- Layout ---------- */

.calculator {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px 48px;
}

.form-card { flex: 1.15; }

.results-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 20px;
}

.card {
  background: var(--card);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.card-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--teal-deep);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 18px;
}

/* ---------- Form fields ---------- */

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 14px;
  color: var(--text-soft);
  margin-bottom: 6px;
}

.label-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.label-row label { margin-bottom: 0; }

.unit { color: var(--text-muted); font-size: 12px; }

.controls { display: flex; align-items: center; gap: 12px; }

input[type="range"] {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  height: 5px;
  border-radius: 3px;
  background: var(--track);
  outline-offset: 4px;
  margin: 0;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--teal-deep);
  border: none;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--teal-deep);
  border: none;
  cursor: pointer;
}

input[type="range"]::-moz-range-progress {
  background: var(--teal-bright);
  height: 5px;
  border-radius: 3px;
}

input[type="number"] {
  font-family: var(--font-mono);
  font-size: 14px;
  width: 72px;
  text-align: center;
  padding: 6px 4px;
  border: 1px solid var(--control-line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

input[type="number"]:focus,
input[type="range"]:focus-visible {
  outline: 2px solid var(--teal-bright);
}

.divider { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* ---------- Tooltip (hover AND keyboard focus) ---------- */

.tooltip { position: relative; display: inline-block; }

.tooltip-trigger {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 1px solid #767676;
  border-radius: 50%;
  background: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1;
  cursor: help;
  vertical-align: 1px;
}

.tooltip-bubble {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: 260px;
  background: var(--teal-deeper);
  color: #ffffff;
  font-size: 12px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 8px;
  z-index: 10;
}

/* Invisible pseudo-element that fills the 8px gap between the bubble and
   the trigger below it. It's generated content on .tooltip-bubble, so
   hovering it keeps .tooltip-bubble (and .tooltip) in :hover state — the
   pointer path from trigger to bubble never leaves a hovered element,
   closing the WCAG 1.4.13 "hoverable" gap without changing the bubble's
   own visible box (padding/border-radius untouched). */
.tooltip-bubble::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 8px;
}

.tooltip:hover .tooltip-bubble,
.tooltip-trigger:focus-visible + .tooltip-bubble,
.tooltip.tooltip-open .tooltip-bubble {
  display: block;
}

/* Escape-dismissal for the keyboard :focus-visible reveal: Escape can't
   blur the trigger or clear :focus-visible, so app.js instead stamps
   `suppressed` on the container, which overrides every reveal rule above
   until focus leaves the trigger (focusout removes it — Tabbing away and
   back shows the bubble again). WCAG 1.4.13 "dismissible". */
.tooltip.suppressed .tooltip-bubble {
  display: none !important;
}

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

/* ---------- Group toggle ---------- */

.group-block { margin-top: 4px; }

.switch {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-soft);
  cursor: pointer;
  margin-bottom: 12px;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 34px;
  height: 20px;
  margin: 0;
  cursor: pointer;
}

.switch .track {
  width: 34px;
  height: 20px;
  background: var(--track);
  /* Darkening --track itself would fight the F2 teal slider-fill gradient
     that also reads --track, so the off-state boundary is carried by this
     border instead (checked state relies on the teal fill for contrast). */
  border: 1px solid #767676;
  border-radius: 11px;
  position: relative;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.switch .track::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}

.switch input:checked + .track { background: var(--teal-bright); border-color: var(--teal-bright); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--teal-bright); outline-offset: 2px; }

/* ---------- Receipt card ---------- */

.receipt { list-style: none; margin: 0; padding: 0; }

.receipt li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--text-soft);
}

.receipt li:last-child { border-bottom: none; }

.times { font-family: var(--font-mono); font-size: 13px; white-space: nowrap; }

.times s { color: #767676; }

.arrow { color: var(--teal-bright); }

.times strong { color: var(--teal-deep); }

.receipt-note {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  margin: 12px 0 0;
}

/* ---------- Results card ---------- */

.results-card {
  background: linear-gradient(135deg, var(--teal-deep), var(--teal-deeper));
  color: #ffffff;
  text-align: center;
  box-shadow: 0 2px 10px rgba(17, 89, 89, 0.25);
}

.results-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.75;
  margin: 0 0 12px;
}

.hours { font-size: 38px; font-weight: 800; line-height: 1; margin: 0; }

.per {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.8;
  margin: 5px 0 14px;
}

.dollars { font-size: 24px; font-weight: 700; margin: 0; }

.group-note { margin-top: -8px; }

.cta {
  display: block;
  background: var(--yellow);
  color: var(--text);
  border-radius: 10px;
  padding: 13px 0;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  margin-top: 4px;
}

.cta:hover { filter: brightness(0.96); }

/* ---------- Fine print + footer ---------- */

.fine-print {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--teal-deep);
  line-height: 1.6;
  margin: 0;
  padding: 0 4px;
}

.footer {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--teal-deep);
  padding: 0 20px 32px;
}

.footer a { color: inherit; }

/* ---------- Mobile ---------- */

@media (max-width: 720px) {
  .calculator { flex-direction: column; }
  .form-card, .results-col { width: 100%; flex: none; }
  .results-col { position: static; }
  .headline { padding-top: 32px; }
}
