:root {
  --bg: #0e1430;
  --bg-card: #161e44;
  --bg-card-2: #1d2752;
  --accent: #ff7a3d;     /* fuego */
  --accent-2: #ffd23f;   /* chispa */
  --sea: #29c7c2;        /* mar */
  --text: #f3f4fb;
  --muted: #9aa3c7;
  --ok: #4ade80;
  --err: #ff6b6b;
  --line: rgba(255, 255, 255, 0.1);
  --radius: 18px;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}

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

body {
  font-family: "Nunito", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(255, 122, 61, 0.22), transparent 70%),
    radial-gradient(40% 40% at 85% 30%, rgba(41, 199, 194, 0.16), transparent 70%),
    radial-gradient(50% 50% at 10% 80%, rgba(255, 210, 63, 0.1), transparent 70%);
}

h1, h2, h3, .kicker { font-family: "Fredoka", sans-serif; font-weight: 600; }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 64px 20px 40px;
  background: linear-gradient(180deg, rgba(255, 122, 61, 0.12), transparent);
}
.hero-inner { max-width: 720px; margin: 0 auto; }
.kicker {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-2);
  font-size: 0.8rem;
  margin-bottom: 10px;
}
.hero h1 {
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  font-weight: 700;
  margin-bottom: 14px;
  line-height: 1.1;
}
.subtitle { color: var(--muted); font-size: 1.05rem; max-width: 620px; margin: 0 auto; }
.hero-chips {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 24px;
}
.chip {
  background: var(--bg-card);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
}

/* ---------- Layout ---------- */
main { max-width: 760px; margin: 0 auto; padding: 10px 18px 60px; }

.card-block {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.card-block h2 {
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.step {
  display: inline-grid;
  place-items: center;
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a1300;
  border-radius: 50%;
  font-size: 0.95rem;
  font-weight: 700;
  flex-shrink: 0;
}
.meal-desc { color: var(--muted); margin-bottom: 18px; }

/* ---------- Campos ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
input[type="text"], textarea {
  width: 100%;
  background: var(--bg-card-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 1rem;
}
input[type="text"]:focus, textarea:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

/* ---------- Dieta ---------- */
.diet { border: none; margin-top: 6px; }
.diet legend { font-weight: 700; margin-bottom: 10px; }
.diet-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-card-2);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
  transition: all 0.15s;
}
.pill:has(input:checked) {
  background: rgba(41, 199, 194, 0.18);
  border-color: var(--sea);
}
.pill input { accent-color: var(--sea); }
.hint { color: var(--muted); font-size: 0.85rem; margin-top: 10px; }

/* ---------- Opciones de menú ---------- */
.options { display: grid; gap: 14px; }
.option-card {
  display: block;
  background: var(--bg-card-2);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
}
.option-card:hover { border-color: rgba(255, 122, 61, 0.5); transform: translateY(-2px); }
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.option-card.selected {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(255, 122, 61, 0.14), var(--bg-card-2));
  box-shadow: 0 0 0 3px rgba(255, 122, 61, 0.18);
}
.option-card.diet-match { box-shadow: inset 0 0 0 1px var(--ok); }
.option-card.diet-adapt { opacity: 0.82; }

.option-head { display: flex; align-items: flex-start; gap: 14px; }
.option-emoji { font-size: 1.8rem; line-height: 1; }
.option-head h3 { font-size: 1.15rem; font-weight: 600; }
.option-head p { color: var(--muted); font-size: 0.92rem; }
.option-price {
  margin-left: auto;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  color: var(--accent-2);
  font-size: 1.15rem;
  white-space: nowrap;
}
.option-price small { display: block; color: var(--muted); font-size: 0.65rem; text-align: right; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}
.tag-gluten { background: rgba(255, 210, 63, 0.2); color: var(--accent-2); }
.tag-lactosa { background: rgba(41, 199, 194, 0.2); color: var(--sea); }
.tag-veg { background: rgba(74, 222, 128, 0.18); color: var(--ok); }
.tag-vegano { background: rgba(74, 222, 128, 0.28); color: var(--ok); }
.tag-none { background: rgba(255, 255, 255, 0.06); color: var(--muted); font-weight: 600; }

.item-list { list-style: none; display: grid; gap: 6px; }
.item-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 7px 0;
  border-top: 1px dashed var(--line);
  font-size: 0.92rem;
}
.item-name em { color: var(--muted); font-style: normal; font-size: 0.85rem; }
.item-price { color: var(--text); font-weight: 700; }
.item-note {
  grid-column: 1 / -1;
  color: var(--sea);
  font-size: 0.8rem;
}

/* ---------- Tarjeta "Sin plan" ---------- */
.none-card { border-style: dashed; }

/* ---------- Extras a la carta (se suman al plan) ---------- */
.extras-block {
  margin-top: 14px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.extras-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-card-2);
  border: none;
  color: var(--text);
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  padding: 14px 18px;
  cursor: pointer;
}
.extras-toggle small { color: var(--muted); font-weight: 400; }
.extras-toggle::after {
  content: "▾";
  margin-left: auto;
  transition: transform 0.2s;
  color: var(--muted);
}
.extras-block.open .extras-toggle::after { transform: rotate(180deg); }
.extras-summary { color: var(--accent-2); font-weight: 700; font-size: 0.9rem; }

