/*
 * Funnel styles - eligibility, payment confirmation, questionnaire.
 *
 * These pages deliberately do NOT use the main site header/footer. They are
 * conversion funnels: minimal chrome, no nav links out, one action per screen.
 * Shared here rather than inlined per page so the design cannot drift.
 *
 * Tokens are duplicated from assets/css/site.css on purpose - funnel pages do
 * not load site.css, so they need their own :root.
 */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --green: #0F6E56; --green-mid: #1D9E75; --green-dark: #085041;
  --green-light: #E8F5F0; --green-pale: #F2FAF7;
  --navy: #1a3a6b; --navy-light: #EBF2FB;
  --white: #FFFFFF; --off-white: #FAFAF8; --black: #111111;
  --gray-1: #F5F5F3; --gray-2: #E8E8E4; --gray-3: #9A9A94; --gray-4: #555550;
  --red: #DC2626; --red-light: #FEF2F2;
  --amber: #D97706; --amber-light: #FFFBEB;
  --serif: 'DM Serif Display', Georgia, serif;
  --sans: 'DM Sans', -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--sans); background: var(--off-white); color: var(--black);
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}

/* NAV */
.q-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100; height: 56px;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(20px);
  border-bottom: 0.5px solid var(--gray-2);
  display: flex; align-items: center; justify-content: space-between; padding: 0 32px;
}
.q-nav-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.q-nav-logo span { font-size: 14px; font-weight: 600; color: var(--black); }
.q-nav-tag {
  font-size: 11px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--green-dark); background: var(--green-light); padding: 4px 10px; border-radius: 20px;
}
.q-nav-back { font-size: 13px; color: var(--gray-3); text-decoration: none; }
.q-nav-back:hover { color: var(--black); }

/* PROGRESS */
.progress-wrap {
  position: fixed; top: 56px; left: 0; right: 0; z-index: 99;
  background: white; border-bottom: 0.5px solid var(--gray-2);
  padding: 10px 32px; display: flex; align-items: center; gap: 16px;
}
.progress-track { flex: 1; height: 4px; background: var(--gray-2); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--green); border-radius: 4px; transition: width 0.4s ease; }
.progress-text { font-size: 12px; font-weight: 500; color: var(--gray-3); white-space: nowrap; min-width: 36px; text-align: right; }

/* MILESTONES - the whole journey, shown on every funnel page.
   Lets the patient keep the full process in perspective rather than
   discovering the next stage only once they have paid. */
.milestones {
  position: fixed; top: 56px; left: 0; right: 0; z-index: 99;
  background: white; border-bottom: 0.5px solid var(--gray-2);
  padding: 12px 32px 10px;
}
.milestones-track {
  display: flex; align-items: flex-start; max-width: 780px; margin: 0 auto;
}
.milestone { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; min-width: 0; }
/* connector line to the previous milestone */
.milestone::before {
  content: ''; position: absolute; top: 8px; right: 50%; left: -50%; height: 2px;
  background: var(--gray-2); z-index: 0;
}
.milestone:first-child::before { display: none; }
.milestone.done::before, .milestone.active::before { background: var(--green); }
.milestone-dot {
  width: 18px; height: 18px; border-radius: 50%; background: white;
  border: 2px solid var(--gray-2); position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: white; line-height: 1; flex-shrink: 0;
}
.milestone.done .milestone-dot { background: var(--green); border-color: var(--green); }
.milestone.done .milestone-dot::after { content: '\2713'; font-weight: 700; }
.milestone.active .milestone-dot {
  border-color: var(--green); background: white;
  box-shadow: 0 0 0 4px var(--green-light);
}
.milestone.active .milestone-dot::after {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--green);
}
.milestone-label {
  margin-top: 7px; font-size: 10.5px; line-height: 1.3; text-align: center;
  color: var(--gray-3); letter-spacing: 0.01em; padding: 0 2px;
}
.milestone.done .milestone-label { color: var(--gray-4); }
.milestone.active .milestone-label { color: var(--green-dark); font-weight: 600; }
.milestone.pending .milestone-label { color: var(--gray-3); }
/* Final step is never reached on the website - it follows the consultation */
.milestone.terminal .milestone-dot { border-style: dashed; }
.milestone.terminal .milestone-label { opacity: 0.65; font-style: italic; }

