/* ============================================================
   Consultation funnel — one-question-per-screen.
   "Clinical" design system (navy #1E2640 + orange #F0641F + Plus
   Jakarta Sans), cohesive with twcx.css. Class names are preserved
   so step views + consultation.js need no changes.
   Colour tokens come from twc.css :root (--c-cream/-plum/-tangerine/
   -ink/-line/-ink-muted), which are the navy/orange brand values.
   ============================================================ */

.cf-shell {
  min-height: calc(100vh - 80px);
  background: var(--c-cream);
  padding: 0 0 96px;
}

/* ── Top bar: brand, progress, exit ── */
.cf-topbar {
  background: rgba(251,248,244,0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--c-line);
  padding: 16px 0;
  position: sticky; top: 0; z-index: 30;
}
.cf-topbar-inner {
  display: flex; align-items: center; gap: 24px;
}
.cf-brand {
  font-family: var(--ff-display); font-weight: 800;
  font-size: 18px; letter-spacing: -0.03em;
  color: var(--c-ink); text-decoration: none;
  flex-shrink: 0;
}
.cf-brand::after {
  content: ""; display: inline-block;
  width: 6px; height: 6px; background: var(--c-tangerine);
  border-radius: 50%; margin-left: 5px;
  vertical-align: middle;
}

/* ── Segmented progress bar ── */
.cf-progress {
  flex: 1;
  display: flex; gap: 6px;
}
.cf-progress-segment {
  flex: 1; height: 5px; border-radius: 999px;
  background: var(--c-line);
  position: relative; overflow: hidden;
}
.cf-progress-segment.done   { background: var(--c-plum); }
.cf-progress-segment.active {
  background: linear-gradient(90deg, var(--c-tangerine) var(--p, 40%), var(--c-line) var(--p, 40%));
}
.cf-progress-label {
  font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--c-ink-muted);
  font-weight: 700; white-space: nowrap;
}
.cf-exit {
  font-size: 13px; color: var(--c-ink-muted);
  text-decoration: none; padding: 7px 14px;
  border-radius: 999px; transition: background 0.15s, color 0.15s;
  font-weight: 600;
}
.cf-exit:hover { background: rgba(30,38,64,0.06); color: var(--c-ink); }

/* ── Body ── */
.cf-body { max-width: 720px; margin: 0 auto; padding: 56px 24px 0; }

.cf-back {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--c-ink-muted); font-size: 14px; font-weight: 600;
  text-decoration: none; margin-bottom: 32px;
  transition: color 0.15s;
}
.cf-back:hover { color: var(--c-tangerine); }
.cf-back::before { content: "←"; font-size: 17px; font-weight: 700; }

.cf-section-label {
  display: inline-block;
  font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--c-tangerine);
  font-weight: 700; margin-bottom: 14px;
}
.cf-prompt {
  font-family: var(--ff-display); font-weight: 800;
  font-size: clamp(30px, 4.4vw, 46px);
  letter-spacing: -0.035em; line-height: 1.06;
  margin: 0 0 16px; color: var(--c-ink);
}
.cf-helper {
  font-size: 16px; line-height: 1.6;
  color: var(--c-ink-muted); margin: 0 0 32px;
  max-width: 580px;
}

.cf-error {
  background: rgba(206,82,18,0.07);
  border: 1px solid rgba(206,82,18,0.35);
  color: var(--c-coral);
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 14px; font-weight: 600;
  margin-bottom: 24px;
}

