/* ─────────────────────────────────────────────
   dieta.css  –  Plan diety page styles
   ───────────────────────────────────────────── */

/* Font overrides for this page */
body { font-family: 'DM Sans', sans-serif; }

/* ── VIEWS ── */
.view { display: none; }
.view.active { display: block; }

/* ════════════════════════════
   WIZARD HEADER (all steps)
════════════════════════════ */
.wizard-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 20px 40px 0;
}
.wh-inner { max-width: 780px; margin: 0 auto; }
.wh-title {
  font-family: 'Fraunces', serif;
  font-size: 22px; font-weight: 600;
  color: var(--text); margin-bottom: 4px;
}
.wh-sub { font-size: 13px; color: var(--text3); margin-bottom: 18px; }
.steps { display: flex; gap: 0; }
.step {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 0; margin-right: 32px;
  border-bottom: 2.5px solid transparent;
  cursor: default; transition: border-color .2s;
}
.step.done,
.step.active { border-bottom-color: var(--teal-dark); }
.step-num {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  background: #e5e7eb; color: var(--text3);
  transition: all .2s;
}
.step.done .step-num,
.step.active .step-num { background: var(--teal-dark); color: #fff; }
.step-label { font-size: 12.5px; font-weight: 600; color: var(--text3); }
.step.done .step-label,
.step.active .step-label { color: var(--teal-dark); }

/* ════════════════════════════
   STEP 1 — PREFERENCES
════════════════════════════ */
.pref-wrap { max-width: 780px; margin: 0 auto; padding: 32px 40px 60px; }

.pref-section { margin-bottom: 36px; }
.pref-label {
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--text3); margin-bottom: 14px;
}
.pref-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.pref-hint  { font-size: 12px; color: var(--text3); margin-bottom: 14px; }

