/* Recomp Revolution - TDEE + macro calculator
   Light, clean, precise. Same palette and type as the marketing site
   (near-black on white, one wine accent) - this should read as trustworthy
   and on-brand, not like a generic form. */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f4f2;
  --ink: #171716;
  --ink-soft: #6a6862;
  --accent: #a82d3b;
  --accent-hover: #8b2530;
  --accent-bright: #d24455;
  --accent-soft: #f6e3e5;
  --border: #e6e4e0;
  --radius: 4px;
  --radius-lg: 8px;

  --font: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --maxw: 32rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.modal-open { overflow: hidden; }

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

.frame {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding: clamp(1.6rem, 6vw, 2.6rem) clamp(1.35rem, 6vw, 2rem) 2.2rem;
  animation: fade 0.35s ease both;
}
.step[hidden] { display: none; }
.step--center {
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 1.4rem;
}
.step--question {
  justify-content: flex-start;
  gap: 1.1rem;
  padding-top: clamp(1.1rem, 4vw, 1.7rem);
}
@keyframes fade {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ── Type ────────────────────────────────────────────────────────────── */
.logo { width: min(52vw, 190px); height: auto; color: var(--ink); }
.logo--sm { width: 130px; }

.h1 {
  font-size: clamp(1.5rem, 6vw, 1.9rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.018em;
  text-wrap: balance;
}
.lede {
  font-size: 1.08rem;
  color: var(--ink-soft);
  text-wrap: balance;
  max-width: 30rem;
}
.eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
}
.fineprint {
  font-size: 0.82rem;
  color: var(--ink-soft);
  max-width: 30rem;
}
.fineprint--tiny {
  font-size: 0.72rem;
}
.teaser-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.teaser-nudge {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
}

/* ── Progress ────────────────────────────────────────────────────────── */
.qnum {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.progress {
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.question {
  font-size: clamp(1.35rem, 5.5vw, 1.65rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
  text-wrap: balance;
}
.question__hint {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* ── Fields ──────────────────────────────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
}
.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.field input[type='text'],
.field input[type='email'],
.field input[type='tel'],
.field input[type='number'] {
  font: inherit;
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem;
  width: 100%;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
}
.field-row {
  display: flex;
  gap: 0.7rem;
}
.field-row .field { flex: 1; }

.unit-toggle {
  display: inline-flex;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  align-self: flex-start;
}
.unit-toggle button {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--bg);
  border: none;
  padding: 0.45rem 0.9rem;
  cursor: pointer;
}
.unit-toggle button.is-active {
  background: var(--ink);
  color: #fff;
}

.chip-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.chip {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
  flex-direction: column;
  text-align: left;
  font: inherit;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
  cursor: pointer;
  width: 100%;
}
.chip strong { font-size: 1rem; font-weight: 600; }
.chip span { font-size: 0.85rem; color: var(--ink-soft); }
.chip.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.chip.is-active strong { color: var(--accent); }

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  align-self: flex-start;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.3rem;
}
.stepper button {
  width: 2.2rem;
  height: 2.2rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg-alt);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
}
.stepper output {
  min-width: 2.5rem;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 600;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  text-align: left;
  font-size: 0.92rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.consent input { margin-top: 0.2rem; flex-shrink: 0; }
.consent-link {
  font: inherit;
  color: var(--ink);
  text-decoration: underline;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.consent-link:hover { color: var(--accent); }

/* ── Terms modal ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(23, 23, 22, 0.6);
}
.modal-panel {
  position: relative;
  width: 100%;
  max-width: 26rem;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  text-align: left;
}
.modal-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  color: var(--ink);
  border: none;
  border-radius: 50%;
  cursor: pointer;
}
.modal-close:hover { background: var(--border); }
.modal-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 1.6rem 0.9rem 0;
}
.modal-text {
  font-size: 0.9rem;
  color: var(--ink-soft);
  line-height: 1.6;
}
.modal-text + .modal-text { margin-top: 0.8rem; }
.modal-text a { color: var(--ink); }
.modal-text a:hover { color: var(--accent); }
.modal-panel .chip-group { margin-top: 1.1rem; }
.modal-panel > .btn--ghost { display: block; margin: 0.8rem auto 0; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.actions {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  width: 100%;
}
[data-step="welcome"] .actions { margin-top: 0.8rem; }
.cta .actions { margin-top: 1.1rem; }
.btn {
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius);
  padding: 0.95rem 1.4rem;
  border: none;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: scale(0.97); }
.btn--primary {
  background: var(--ink);
  color: #fff;
}
.btn--primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn--primary:not(:disabled):hover { background: #2b2a28; }
.btn--accent {
  background: var(--accent);
  color: #fff;
}
.btn--accent:hover { background: var(--accent-hover); }
.btn--ghost {
  background: none;
  color: var(--ink-soft);
  padding: 0.6rem 1rem;
}
.btn--ghost:hover { color: var(--ink); }
.btn--back { align-self: center; }

/* ── Calculating ─────────────────────────────────────────────────────── */
.pulse-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* ── Teaser / results numbers ────────────────────────────────────────── */
.stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1.6rem;
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  width: 100%;
}
.stat__value {
  font-size: clamp(2.4rem, 12vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--accent);
  line-height: 1;
}
.stat__value.is-revealing { animation: value-pop 0.5s ease; }
@keyframes value-pop {
  0% { transform: scale(0.85); }
  60% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
.stat__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.stat--sm {
  padding: 1.1rem 1.4rem;
}
.stat__value--sm {
  font-size: clamp(1.3rem, 5vw, 1.6rem);
  color: var(--ink);
}

.macro-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  width: 100%;
}
.macro-card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 0.9rem 0.6rem;
  text-align: center;
  opacity: 0;
  animation: macro-card-in 0.4s ease forwards;
}
.macro-card:nth-child(1) { animation-delay: 0.05s; }
.macro-card:nth-child(2) { animation-delay: 0.15s; }
.macro-card:nth-child(3) { animation-delay: 0.25s; }
@keyframes macro-card-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.macro-card__value {
  font-size: 1.35rem;
  font-weight: 600;
}
.macro-card__label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.1rem;
}

/* ── Steps what-if slider ────────────────────────────────────────────── */
.slider-block {
  width: 100%;
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.4rem 1.3rem;
  text-align: left;
}
.slider-block__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}
.slider-block__label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.slider-block__value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}
.slider-block__hint {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 0.6rem;
}

.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: var(--border);
  outline: none;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -8px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}
.slider::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: var(--border);
}
.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

/* ── Info card (training, etc.) ─────────────────────────────────────── */
.info-card {
  width: 100%;
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.4rem;
  text-align: left;
}
.info-card__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}
.info-card p {
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.5;
}

/* ── Upsell CTA (dark card, matches offer/diy-offer.html's .cta block) ── */
.cta {
  width: 100%;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.5rem 1.7rem;
  text-align: left;
}
.cta h2 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.cta p.sub { color: #d7d4cf; font-size: 0.92rem; line-height: 1.5; margin-top: 0.5rem; }
.cta .price {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-top: 1rem;
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--accent-bright);
}
.cta .price .was {
  font-size: 1.15rem;
  font-weight: 500;
  color: #9a9793;
  text-decoration: line-through;
}
.cta .price small {
  font-size: 0.75rem;
  font-weight: 600;
  color: #d7d4cf;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Misc ────────────────────────────────────────────────────────────── */
.error-text {
  font-size: 0.85rem;
  color: var(--accent);
  min-height: 1.2em;
}
