/* ===========================================================
   Plug-and-Play Questionnaire Funnel — Base Stylesheet
   Override brand variables in your page <style> block or in
   config.json's `theme` section (auto-injected at runtime).
   =========================================================== */

:root {
  --brand-primary: #00CEB5;
  --brand-primary-hover: #00A591;
  --brand-accent: #D9F8F4;
  --brand-cream: #FAFBF9;
  --brand-warn: rgb(255, 109, 74);
  --bg-page: #FAFBF9;
  --bg-card: #ffffff;
  --text-dark: #00483F;
  --text-muted: #5A6B63;
  --border-soft: rgba(0, 206, 181, 0.18);
  --font-headline: 'Inter', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --radius-card: 20px;
  --radius-pill: 999px;
}

body {
  background-color: var(--bg-page);
  font-family: var(--font-body);
  color: var(--text-dark);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

div { font-family: var(--font-body); }

/* ---------- Brand bar ---------- */
.brandbar {
  padding: 1rem 0 0.75rem;
  background-color: var(--bg-page);
}
.brandbar img { height: 64px; width: auto; max-width: 60vw; }

/* ---------- Conditional follow-ups (re-enrollment branch) ---------- */
.conditional-followups { animation: fadeIn .25s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- Hims-style mega wordmark in footer ---------- */
.lean-dose-mark {
  font-family: var(--font-headline);
  font-weight: 600;
  color: rgba(0, 206, 181, 0.12);
  font-size: clamp(120px, 22vw, 280px);
  line-height: 0.9;
  text-align: center;
  margin: 4rem 0 1rem;
  letter-spacing: -0.03em;
  user-select: none;
  pointer-events: none;
}

/* ---------- Progress steps ---------- */
.progress-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  width: fit-content;
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 1rem;
}
.progress-step { display: flex; align-items: center; flex: 1; position: relative; }
.progress-circle {
  width: 32px; height: 32px;
  border: 2px solid #b5b5b5;
  border-radius: 50%;
  background-color: var(--bg-page);
  display: flex; justify-content: center; align-items: center;
}
.progress-circle.active { border-color: var(--brand-primary); }
.progress-circle.active::before {
  content: ''; width: 10px; height: 10px;
  background-color: var(--brand-primary); border-radius: 50%;
}
.progress-step.completed .progress-circle {
  background-color: var(--brand-primary); border: none; color: #fff;
}
.progress-step.completed .progress-circle::before {
  content: "✓"; color: #fff; font-weight: bold; background: transparent; width:auto; height:auto;
}
.progress-label {
  margin-left: 0.5rem;
  color: #a0a0a0;
  font-weight: 400;
  white-space: nowrap;
  font-size: 16px;
  font-family: var(--font-headline);
}
.progress-step.active .progress-label,
.progress-step.completed .progress-label { color: var(--brand-primary); }
.progress-line { flex: 1; height: 2px; background-color: var(--border-soft); margin: 0 8px; }
.progress-step.completed .progress-line { background-color: var(--brand-primary); }

@media (max-width: 991.98px) {
  .progress-step:not(.active) .progress-label { display: none; }
}
@media (max-width: 575.98px) {
  .progress-container { justify-content: space-between; padding: 0.5rem; gap: 0; width: 100%; }
  .progress-step { flex: 1 1 auto; min-width: 0; }
  .progress-circle { width: 24px; height: 24px; }
  .progress-line { margin: 0 4px; }
  .progress-label { display: none !important; }
}

/* ---------- Headline (DirectMeds-style — sans, mint accent) ---------- */
.headline,
h1 {
  letter-spacing: -0.022em;
  margin-top: 24px;
  margin-bottom: 14px;
  font-size: 44px;
  font-weight: 700;
  line-height: 1.08;
  font-family: var(--font-headline);
  color: var(--text-dark);
}
.headline em,
h1 em {
  font-style: normal;
  color: var(--brand-primary);
  font-weight: 700;
}
.headline .dark { color: var(--text-dark); }
.headline + p,
h1 + p { color: var(--text-muted); font-size: 17px; line-height: 1.5; max-width: 38rem; margin-top: 14px; }

h2.question-headline,
h2 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: -0.01em;
  color: var(--text-dark);
  margin-top: 20px;
  margin-bottom: 18px;
}
h3 {
  letter-spacing: -0.01em;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-dark);
  margin: 8px 0;
  font-family: var(--font-body);
}
@media (max-width: 767.98px) {
  .headline, h1 { font-size: 30px; }
  h2 { font-size: 19px; }
}

