/* ============================================================
   Pearce. Plan Finder
   Mobile-first. Muted cool palette, one deep green accent.
   ============================================================ */

:root {
  --bg: #F2F4F1;
  --surface: #FFFFFF;
  --ink: #181D1A;
  --muted: #5A6660;
  --line: #DCE2DD;
  --accent: #155B3F;
  --accent-deep: #0E4530;
  --accent-soft: #E2EFE7;
  --warn: #8A6116;
  --warn-soft: #F6EEDC;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(24, 29, 26, 0.05), 0 8px 28px rgba(24, 29, 26, 0.07);
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
}

/* ---------- Header / progress ---------- */

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 18px 20px 14px;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
}

.wordmark {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}

.wordmark .dot { color: var(--accent); }

.header-tag {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}

.progress-track {
  height: 3px;
  background: var(--line);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 320ms ease;
}

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

main {
  flex: 1;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

.site-footer {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 20px 32px;
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer a { color: var(--accent); font-weight: 600; text-decoration: none; }
.site-footer a:hover, .site-footer a:focus-visible { text-decoration: underline; }

/* ---------- Steps ---------- */

.step {
  animation: stepIn 360ms ease both;
}

@keyframes stepIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-count {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent);
  margin: 0 0 10px;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--accent);
  margin: 0 0 14px;
}

.display {
  font-size: clamp(1.9rem, 6.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.08;
  margin: 0 0 16px;
}

.lede {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 46ch;
}

.fine-print {
  margin-top: 18px;
  font-size: 0.85rem;
  color: var(--muted);
}

.step-title {
  font-size: clamp(1.45rem, 5.5vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 18px;
}

.step-sub {
  margin: -8px 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Fields ---------- */

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 7px;
}

.field .optional {
  font-weight: 500;
  color: var(--muted);
  font-size: 0.8rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
  transition: border-color 150ms ease;
}

textarea { resize: vertical; min-height: 110px; }

input:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

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

fieldset.choice-group {
  border: 0;
  padding: 0;
  margin: 0 0 18px;
  display: grid;
  gap: 10px;
}

.group-label {
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0;
  margin-bottom: 4px;
}

.choice-card {
  display: block;
  position: relative;
  cursor: pointer;
}

.choice-card input,
.choice-pill input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.choice-card span {
  display: block;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-weight: 500;
  transition: border-color 150ms ease, background 150ms ease;
}

.choice-card span small {
  display: block;
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}

.choice-card:hover span { border-color: #B9C6BE; }

.choice-card input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.choice-card input:focus-visible + span {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.choice-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.choice-pill {
  display: block;
  position: relative;
  cursor: pointer;
}

.choice-pill span {
  display: block;
  text-align: center;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 13px 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: border-color 150ms ease, background 150ms ease;
}

.choice-pill input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.choice-pill input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--accent-soft);
  border-color: var(--accent);
}

/* Checkbox variant reuses choice-card styling via the same classes */

/* ---------- Lift inputs (strength follow-up) ---------- */

.lift-detail {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px 16px;
  margin: 10px 0 14px;
}

.lift-detail h3 {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 700;
}

.lift-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.lift-grid .field { margin-bottom: 0; }

.range-field output {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  margin-top: 6px;
}

input[type="range"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* ---------- Hints / validation ---------- */

.hint {
  min-height: 1.4em;
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--warn);
  font-weight: 500;
}

/* ---------- Buttons / nav ---------- */

.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 999px;
  padding: 14px 26px;
  cursor: pointer;
  transition: background 150ms ease, transform 80ms ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-deep); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover { color: var(--ink); }

.btn-secondary {
  background: var(--surface);
  color: var(--accent);
  border: 1.5px solid var(--accent);
}

.btn-secondary:hover { background: var(--accent-soft); }

.btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.step-nav {
  position: sticky;
  bottom: 0;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 12px 20px calc(14px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}

.step-nav .btn-primary { flex: 1; max-width: 320px; }

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

.results-greeting {
  font-size: clamp(1.6rem, 6vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin: 0 0 22px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  margin-bottom: 16px;
}

.card-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0 0 10px;
}

/* Timeline card: the signature element */

.timeline-card {
  background: var(--accent-deep);
  color: #fff;
}

.timeline-card .card-label { color: #9FD4BB; }

.timeline-headline {
  font-size: clamp(1.35rem, 5.5vw, 1.7rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0 0 8px;
}

.timeline-copy {
  font-size: 0.95rem;
  color: #D4E6DC;
  margin: 0;
}

.timeline-copy + .timeline-copy { margin-top: 10px; }

.range-bar {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.16);
  margin: 18px 0 6px;
}

.range-bar .range-span {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 4px;
  background: #5FBE8F;
}

.range-bar .range-marker {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #B9D8C7;
  margin-bottom: 4px;
}

.lift-timeline {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 12px;
  margin-top: 12px;
}

.lift-timeline:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }

.lift-timeline strong { display: block; margin-bottom: 2px; }

/* Plan card */

.plan-name {
  font-size: clamp(1.5rem, 6vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.plan-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 4px 10px;
}

.plan-price {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin: 8px 0 2px;
}

.plan-meta {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0 0 14px;
  font-variant-numeric: tabular-nums;
}

.plan-why { margin: 0; font-size: 0.97rem; }

.addon-note {
  margin: 14px 0 0;
  padding: 12px 14px;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

/* Notes */

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

.notes-list li {
  padding: 10px 0 10px 26px;
  position: relative;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}

.notes-list li:last-child { border-bottom: 0; padding-bottom: 0; }

.notes-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 17px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

/* Next steps + CTAs */

.next-copy { margin: 0 0 18px; font-size: 0.97rem; }

.cta-stack {
  display: grid;
  gap: 10px;
}

.cta-stack .btn { width: 100%; }

.results-fallback {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 20px;
}

.results-fallback a { color: var(--accent); font-weight: 600; text-decoration: none; }
.results-fallback a:hover { text-decoration: underline; }

.flag-note {
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.88rem;
  margin-top: 12px;
}

.timeline-card .flag-note {
  background: rgba(255, 255, 255, 0.12);
  color: #F2E3BC;
}

/* ---------- Utilities ---------- */

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

/* ---------- Larger screens ---------- */

@media (min-width: 560px) {
  .lift-grid { grid-template-columns: 1fr 1fr; }
  .cta-stack { grid-template-columns: 1fr 1fr; }
  .cta-stack .btn-tertiary-slot { grid-column: 1 / -1; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .step { animation: none; }
  .progress-fill { transition: none; }
  .btn:active { transform: none; }
}