/* Diet type cards */
.diet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.diet-card {
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 16px 12px 14px;
  cursor: pointer;
  transition: all .16s;
  text-align: center;
  background: var(--bg2);
}
.diet-card:hover { border-color: var(--teal-mid); }
.diet-card.sel { border-color: var(--teal-dark); background: var(--teal-light); }
.diet-icon { font-size: 28px; margin-bottom: 7px; }
.diet-name { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.diet-desc { font-size: 10.5px; color: var(--text3); line-height: 1.4; }

/* Meals count selector */
.meals-row { display: flex; gap: 8px; }
.meal-btn {
  width: 52px; height: 52px; border-radius: 12px;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: var(--text3);
  cursor: pointer; transition: all .15s;
  background: var(--bg2);
}
.meal-btn:hover { border-color: var(--teal-mid); color: var(--teal-dark); }
.meal-btn.sel { border-color: var(--teal-dark); background: var(--teal-light); color: var(--teal-dark); }

/* Tag pills */
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill {
  padding: 6px 14px; border-radius: 20px;
  border: 1.5px solid var(--border);
  font-size: 12.5px; font-weight: 500; color: var(--text2);
  cursor: pointer; background: var(--bg2); transition: all .14s;
}
.tag-pill:hover { border-color: var(--teal-mid); }
.tag-pill.sel { border-color: var(--teal-dark); background: var(--teal-light); color: var(--teal-dark); font-weight: 600; }
.tag-pill.excl.sel { border-color: #dc2626; background: #fee2e2; color: #dc2626; }

/* Calorie banner */
.kcal-banner {
  background: linear-gradient(135deg, #064e4e, #0a8f8f);
  border-radius: 14px;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.kcal-num { font-family: 'Fraunces', serif; font-size: 42px; font-weight: 700; color: #fff; line-height: 1; }
.kcal-unit { font-size: 14px; color: rgba(255,255,255,0.7); margin-top: 2px; }
.kcal-info { flex: 1; }
.kcal-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.6); margin-bottom: 4px; }
.kcal-desc { font-size: 13px; color: rgba(255,255,255,0.85); line-height: 1.5; }
.kcal-bars { display: flex; flex-direction: column; gap: 6px; min-width: 180px; }
.kcal-bar-row { display: flex; align-items: center; gap: 8px; font-size: 11px; color: rgba(255,255,255,0.7); }
.kcal-bar-bg  { flex: 1; height: 5px; border-radius: 3px; background: rgba(255,255,255,0.2); overflow: hidden; }
.kcal-bar-fill { height: 100%; border-radius: 3px; background: #fff; }

/* Generate button */
.gen-btn {
  width: 100%; padding: 15px;
  background: var(--teal-dark);
  color: #fff; border: none;
  border-radius: 12px;
  font-size: 15px; font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.gen-btn:hover { background: var(--teal); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(7,107,107,0.3); }

/* ════════════════════════════
   STEP 2 — GENERATING
════════════════════════════ */
.gen-wrap {
  max-width: 480px; margin: 0 auto;
  padding: 80px 40px;
  text-align: center;
}
.spinner {
  width: 60px; height: 60px;
  border: 4px solid var(--teal-light);
  border-top-color: var(--teal-dark);
  border-radius: 50%;
  margin: 0 auto 28px;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gen-title { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.gen-sub   { font-size: 13px; color: var(--text3); line-height: 1.6; margin-bottom: 32px; }
.gen-steps { text-align: left; display: inline-flex; flex-direction: column; gap: 12px; }
.gs {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: var(--text3); transition: color .3s;
}
.gs.done   { color: var(--green); }
.gs.active { color: var(--teal-dark); font-weight: 600; }
.gs-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border); flex-shrink: 0; transition: background .3s;
}
.gs.done .gs-dot   { background: var(--green); }
.gs.active .gs-dot { background: var(--teal-dark); animation: blink .7s ease-in-out infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ════════════════════════════
   STEP 3 — MEAL PLAN
════════════════════════════ */
.plan-wrap { max-width: 1080px; margin: 0 auto; padding: 0 40px 80px; }

/* Data sources banner */
.data-banner {
  background: linear-gradient(135deg, #042e2e 0%, #064e4e 50%, #076b6b 100%);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 24px 40px;
}
.data-banner-inner { max-width: 1080px; margin: 0 auto; }
.db-intro { margin-bottom: 18px; }
.db-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.4px;
  color: rgba(255,255,255,0.45); margin-bottom: 3px;
}
.db-title {
  font-family: 'Fraunces', serif;
  font-size: 18px; font-weight: 600; color: #fff;
}
.db-sources {
  display: grid;
  grid-template-columns: 1fr 1px 1fr 1px 1fr;
  gap: 0;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  overflow: hidden;
}
.db-divider { background: rgba(255,255,255,0.1); width: 1px; }
.db-source {
  padding: 18px 20px;
  display: flex; gap: 13px; align-items: flex-start;
}
.db-source-icon {
  font-size: 22px; flex-shrink: 0; margin-top: 1px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3));
}
.db-source-body { flex: 1; min-width: 0; }
.db-source-title { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 1px; }
.db-source-sub   { font-size: 10.5px; color: rgba(255,255,255,0.45); margin-bottom: 10px; }
.db-findings { display: flex; flex-direction: column; gap: 4px; }
.db-finding {
  font-size: 11.5px; line-height: 1.4;
  padding: 3px 8px; border-radius: 4px;
  display: flex; align-items: flex-start; gap: 5px;
}
.db-finding.alert { background: rgba(220,38,38,0.18); color: #fca5a5; border-left: 2px solid rgba(239,68,68,0.6); }
.db-finding.warn  { background: rgba(217,119,6,0.18);  color: #fcd34d; border-left: 2px solid rgba(245,158,11,0.6); }
.db-finding.ok    { background: rgba(22,163,74,0.15);  color: #86efac; border-left: 2px solid rgba(34,197,94,0.5); }

/* Plan header */
.plan-header {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 24px 40px;
  margin-bottom: 0;
}
.plan-header-inner { max-width: 1080px; margin: 0 auto; }
.ph-title { font-family: 'Fraunces', serif; font-size: 24px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.ph-sub   { font-size: 13px; color: var(--text3); margin-bottom: 18px; }

/* Macro summary bar */
.macro-row { display: grid; grid-template-columns: repeat(5,1fr); gap: 12px; }
.macro-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: center;
}
.macro-num  { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 700; color: var(--text); line-height: 1; }
.macro-unit { font-size: 10px; color: var(--text3); }
.macro-lbl  { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--text3); margin-top: 3px; }
.macro-bar  { height: 3px; border-radius: 2px; margin-top: 6px; }

/* Week tabs */
.week-tabs {
  display: flex; gap: 4px;
  padding: 20px 0 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}
.week-tab {
  padding: 9px 20px; border-radius: 8px 8px 0 0;
  font-size: 13px; font-weight: 600; color: var(--text3);
  cursor: pointer; transition: all .12s;
  border: 1px solid transparent;
  border-bottom: none;
  position: relative; bottom: -1px;
  background: transparent;
}
.week-tab:hover { color: var(--text2); background: #f0f0ed; }
.week-tab.active {
  background: var(--bg);
  border-color: var(--border);
  border-bottom-color: var(--bg);
  color: var(--teal-dark); font-weight: 700;
}

/* Day selector */
.day-nav {
  display: flex; gap: 6px; margin-bottom: 24px;
  overflow-x: auto; padding-bottom: 4px;
}
.day-btn {
  padding: 8px 16px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--text3);
  cursor: pointer; border: 1.5px solid var(--border);
  background: var(--bg2); transition: all .13s; white-space: nowrap;
  flex-shrink: 0;
}
.day-btn:hover { border-color: var(--teal-mid); color: var(--teal-dark); }
.day-btn.active { border-color: var(--teal-dark); background: var(--teal-light); color: var(--teal-dark); }

/* Day view */
.day-view { display: none; }
.day-view.active { display: block; }

/* Meal card */
.meal-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .16s;
}
.meal-card:hover { box-shadow: var(--shadow-md); }
.mc-head { display: flex; align-items: stretch; cursor: pointer; }

/* Photo */
.mc-photo {
  width: 160px; flex-shrink: 0;
  position: relative; overflow: hidden;
}
.mc-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.meal-card:hover .mc-photo img { transform: scale(1.04); }
.mc-photo-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 60%, rgba(255,255,255,0.05));
}

.mc-body {
  flex: 1; padding: 18px 20px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.mc-meal-type {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--text3); margin-bottom: 5px;
}
.mc-title {
  font-family: 'Fraunces', serif;
  font-size: 17px; font-weight: 600;
  color: var(--text); margin-bottom: 6px; line-height: 1.25;
}
.mc-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.mc-tag {
  padding: 3px 9px; border-radius: 4px;
  font-size: 10.5px; font-weight: 500;
  background: #f1f5f9; color: var(--text2);
}
.mc-macros-row { display: flex; gap: 16px; align-items: center; }
.mc-macro { text-align: center; }
.mc-macro-num { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1; }
.mc-macro-lbl { font-size: 9.5px; color: var(--text3); text-transform: uppercase; letter-spacing: .5px; }
.mc-macro-div { width: 1px; height: 24px; background: var(--border); }
.mc-kcal { margin-left: auto; display: flex; align-items: baseline; gap: 3px; }
.mc-kcal-num  { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 700; color: var(--teal-dark); }
.mc-kcal-unit { font-size: 11px; color: var(--text3); }

/* Expand chevron */
.mc-toggle {
  padding: 0 18px;
  display: flex; align-items: center;
  color: var(--text3); flex-shrink: 0;
}
.mc-toggle svg { transition: transform .22s; }
.meal-card.expanded .mc-toggle svg { transform: rotate(180deg); }

/* Recipe panel */
.mc-recipe {
  display: none;
  border-top: 1px solid var(--border);
  padding: 24px;
  background: #fafbf8;
}
.meal-card.expanded .mc-recipe { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }

.rec-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text3); margin-bottom: 12px;
}
.ingredients-list { list-style: none; }
.ingredients-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 0; border-bottom: 1px solid #f0f0ec;
  font-size: 13px; color: var(--text2);
}
.ingredients-list li:last-child { border-bottom: none; }
.ing-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--teal-dark); flex-shrink: 0; }
.ing-amount { font-size: 12px; font-weight: 600; color: var(--text3); margin-left: auto; white-space: nowrap; }

