/* MealFeel funnel — shared styles for the quiz and the plan pages.
   Built on the tokens in styles.css. */

/* ============================== QUIZ ============================== */
.quiz-body { min-height: 100svh; display: flex; flex-direction: column; background: var(--ground); }

.quiz-top {
  position: sticky; top: 0; z-index: 10;
  background: var(--ground);
  border-bottom: 1px solid var(--line);
}
.quiz-top .wrap { display: flex; align-items: center; gap: 16px; height: 62px; }
.quiz-top .logo { margin-right: auto; }
.quiz-top .logo-mark { width: 30px; height: 30px; border-radius: 15px; background: var(--green); color: #fff; }
.quiz-top .logo-mark svg { width: 17px; height: 17px; }
.quiz-top .logo-word { font-size: 21px; color: var(--ink); }
.quiz-exit { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.quiz-exit:hover { color: var(--ink); }

.quiz-progress { height: 4px; background: var(--surface-2); }
.quiz-progress > span { display: block; height: 100%; width: 0; background: var(--green); border-radius: 0 4px 4px 0; transition: width 320ms cubic-bezier(.4,0,.2,1); }

.quiz-stage { flex: 1; display: flex; align-items: flex-start; }
.quiz-stage .wrap { width: 100%; max-width: 680px; padding-top: clamp(24px, 6vh, 64px); padding-bottom: 40px; }

.q-step { animation: qfade 360ms cubic-bezier(.4,0,.2,1); }
@keyframes qfade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .q-step, .q-result { animation: none; } }

.q-count { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--green); }
.q-title { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; font-size: clamp(27px, 5.5vw, 38px); margin-top: 8px; }
.q-sub { color: var(--muted); font-size: 16px; margin-top: 10px; }

.q-options { display: grid; gap: 12px; margin-top: 26px; }
.q-options.cols-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .q-options.cols-2 { grid-template-columns: 1fr; } }

.q-option {
  appearance: none; text-align: left; font: inherit; cursor: pointer;
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); color: var(--ink);
  border: 1.5px solid var(--line); border-radius: 16px;
  padding: 16px 18px; min-height: 68px;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 80ms ease, background 140ms ease;
}
.q-option:hover { border-color: var(--green); }
.q-option:active { transform: scale(.99); }
.q-option:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.q-option.sel { border-color: var(--green); background: color-mix(in srgb, var(--lime) 24%, var(--surface)); box-shadow: inset 0 0 0 1.5px var(--green); }