/* ---------- Form section ---------- */
.form-section { margin: 0 auto; padding: 1rem; }
.form-label { font-family: var(--font-body); font-weight: 400; }

/* Inputs */
select, input {
  min-height: 56px;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-dark);
  outline: 0 !important;
  font-size: 16px;
  padding: 0 16px;
  font-family: var(--font-body);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  transition: border-color .15s ease, box-shadow .15s ease;
}
select:focus, input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(14, 140, 107, 0.15);
}
input::placeholder, textarea::placeholder { color: rgba(23, 23, 23, 0.35) !important; }
select { color: rgba(23, 23, 23, 0.45) !important; }
select.has-value { color: var(--text-dark) !important; }
select option { color: var(--text-dark); }

/* ---------- Radio "card" option (Hims-style pill cards) ---------- */
.radio-option { cursor: pointer; display: block; margin-bottom: 10px; }
.radio-option input[type="radio"] { display: none; }
.radio-option .option-box {
  border: 1.5px solid var(--border-soft);
  border-radius: 14px;
  padding: 18px 20px;
  background-color: var(--bg-card);
  transition: all 0.15s ease;
  font-size: 16px;
  font-weight: 500;
  display: flex; align-items: center;
  color: var(--text-dark);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
.radio-option:hover .option-box {
  border-color: var(--brand-primary);
  background-color: var(--bg-card);
}
.radio-option .option-box::before {
  content: ''; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border-soft); background-color: #fff;
  margin-right: 14px; display: inline-block; flex-shrink: 0;
  transition: all 0.15s ease;
}
.radio-option input[type="radio"]:checked + .option-box {
  border-color: var(--brand-primary);
  border-width: 2px;
  background-color: var(--brand-accent);
}
.radio-option input[type="radio"]:checked + .option-box::before {
  border-color: var(--brand-primary);
  background-color: var(--brand-primary);
  box-shadow: inset 0 0 0 4px var(--brand-accent);
}

/* ---------- Multi-select checkbox cards ---------- */
.multi-option {
  cursor: pointer;
  display: block;
  margin-bottom: 10px;
  width: 100%;
}
.multi-option input[type="checkbox"] { display: none; }
.multi-option .option-box {
  border: 1.5px solid var(--border-soft);
  border-radius: 14px;
  padding: 18px 20px;
  background-color: var(--bg-card);
  transition: all 0.15s ease;
  display: flex; align-items: center;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-dark);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}
.multi-option .option-box::before {
  content: ''; width: 20px; height: 20px; border-radius: 5px;
  border: 2px solid var(--border-soft); background-color: #fff;
  margin-right: 14px; display: inline-block; flex-shrink: 0;
  transition: all 0.15s ease;
}
.multi-option:hover .option-box { border-color: var(--brand-primary); }
.multi-option input[type="checkbox"]:checked + .option-box {
  border-color: var(--brand-primary);
  border-width: 2px;
  background-color: var(--brand-accent);
}
.multi-option input[type="checkbox"]:checked + .option-box::before {
  border-color: var(--brand-primary);
  background-color: var(--brand-primary);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-size: 14px 14px;
  background-position: center;
  background-repeat: no-repeat;
}