/* ── Choice tiles ── */
.cf-choices { display: grid; gap: 12px; }
.cf-choice {
  display: block; width: 100%; cursor: pointer;
  background: #fff; border: 1.5px solid var(--c-line);
  border-radius: 16px; padding: 20px 22px;
  font-family: var(--ff-body); font-size: 16px; font-weight: 600;
  color: var(--c-ink); text-align: left;
  transition: border-color 0.15s, transform 0.1s, background 0.15s, box-shadow 0.15s;
  position: relative;
}
.cf-choice:hover  { border-color: var(--c-tangerine); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(30,38,64,0.06); }
.cf-choice input { position: absolute; opacity: 0; pointer-events: none; }
.cf-choice .tooltip {
  font-size: 12.5px; color: var(--c-ink-muted);
  margin-top: 4px; font-weight: 500;
}
.cf-choice.is-checked {
  border-color: var(--c-plum); background: var(--c-plum); color: #fff;
}
.cf-choice.is-checked .tooltip { color: rgba(255,255,255,0.72); }
.cf-choice .marker {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--c-line); display: inline-block;
  vertical-align: -4px; margin-right: 12px; transition: background 0.15s, border-color 0.15s;
}
.cf-choice.is-checked .marker {
  background: var(--c-tangerine); border-color: var(--c-tangerine);
}
.cf-choice.is-checkbox .marker { border-radius: 6px; }

/* ── Text / number / date inputs ── */
.cf-input {
  width: 100%; padding: 17px 20px;
  border: 1.5px solid var(--c-line); border-radius: 14px;
  font-family: var(--ff-body); font-size: 18px;
  color: var(--c-ink); background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cf-input:focus { outline: none; border-color: var(--c-tangerine); box-shadow: 0 0 0 4px rgba(240,100,31,0.12); }
.cf-input.is-large {
  font-family: var(--ff-display);
  font-size: clamp(40px, 6vw, 58px);
  font-weight: 800; letter-spacing: -0.03em;
  text-align: center; padding: 26px;
}
.cf-input-unit {
  display: inline-flex; align-items: baseline; gap: 8px;
  justify-content: center; width: 100%;
}
.cf-input-unit .cf-input.is-large { width: auto; min-width: 200px; }
.cf-input-unit .unit {
  font-family: var(--ff-display); font-weight: 800;
  font-size: 28px; color: var(--c-ink-muted);
  letter-spacing: -0.02em;
}
textarea.cf-input { min-height: 140px; resize: vertical; font-family: var(--ff-body); font-size: 16px; }

/* ── Unit toggle (kg ⇄ st/lb, cm ⇄ ft/in) ── */
.cf-unit-toggle {
  display: flex; gap: 0; margin: 0 auto 20px;
  background: #fff; border: 1.5px solid var(--c-line);
  border-radius: 999px; padding: 4px; justify-content: center;
  width: fit-content; max-width: 100%;
}
.cf-unit-tab {
  background: transparent; border: 0; cursor: pointer;
  padding: 10px 22px; border-radius: 999px;
  font-family: var(--ff-body); font-size: 14px; font-weight: 700;
  color: var(--c-ink-muted); letter-spacing: -0.005em;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap; flex: 0 0 auto;
}
.cf-unit-tab.is-active { background: var(--c-plum); color: #fff; }
.cf-unit-tab:not(.is-active):hover { color: var(--c-plum); }
@media (max-width: 520px) {
  .cf-unit-toggle { width: 100%; max-width: 340px; }
  .cf-unit-tab    { flex: 1 1 0; padding: 12px 14px; font-size: 14px; }
  .cf-input-unit .cf-input.is-large { min-width: 0; width: 100%; }
}
.cf-weight-fields[hidden], .cf-height-fields[hidden] { display: none !important; }

/* Google Places autocomplete dropdown */
.pac-container {
  border-radius: 14px; box-shadow: 0 12px 32px rgba(30,38,64,0.14);
  border: 1px solid var(--c-line); font-family: var(--ff-body);
  z-index: 9999; margin-top: 4px;
}
.pac-item { padding: 10px 14px; cursor: pointer; font-size: 14px; }
.pac-item:hover, .pac-item-selected { background: rgba(30,38,64,0.05); }

/* ── Address composite ── */
.cf-address { display: grid; gap: 12px; }
.cf-address-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .cf-address-row { grid-template-columns: 1fr; } }
.cf-address label {
  display: block; font-size: 12px;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--c-ink-muted); font-weight: 700;
  margin: 4px 0 6px;
}