.q-opt-ic {
  flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--green);
}
.q-option.sel .q-opt-ic { background: var(--green); color: #fff; }
.q-opt-ic svg { width: 22px; height: 22px; }
.q-opt-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.q-opt-title { font-weight: 700; font-size: 16.5px; }
.q-opt-note { color: var(--muted); font-size: 13.5px; }
.q-opt-check {
  margin-left: auto; flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center;
  color: transparent;
}
.q-option.sel .q-opt-check { background: var(--green); border-color: var(--green); color: #fff; }
.q-opt-check svg { width: 15px; height: 15px; }

.q-nav { display: flex; align-items: center; gap: 12px; margin-top: 28px; }
.q-back {
  appearance: none; border: 0; background: transparent; cursor: pointer; font: inherit;
  color: var(--muted); font-weight: 650; display: inline-flex; align-items: center; gap: 6px; padding: 10px 6px;
}
.q-back:hover { color: var(--ink); }
.q-back svg { width: 18px; height: 18px; }
.q-continue { margin-left: auto; }
.q-continue:disabled { opacity: .45; cursor: not-allowed; }
.q-hint { color: var(--muted); font-size: 13px; margin-top: 14px; display: inline-flex; align-items: center; gap: 7px; }
.q-hint svg { width: 15px; height: 15px; color: var(--green); }

/* ---- result + email gate ---- */
.q-result { animation: qfade 420ms cubic-bezier(.4,0,.2,1); }
.result-badge { display: inline-flex; align-items: center; gap: 8px; background: var(--lime); color: var(--on-lime); font-weight: 700; font-size: 13px; padding: 7px 14px; border-radius: 999px; }
.result-badge svg { width: 15px; height: 15px; }
.result-title { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.03em; line-height: 1.06; font-size: clamp(28px, 6vw, 42px); margin-top: 16px; }
.result-title em { font-style: normal; color: var(--green); }
.result-sub { color: var(--ink-2); font-size: 17px; margin-top: 12px; }

.result-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px; margin-top: 24px; box-shadow: var(--shadow); }
.result-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.result-tag { background: var(--surface-2); color: var(--ink-2); font-weight: 650; font-size: 13px; padding: 6px 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.result-tag svg { width: 14px; height: 14px; color: var(--green); }

.preview-label { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.preview-days { display: grid; gap: 10px; margin-top: 12px; position: relative; }
.preview-day { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.preview-day h4 { font-family: var(--font-display); font-weight: 800; font-size: 15px; margin-bottom: 8px; }
.preview-meal { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; font-size: 14.5px; }
.preview-meal .slot { color: var(--muted); font-weight: 650; font-size: 12.5px; width: 74px; flex-shrink: 0; text-transform: uppercase; letter-spacing: .03em; }
.preview-meal .mname { font-weight: 600; }
.preview-locked { position: relative; }
.preview-locked .preview-day { filter: blur(4px); opacity: .5; pointer-events: none; }
.preview-fade {
  position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center;
  background: linear-gradient(to bottom, transparent, var(--surface) 82%);
  border-radius: 14px; padding-bottom: 8px;
}
.preview-fade span { font-weight: 700; color: var(--ink); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.preview-fade svg { width: 15px; height: 15px; }

.email-gate { margin-top: 24px; }
.gate-h { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.gate-p { color: var(--muted); font-size: 15px; margin-top: 6px; }
.gate-form { margin-top: 14px; }
.gate-row { display: flex; gap: 10px; }
@media (max-width: 480px) { .gate-row { flex-direction: column; } }
.gate-form .field { flex: 1; }
.gate-trust { display: flex; flex-wrap: wrap; gap: 14px 18px; margin-top: 14px; }
.gate-trust span { color: var(--muted); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.gate-trust svg { width: 14px; height: 14px; color: var(--green); }
.gate-msg { margin-top: 12px; font-size: 14px; font-weight: 600; min-height: 20px; }
.gate-msg[data-state="err"] { color: #C0392B; }
.gate-msg[data-state="ok"] { color: var(--green); }

/* field + btn fallbacks (match styles.css) */
.field {
  appearance: none; width: 100%; font: inherit; min-height: 52px; padding: 0 16px;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink);
}
.field:focus-visible { outline: 3px solid var(--green); outline-offset: 1px; border-color: var(--green); }
.field[aria-invalid="true"] { border-color: #C0392B; }

/* loading dots */
.q-loading { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 60px 0; text-align: center; }
.q-spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid var(--surface-2); border-top-color: var(--green); animation: qspin .8s linear infinite; }
@keyframes qspin { to { transform: rotate(360deg); } }

/* ============================== PLAN PAGE ============================== */
.plan-banner { background: var(--lime); color: var(--on-lime); }
.plan-banner .wrap { display: flex; align-items: center; gap: 12px; padding-top: 12px; padding-bottom: 12px; font-weight: 650; font-size: 14.5px; }
.plan-banner svg { width: 20px; height: 20px; flex-shrink: 0; }
.plan-banner a { font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

.plan-hero { padding: clamp(36px, 7vw, 72px) 0 clamp(28px, 5vw, 48px); }
.plan-hero .kicker { color: var(--green); }
.plan-hero h1 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.035em; line-height: 1.04; font-size: clamp(32px, 6.5vw, 54px); margin-top: 12px; }
.plan-hero .tagline { font-size: clamp(17px, 2.4vw, 21px); color: var(--ink-2); margin-top: 16px; max-width: 48ch; }
.plan-hero .for-who { margin-top: 18px; color: var(--muted); max-width: 60ch; }
.plan-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.plan-principles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 10px; }
@media (max-width: 860px) { .plan-principles { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .plan-principles { grid-template-columns: 1fr; } }
.principle { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.principle .feat-ic { margin-bottom: 12px; }
.principle h3 { font-family: var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
.principle p { color: var(--muted); font-size: 14.5px; margin-top: 6px; }

.days-grid { display: grid; gap: 16px; margin-top: 10px; }
.day-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; background: var(--band); color: var(--band-fg); }
.day-head h3 { font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -0.01em; }
.day-head .day-sum { font-size: 13px; color: var(--band-muted); font-weight: 600; }
.day-meals { display: grid; }
.meal-row { display: flex; gap: 14px; padding: 15px 20px; border-top: 1px solid var(--line); align-items: flex-start; }
.meal-row:first-child { border-top: 0; }
.meal-slot { flex-shrink: 0; width: 86px; font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--green); padding-top: 2px; }
.meal-main { flex: 1; min-width: 0; }
.meal-name { font-weight: 700; font-size: 16px; }
.meal-name .swapped { color: var(--green); }
.meal-why { color: var(--muted); font-size: 14px; margin-top: 3px; }
.meal-macros { display: flex; gap: 10px; margin-top: 7px; flex-wrap: wrap; }
.macro { font-size: 12px; font-weight: 650; color: var(--ink-2); background: var(--surface-2); border-radius: 999px; padding: 3px 9px; }
.swap-note { font-size: 12.5px; color: var(--green); margin-top: 6px; display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.swap-note svg { width: 13px; height: 13px; }

.recipe-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 10px; }
@media (max-width: 720px) { .recipe-cards { grid-template-columns: 1fr; } }
.recipe-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; }
.recipe-card .rc-top { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.recipe-card .rc-plate { width: 64px; height: 64px; flex-shrink: 0; }
.recipe-card h3 { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.recipe-card .rc-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.recipe-card .rc-meta span { font-size: 12px; font-weight: 650; color: var(--ink-2); background: var(--surface-2); border-radius: 999px; padding: 3px 10px; }
.recipe-card .rc-tagline { color: var(--ink-2); font-size: 14.5px; margin-bottom: 16px; }
.rc-cols { display: grid; grid-template-columns: 1fr 1.3fr; gap: 20px; }
@media (max-width: 520px) { .rc-cols { grid-template-columns: 1fr; } }
.rc-cols h4 { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.rc-ing { list-style: none; padding: 0; display: grid; gap: 5px; }
.rc-ing li { font-size: 14px; padding-left: 16px; position: relative; }
.rc-ing li::before { content: ""; position: absolute; left: 0; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.rc-steps { padding-left: 20px; display: grid; gap: 8px; }
.rc-steps li { font-size: 14px; }
.rc-nutri { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.rc-nutri span { font-size: 12.5px; font-weight: 650; color: var(--ink-2); }
.rc-nutri b { color: var(--ink); }

.plan-faq { max-width: 760px; }
.plan-grocery { background: var(--band); color: var(--band-fg); border-radius: 24px; padding: clamp(26px, 4vw, 40px); }
.plan-grocery h2 { color: var(--band-fg); }
.plan-grocery .lead { color: var(--band-muted); }
.grocery-cols { columns: 2; column-gap: 32px; margin-top: 18px; }
@media (max-width: 560px) { .grocery-cols { columns: 1; } }
.grocery-cols .gc-group { break-inside: avoid; margin-bottom: 18px; }
.grocery-cols h4 { font-weight: 800; font-size: 14px; margin-bottom: 8px; color: var(--lime); }
.grocery-cols ul { list-style: none; padding: 0; display: grid; gap: 5px; }
.grocery-cols li { font-size: 14px; color: var(--band-fg); }

/* print: make plan pages print as a clean PDF */
@media print {
  .nav, .quiz-top, .plan-banner, .foot, .plan-actions, .cta, .print-hide { display: none !important; }
  body { background: #fff; color: #000; }
  .day-head { background: #eee !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .day-card, .recipe-card, .principle { border: 1px solid #ccc; break-inside: avoid; }
  .plan-grocery { background: #fff !important; color: #000 !important; border: 1px solid #ccc; }
  .plan-grocery h4 { color: #000 !important; }
  .grocery-cols li, .plan-grocery .lead { color: #000 !important; }
  a { text-decoration: none; color: #000; }
}

/* ---- shared button ghost variant (not in styles.css) ---- */
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.cta .btn.ghost { color: var(--on-lime); border-color: color-mix(in srgb, var(--on-lime) 35%, transparent); }

/* ---- "other plans" links in the plan-page CTA ---- */
.otherplans { display: grid; gap: 10px; margin-top: 22px; max-width: 420px; }
.otherplan { display: flex; align-items: center; gap: 12px; text-decoration: none; background: color-mix(in srgb, var(--on-lime) 7%, transparent); border: 1px solid color-mix(in srgb, var(--on-lime) 18%, transparent); border-radius: 14px; padding: 12px 14px; color: var(--on-lime); transition: background 140ms ease; }
.otherplan:hover { background: color-mix(in srgb, var(--on-lime) 13%, transparent); }
.otherplan .op-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--on-lime); color: var(--lime); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.otherplan .op-ic svg { width: 20px; height: 20px; }
.otherplan .op-body { display: flex; flex-direction: column; line-height: 1.2; margin-right: auto; }
.otherplan .op-body strong { font-weight: 750; font-size: 15px; }
.otherplan .op-body small { color: var(--on-lime-2); font-size: 12.5px; }
.otherplan > svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ---- homepage funnel additions ---- */
.btn.lg { min-height: 58px; padding: 0 30px; font-size: 18px; border-radius: 16px; }
.hero-cta { margin-top: 26px; }
.hero-cta .btn.lg { box-shadow: 0 14px 30px -12px rgba(21,33,27,.5); }
.hero-cta-note { margin-top: 12px; color: var(--muted); font-size: 14px; font-weight: 500; }

.goals-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: clamp(28px, 4vw, 44px); }
@media (max-width: 900px) { .goals-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .goals-grid { grid-template-columns: 1fr; } }
.goal-card { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 24px; transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease; }
.goal-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--green); }
.goal-card h3 { font-family: var(--font-display); font-weight: 800; font-size: 19px; letter-spacing: -0.01em; margin: 14px 0 6px; }
.goal-card p { color: var(--muted); font-size: 14.5px; flex: 1; }
.goal-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; font-weight: 700; font-size: 14.5px; color: var(--green); }
.goal-link svg { width: 17px; height: 17px; transition: transform 140ms ease; }
.goal-card:hover .goal-link svg { transform: translateX(3px); }
.goals-cta { margin-top: clamp(28px, 4vw, 40px); }

.recipe-card .rc-plate svg { width: 100%; height: 100%; display: block; }

/* ---- recipe links + allergen chips ---- */
a.meal-name { text-decoration: none; color: var(--ink); }
a.meal-name:hover { text-decoration: underline; text-underline-offset: 3px; }
a.meal-name.swapped { color: var(--green); }
.macro.allergen { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.macro.allergen.warn { background: #FCE8E4; border-color: #F0B4A8; color: #9A2B17; }
.rc-allergens { font-size: 13px; color: var(--muted); margin-top: 10px; }
.recipe-card h3 a { color: inherit; text-decoration: none; }
.recipe-card h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.swap-note a { color: inherit; font-weight: 700; }

.swap-note[hidden], .macro[hidden] { display: none !important; }