/* Gender/icon cards (big pills with icon) */
.gender-option { cursor: pointer; }
.gender-option input[type="radio"] { display: none; }
.gender-option .option-box {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  transition: all 0.2s ease;
  background-color: #fff;
  padding: 1.5rem 1rem;
  text-align: center;
}
.gender-option:hover .option-box { background-color: #f1f1f1; }
.gender-option input[type="radio"]:checked + .option-box {
  border: 3px solid var(--brand-primary); background-color: #fff;
}

/* ---------- Next / primary CTA (Hims pill button) ---------- */
.btn-next {
  background-color: var(--brand-primary);
  color: #fff;
  border: none;
  padding: 18px 28px;
  font-size: 17px;
  font-weight: 600;
  font-family: var(--font-body);
  border-radius: var(--radius-pill);
  transition: background-color 0.15s ease, transform 0.1s ease;
  width: 100%;
  max-width: 100%;
  margin-top: 1.5rem;
  letter-spacing: 0.005em;
  box-shadow: 0 4px 14px rgba(14, 140, 107, 0.18);
}
.btn-next:hover { background-color: var(--brand-primary-hover); color: #fff; }
.btn-next:active { transform: translateY(1px); }

.ctaBtn1 {
  background-color: var(--brand-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 14px 28px;
  margin: 0.5rem auto;
  display: inline-block;
  font-weight: 600;
  font-family: var(--font-body);
  font-size: 16px;
  box-shadow: 0 4px 14px rgba(14, 140, 107, 0.18);
}
.ctaBtn1:hover { background-color: var(--brand-primary-hover); color: #fff; }

/* ---------- Validation pulse ---------- */
.pulse, .pulse + label {
  position: relative;
  animation: animate 3s linear infinite;
}
@keyframes animate {
  0%   { box-shadow: 0 0 0 0 rgba(255,109,74,0.7), 0 0 0 0 rgba(255,109,74,0.7); }
  40%  { box-shadow: 0 0 0 10px rgba(255,109,74,0),   0 0 0 0 rgba(255,109,74,0.7); }
  80%  { box-shadow: 0 0 0 10px rgba(255,109,74,0),   0 0 0 7px rgba(255,109,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,109,74,0),     0 0 0 7px rgba(255,109,74,0); }
}

/* ---------- Warning / disqualification modals ---------- */
.intersticial.popup.warning {
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  background-color: var(--bg-page);
  z-index: 1050;
  overflow-y: auto;
  padding: 2rem 1rem;
}
.intersticial.popup.warning .bmi { display:inline-block; margin:0 auto; }
.spacer { height: 12px; }

/* ---------- Footer badges ---------- */
.footer-badge { margin: 2rem 0 1rem; }

/* ---------- Hero image ---------- */
.hero-img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-card);
}

/* Utility */
.bg-page { background-color: var(--bg-page); }
.nowrap { white-space: nowrap; }
.cta-shake { animation: shakeCycle 5s infinite ease-in-out; }
@keyframes shakeCycle {
  0%, 89.9% { transform: translate(0, 0); }
  90% { transform: translate(-2px, 0); }
  92% { transform: translate(2px, 0); }
  94% { transform: translate(-2px, 0); }
  96% { transform: translate(2px, 0); }
  98%, 100% { transform: translate(0, 0); }
}

/* ===========================================================
   v3 — DirectMeds-style icon cards, info-media break screens,
   consult tier modal, sublabels.
   =========================================================== */

/* Option grid layout: 2-3 col cards with icons */
.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 0 0 1.25rem;
}
.option-grid > .form-label,
.option-grid > h3 { grid-column: 1 / -1; }

.card-option {
  cursor: pointer;
  display: block;
  margin: 0;
}
.card-option input { display: none; }
.opt-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  padding: 22px 14px;
  border: 1.5px solid var(--border-soft);
  border-radius: 14px;
  background: var(--bg-card);
  min-height: 140px;
  transition: border-color .15s ease, background-color .15s ease, transform .1s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.card-option:hover .opt-card {
  border-color: var(--brand-primary);
}
.card-option input:checked + .opt-card {
  border-color: var(--brand-primary);
  border-width: 2px;
  background: var(--brand-accent);
}
.opt-icon {
  font-size: 34px;
  line-height: 1;
  color: var(--text-dark);
}
.card-option input:checked + .opt-card .opt-icon { color: var(--brand-primary); }
.opt-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.2;
}
.opt-sublabel {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Informational break screens (charts + videos) */
.info-step .info-media {
  max-width: 560px;
  margin: 0 auto 24px;
}
.info-media-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-card);
  background: linear-gradient(135deg, var(--brand-accent) 0%, #F0FDFA 100%);
  padding: 12px;
}
.info-media--video {
  max-width: 360px;
  margin: 0 auto 24px;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: #000;
  box-shadow: 0 8px 24px rgba(0, 72, 63, 0.15);
}
.info-media-video {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  background: #000;
  display: block;
}
.info-step .info-body {
  max-width: 38rem;
  margin: 18px auto 0;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.55;
}

/* Consult tier modal — softer than disqualify (notice, not warning) */
.intersticial.popup.notice {
  position: fixed;
  inset: 0;
  width: 100%; height: 100%;
  background-color: var(--bg-page);
  z-index: 1050;
  overflow-y: auto;
  padding: 2rem 1rem;
}
.intersticial.popup.notice h1 {
  color: var(--text-dark);
}
#consultReview .ctaBtn1 {
  background-color: var(--brand-primary);
}

/* Mobile tweaks for icon-card grids */
@media (max-width: 575.98px) {
  .option-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .opt-card { min-height: 120px; padding: 16px 10px; }
  .opt-icon { font-size: 28px; }
  .opt-label { font-size: 14px; }
}
@media (max-width: 380px) {
  .option-grid { grid-template-columns: 1fr; }
}

/* Smooth fade-in on step render so transitions feel less jumpy */
.form-section { animation: stepFade .25s ease both; }
@keyframes stepFade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