.milestone-sub {
  text-align: center; font-size: 11px; color: var(--gray-3);
  margin-top: 8px; min-height: 14px;
}

/* The questionnaire has its own percentage bar for progress through the 53
   questions. It sits below the milestone bar rather than fighting it for the
   same fixed position: journey progress above, within-page progress beneath. */
.progress-wrap.under-milestones {
  position: static;
  border-bottom: none;
  border-top: 0.5px solid var(--gray-2);
  padding: 8px 32px;
}
body.bwlc-questionnaire .milestones { border-bottom: none; }
body.bwlc-questionnaire .progress-wrap.under-milestones {
  position: fixed; top: auto; z-index: 98;
}

/* MAIN */
.q-outer { padding-top: 112px; min-height: 100vh; display: flex; flex-direction: column; }
.q-outer.no-progress { padding-top: 56px; }
.q-inner { max-width: 600px; margin: 0 auto; padding: 40px 24px 120px; width: 100%; flex: 1; }

/* CARDS */
.q-card {
  background: white; border: 1px solid var(--gray-2); border-radius: 20px;
  padding: 36px 36px 28px; margin-bottom: 24px; animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.q-title { font-family: var(--serif); font-size: 1.6rem; line-height: 1.25; color: var(--black); margin-bottom: 8px; }
.q-subtitle { font-size: 14px; color: var(--gray-3); line-height: 1.6; margin-bottom: 24px; }
.step-tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--green); margin-bottom: 12px;
}
.step-tag::before { content: ''; display: block; width: 16px; height: 1.5px; background: var(--green); }

/* INPUTS */
.q-input {
  width: 100%; font-size: 15px; font-family: var(--sans); padding: 13px 16px;
  border: 1.5px solid var(--gray-2); border-radius: 12px; background: var(--gray-1);
  color: var(--black); transition: border-color 0.15s, background 0.15s;
}
.q-input:focus { border-color: var(--green); background: white; outline: none; }
.q-select {
  width: 100%; font-size: 15px; font-family: var(--sans); padding: 13px 16px;
  border: 1.5px solid var(--gray-2); border-radius: 12px; background: var(--gray-1);
  color: var(--black); cursor: pointer;
}

/* WEIGHT/HEIGHT ROW */
.measure-row { display: flex; gap: 10px; }
.measure-row .q-input { flex: 1; min-width: 0; }
.measure-unit {
  width: 92px; flex-shrink: 0; font-size: 15px; font-family: var(--sans); padding: 13px 12px;
  border: 1.5px solid var(--gray-2); border-radius: 12px; background: var(--gray-1);
  color: var(--black); cursor: pointer;
}
.measure-suffix { font-size: 13px; color: var(--gray-3); align-self: center; flex-shrink: 0; }
.field-group { margin-bottom: 20px; }
.field-group label {
  display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--gray-3); margin-bottom: 8px;
}
.field-hint { font-size: 12px; color: var(--gray-3); margin-top: 6px; line-height: 1.5; }

/* BMI RESULT */
.bmi-result-box {
  background: var(--green-pale); border: 1px solid var(--green-light); border-radius: 14px;
  padding: 20px 22px; margin-top: 20px; display: flex; align-items: center; gap: 16px;
}
.bmi-result-num { font-family: var(--serif); font-size: 2.2rem; color: var(--green-dark); line-height: 1; }
.bmi-result-text { font-size: 14px; color: var(--green-dark); line-height: 1.6; }