.extras-items {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px 16px;
}
.extras-block.open .extras-items { display: grid; }

.custom-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 2px 10px;
  padding: 9px 12px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: border-color 0.15s, background 0.15s;
}
.custom-item:hover { border-color: rgba(255, 122, 61, 0.5); }
.custom-item:has(input:checked:not(:disabled)) {
  border-color: var(--accent);
  background: rgba(255, 122, 61, 0.1);
}
.custom-item input { accent-color: var(--accent); width: 18px; height: 18px; }
.ci-name em { color: var(--muted); font-style: normal; font-size: 0.82rem; }
.ci-price { font-weight: 700; color: var(--accent-2); white-space: nowrap; }
.custom-item .item-note { grid-column: 2 / -1; margin-top: 2px; }

/* Elemento ya incluido en el plan elegido */
.ci-badge { display: none; }
.custom-item.included {
  cursor: default;
  opacity: 0.75;
  border-style: dashed;
  background: rgba(74, 222, 128, 0.07);
}
.custom-item.included .ci-price { display: none; }
.custom-item.included .ci-badge {
  display: inline-block;
  grid-column: 3;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ok);
  background: rgba(74, 222, 128, 0.15);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .extras-items { grid-template-columns: 1fr; }
}

/* ---------- Overlay de resumen ---------- */
body.modal-open { overflow: hidden; }
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(6, 9, 24, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 30px 16px;
  overflow-y: auto;
}
.overlay[hidden] { display: none; }
.review-panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 640px;
  width: 100%;
  padding: 28px;
  position: relative;
  animation: pop 0.18s ease;
}
@keyframes pop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.review-panel h2 { font-size: 1.5rem; margin-bottom: 6px; }
.overlay-close {
  position: absolute;
  top: 16px; right: 16px;
  background: var(--bg-card-2);
  border: 1px solid var(--line);
  color: var(--text);
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
}

.review-who {
  background: var(--bg-card-2);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 16px 0;
}
.review-who p { margin-bottom: 4px; }
.review-diet, .review-notes { color: var(--muted); font-size: 0.92rem; }

.review-meal {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
.review-meal-head {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 1rem; margin-bottom: 8px;
}
.review-meal-price { color: var(--accent-2); font-weight: 700; white-space: nowrap; }
.review-meal ul { list-style: none; display: grid; gap: 5px; }
.review-meal li {
  display: flex; justify-content: space-between; gap: 12px;
  font-size: 0.88rem; color: var(--muted);
}
.review-meal li em { font-style: normal; }

.review-total {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; padding-top: 14px;
  border-top: 2px solid var(--line);
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
}
.review-total span:last-child { color: var(--accent); font-size: 1.5rem; }

.review-actions {
  display: flex; gap: 12px; margin-top: 22px;
}
.btn-secondary, .btn-primary {
  flex: 1;
  border-radius: 14px;
  padding: 15px;
  font-family: "Fredoka", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
}
.btn-secondary {
  background: var(--bg-card-2);
  border: 1px solid var(--line);
  color: var(--text);
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  color: #1a1300;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.05); }
.btn-primary:disabled, .btn-secondary:disabled { opacity: 0.6; cursor: not-allowed; }

@media (max-width: 520px) {
  .review-actions { flex-direction: column-reverse; }
}

/* ---------- Resumen ---------- */
.summary { position: sticky; bottom: 0; }
.summary-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
}
.summary-row.pending { color: var(--muted); }
.total-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 16px; padding-top: 14px;
  border-top: 2px solid var(--line);
  font-size: 1.05rem;
}
.total-cost {
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 1.8rem;
  color: var(--accent);
}

#submit-btn {
  width: 100%;
  margin-top: 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a1300;
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-family: "Fredoka", sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, filter 0.15s;
}
#submit-btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.05); }
#submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.form-status { margin-top: 14px; text-align: center; font-weight: 700; min-height: 1.2em; }
.form-status.ok { color: var(--ok); }
.form-status.err { color: var(--err); }
.form-status code {
  background: var(--bg-card-2);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.85em;
}

/* ---------- Lista de la compra ---------- */
.shopping-list { list-style: none; display: grid; gap: 4px; margin-top: 12px; }
.shopping-list li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 12px;
  background: var(--bg-card-2);
  border-radius: 8px;
  font-size: 0.92rem;
}
.shopping-list li small { color: var(--muted); }
.shopping-list .empty { color: var(--muted); justify-content: center; background: transparent; }
.shopping-list .divider {
  background: transparent;
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  color: var(--accent-2);
  margin-top: 12px;
  padding-bottom: 0;
}
.shopping-list .extra { background: rgba(41, 199, 194, 0.08); }

/* ---------- Footer ---------- */
footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 30px 20px 50px;
}

@media (max-width: 520px) {
  .card-block { padding: 20px 16px; }
  .option-head { flex-wrap: wrap; }
  .option-price { margin-left: 0; }
}