/* ── GP composite ── */
.cf-gp { display: grid; gap: 12px; }
.cf-gp-not-found {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--c-ink-muted);
  margin-top: 4px;
}

/* ── Safety checkboxes ── */
.cf-safety-list { display: grid; gap: 10px; }
.cf-safety-item {
  display: flex; gap: 14px; padding: 16px 18px;
  background: #fff; border: 1.5px solid var(--c-line);
  border-radius: 14px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.cf-safety-item:hover { border-color: var(--c-tangerine); }
.cf-safety-item input { position: absolute; opacity: 0; pointer-events: none; }
.cf-safety-item.is-checked { border-color: var(--c-plum); background: rgba(240,100,31,0.05); }
.cf-safety-item .check {
  flex-shrink: 0; width: 22px; height: 22px;
  border: 2px solid var(--c-line); border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.cf-safety-item.is-checked .check {
  background: var(--c-tangerine); border-color: var(--c-tangerine);
}
.cf-safety-item.is-checked .check::after {
  content: "✓"; color: #fff; font-size: 14px; font-weight: 800;
}
.cf-safety-item p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--c-ink); }
.cf-safety-item a { color: var(--c-tangerine); font-weight: 600; }

/* ── BMI result panel ── */
.cf-bmi-panel {
  background: #fff; border: 1.5px solid var(--c-line);
  border-radius: 22px; padding: 36px; margin-bottom: 28px;
  text-align: center; box-shadow: 0 10px 30px rgba(30,38,64,0.05);
}
.cf-bmi-value {
  font-family: var(--ff-display); font-weight: 800;
  font-size: clamp(56px, 9vw, 92px); line-height: 1;
  letter-spacing: -0.04em; color: var(--c-tangerine); margin: 0;
}
.cf-bmi-band {
  font-family: var(--ff-display); font-weight: 700; font-style: normal;
  font-size: 22px; color: var(--c-ink); margin: 8px 0 24px;
  letter-spacing: -0.02em;
}
.cf-bmi-scale {
  height: 12px; border-radius: 999px;
  background: linear-gradient(90deg,
    #B3D7FF 0%, #B3D7FF 22%,
    #C7FF5E 22%, #C7FF5E 40%,
    #FFD79A 40%, #FFD79A 55%,
    #FFA178 55%, #FFA178 70%,
    #FF6B6B 70%, #FF6B6B 100%);
  position: relative; margin: 24px 0 12px;
}
.cf-bmi-scale .marker {
  position: absolute; top: -6px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--c-plum); border: 3px solid #fff;
  box-shadow: 0 4px 10px rgba(30,38,64,0.22);
  transform: translateX(-50%);
}
.cf-bmi-labels {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--c-ink-muted); font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
}

/* ── Submit button row ── */
.cf-actions { margin-top: 40px; }
.cf-submit {
  width: 100%; padding: 20px 28px;
  background: var(--c-tangerine); color: #fff;
  border: none; border-radius: 999px;
  font-family: var(--ff-body); font-size: 17px; font-weight: 700;
  cursor: pointer; letter-spacing: -0.01em;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 8px 22px rgba(240,100,31,0.25);
}
.cf-submit:hover { background: var(--c-coral); transform: translateY(-2px); box-shadow: 0 12px 28px rgba(240,100,31,0.32); }
.cf-submit:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.cf-submit .arrow { font-size: 18px; font-weight: 700; }

/* ── Mobile ── */
@media (max-width: 640px) {
  .cf-topbar-inner { gap: 12px; }
  .cf-progress-label { display: none; }
  .cf-body { padding: 32px 16px 0; }
  .cf-prompt { font-size: 27px; }
  .cf-helper { font-size: 15px; }
  .cf-bmi-panel { padding: 24px; }
}