/* OPTIONS */
.options-list { display: flex; flex-direction: column; gap: 8px; }
.option-label {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px;
  border: 1.5px solid var(--gray-2); border-radius: 12px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s; font-size: 14px; line-height: 1.5; color: var(--black);
}
.option-label:hover { border-color: var(--green); background: var(--green-pale); }
.option-label:has(input:checked) { border-color: var(--green); background: var(--green-pale); }
.option-label.none-option { color: var(--black); }
.option-label.none-option:has(input:checked) { border-color: var(--green); background: var(--green-pale); }
.option-label input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 20px; height: 20px; min-width: 20px;
  border: 2px solid var(--gray-2); border-radius: 6px; background: white;
  margin: 0; margin-top: 1px; position: relative; cursor: pointer;
}
.option-label input[type="checkbox"]:checked { background: var(--green); border-color: var(--green); }
.option-label input[type="checkbox"]:checked::after {
  content: '\2713'; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  font-size: 12px; color: white; font-weight: 700;
}
.option-label input[type="radio"] { width: 20px; height: 20px; min-width: 20px; accent-color: var(--green); cursor: pointer; }

/* Count of confirmations still outstanding */
.confirm-counter { font-size: 13px; color: var(--gray-4); margin-top: 14px; line-height: 1.6; }
.confirm-counter strong { color: var(--green-dark); }

/* NOTICES */
.q-warning {
  background: var(--amber-light); border-left: 3px solid var(--amber); border-radius: 10px;
  padding: 16px 20px; margin: 16px 0; font-size: 14px; color: #78350F; line-height: 1.7;
}
.q-notice {
  background: var(--red-light); border-left: 3px solid var(--red); border-radius: 10px;
  padding: 16px 20px; margin: 16px 0; font-size: 14px; color: #7f1d1d; line-height: 1.7;
}

/* FOOTER BUTTONS */
.q-footer {
  position: fixed; bottom: 0; left: 0; right: 0; background: white;
  border-top: 0.5px solid var(--gray-2); padding: 16px 32px;
  display: flex; gap: 12px; align-items: center; z-index: 99;
}

/* Buttons belong WITH the question, not pinned to the bottom of the window.
   Pinning left a short question stranded at the top with the controls far
   below, and left-aligned against a centred card. These rules are scoped to
   body.bwlc-funnel so they outrank the plain .q-footer in questionnaire.css,
   which loads after this file. */
body.bwlc-funnel .q-footer {
  position: static;
  background: transparent;
  border-top: none;
  z-index: auto;
  max-width: 600px;
  margin: 0 auto 64px;
  padding: 4px 24px 0;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}
body.bwlc-funnel .q-footer .btn-next { order: 2; }
body.bwlc-funnel .q-footer .btn-prev { order: 1; }
body.bwlc-funnel .q-footer .reset-link {
  order: 3;
  flex-basis: 100%;
  margin-left: 0;
  margin-top: 10px;
  text-align: center;
}
/* The old fixed bar needed 120px of clearance underneath. It doesn't now. */
body.bwlc-funnel .q-inner { padding-bottom: 32px; }

/* .q-outer is min-height:100vh with .q-inner set to flex:1, so the column
   stretched to fill the window and shoved the footer -- which is a sibling
   after it -- down to the bottom of the screen. Collapsing both makes the
   page only as tall as its content, so the buttons land under the card. */
body.bwlc-funnel .q-outer {
  min-height: 0;
  display: block;
}
body.bwlc-funnel .q-inner {
  flex: none;
}
.btn-next {
  background: var(--green); color: white; padding: 14px 32px; border-radius: 50px; border: none;
  font-size: 15px; font-weight: 500; font-family: var(--sans); cursor: pointer; transition: background 0.2s;
}
.btn-next:hover { background: var(--green-mid); }
.btn-prev {
  background: transparent; color: var(--gray-4); padding: 14px 20px; border-radius: 50px;
  border: 1.5px solid var(--gray-2); font-size: 15px; font-weight: 400; font-family: var(--sans);
  cursor: pointer; transition: all 0.15s;
}
.btn-prev:hover { border-color: var(--black); color: var(--black); }
.btn-prev:disabled { opacity: 0.3; cursor: not-allowed; }
.reset-link { font-size: 12px; color: var(--gray-3); cursor: pointer; margin-left: auto; text-decoration: underline; }