.steps-list { list-style: none; }
.steps-list li {
  display: flex; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid #f0f0ec;
  font-size: 13px; color: var(--text2); line-height: 1.55;
}
.steps-list li:last-child { border-bottom: none; }
.step-counter {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--teal-light); color: var(--teal-dark);
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}

/* Macro table in recipe */
.macro-table { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 16px; }
.mt-row { display: flex; align-items: center; gap: 12px; padding: 5px 0; font-size: 12.5px; color: var(--text2); }
.mt-name     { width: 90px; flex-shrink: 0; }
.mt-bar-wrap { flex: 1; height: 6px; border-radius: 3px; background: #e8eae6; overflow: hidden; }
.mt-bar-fill { height: 100%; border-radius: 3px; transition: width .4s ease; }
.mt-val      { width: 52px; text-align: right; font-weight: 600; color: var(--text); font-size: 13px; }

/* Day summary box */
.day-summary {
  background: var(--sand);
  border: 1px solid var(--sand2);
  border-radius: 14px;
  padding: 20px 24px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.ds-item { text-align: center; }
.ds-num  { font-family: 'Fraunces', serif; font-size: 20px; font-weight: 700; color: var(--text); }
.ds-unit { font-size: 9px; color: var(--text3); }
.ds-lbl  { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text3); margin-top: 2px; }

/* Shopping list button */
.shop-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 20px;
  background: var(--bg2); border: 1.5px solid var(--border);
  border-radius: 12px; cursor: pointer;
  font-size: 13.5px; font-weight: 600; color: var(--teal-dark);
  transition: all .15s; margin-bottom: 32px;
}
.shop-btn:hover { background: var(--teal-light); border-color: var(--teal-dark); }

/* Animations */
@keyframes fadeUp { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
.fu { animation: fadeUp .35s ease both; }