/* STOP SCREEN */
.stop-card { text-align: center; padding: 40px 36px; }
.stop-icon {
  width: 72px; height: 72px; border-radius: 50%; background: var(--red-light);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-size: 32px;
}
.stop-body { font-size: 15px; color: var(--gray-4); line-height: 1.75; max-width: 440px; margin: 0 auto 24px; }
.stop-actions { display: flex; flex-direction: column; gap: 10px; max-width: 340px; margin: 0 auto; }
.btn-green {
  display: block; background: var(--green); color: white; padding: 13px 24px; border-radius: 50px;
  font-size: 14px; font-weight: 500; text-decoration: none; text-align: center;
}
.btn-navy {
  display: block; background: var(--navy); color: white; padding: 13px 24px; border-radius: 50px;
  font-size: 14px; font-weight: 500; border: none; cursor: pointer; font-family: var(--sans); text-align: center;
}
.btn-ghost { display: block; font-size: 13px; color: var(--gray-3); text-decoration: none; padding: 8px; text-align: center; }

/* Informational panels sitting alongside a main confirmation card.
   The green left border marks them as supporting context -- "what happens
   next", "need to change something" -- rather than the primary message. */
.q-card.info-panel {
  border-left: 3px solid var(--green);
  border-radius: 6px 20px 20px 6px;
  background: var(--green-pale);
  text-align: left;
}
.q-card.info-panel .step-tag { margin-bottom: 10px; }
.q-card.info-panel ol,
.q-card.info-panel ul { margin: 0; }
.q-card.info-panel .stop-actions { margin: 0; max-width: 100%; }

/* SUCCESS / CONFIRMATION */
.success-icon {
  width: 72px; height: 72px; border-radius: 50%; background: var(--green-light);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 20px;
}
.order-summary {
  background: var(--green-pale); border: 1.5px solid var(--green-light); border-radius: 16px;
  padding: 24px; margin-bottom: 24px;
}
.order-summary-label {
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--green); margin-bottom: 6px;
}
.order-summary-dose { font-family: var(--serif); font-size: 2.4rem; color: var(--green-dark); line-height: 1; }
.order-summary-desc { font-size: 14px; color: var(--green-dark); margin: 4px 0 20px; opacity: 0.7; }
.order-summary-price { font-family: var(--serif); font-size: 2rem; color: var(--black); margin-bottom: 16px; }
.order-cta {
  display: block; background: var(--green); color: white; padding: 14px 28px; border-radius: 50px;
  font-size: 15px; font-weight: 500; text-decoration: none;
}
.order-note { font-size: 12px; color: var(--green-dark); opacity: 0.6; margin-top: 10px; line-height: 1.5; }
.linkish { font-size: 13px; color: var(--gray-3); background: none; border: none; cursor: pointer; text-decoration: underline; font-family: var(--sans); }

/* Placeholder state when a payment link has not been configured yet */
.link-missing {
  display: block; background: var(--gray-2); color: var(--gray-4); padding: 14px 28px;
  border-radius: 50px; font-size: 15px; font-weight: 500; text-align: center; cursor: not-allowed;
}

@media (max-width: 640px) {
  .q-nav, .progress-wrap, .q-footer { padding-left: 16px; padding-right: 16px; }
  .q-inner { padding: 24px 16px 120px; }
  .q-card { padding: 24px 20px 20px; }
  .q-nav-logo span { font-size: 13px; }

  /* Milestones stay visible on mobile but shed their labels except the
     current one, so six steps still fit a narrow screen. */
  .milestones { padding: 12px 12px 8px; }
  .milestone-label { display: none; }
  .milestone.active .milestone-label {
    display: block; position: absolute; top: 26px; left: 50%;
    transform: translateX(-50%); white-space: nowrap; font-size: 11px;
  }
  .milestone-sub { margin-top: 22px; }
  .q-outer { padding-top: 130px; }
}
