:root {
  --red: #e03e27;
  --red-dark: #c23520;
  --dark: #1e3b55;
  --dark-2: #274968;
  --gray: #64748b;
  --muted: #94a3b8;
  --line: #e2e8f0;
  --light: #f4f6f8;
  --white: #ffffff;
  --green: #22c55e;
  --amber: #f59e0b;
  --blue: #3b82f6;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--light);
  color: var(--dark);
  line-height: 1.55;
}
a { text-decoration: none; color: inherit; }
.container { width: min(1120px, 92%); margin: 0 auto; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: .88rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 10px;
  font-weight: 700; font-size: .95rem; border: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); box-shadow: 0 10px 22px rgba(224,62,39,.35); }
.btn-whatsapp { background: #25D366; color: #fff; }
.btn-whatsapp:hover { background: #1ebe5a; box-shadow: 0 10px 22px rgba(37,211,102,.35); }
.btn-ghost { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.45); padding: 9px 16px; }
.btn-ghost:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.btn-ghost-dark { background: transparent; color: var(--dark); border: 2px solid var(--line); }
.btn-ghost-dark:hover { border-color: var(--gray); }

/* Navbar */
.navbar { position: sticky; top: 0; z-index: 50; background: var(--dark); box-shadow: 0 4px 18px rgba(0,0,0,.25); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; line-height: 1.1; }
.brand-icon { font-size: 1.6rem; color: var(--red); }
.brand-lockup { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.brand-name { font-family: 'Luckiest Guy', sans-serif; font-weight: 400; font-size: 1.5rem; text-transform: uppercase; letter-spacing: .03em; }
.b-body { color: #ffa07a; }
.b-graph { color: #ff5722; }
.brand-sub { font-size: .68rem; font-weight: 700; color: #dbe4ea; font-family: 'Cinzel', serif; text-transform: uppercase; letter-spacing: .16em; margin-top: 3px; }
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a:not(.btn) { color: #fde047; font-weight: 600; font-size: 1rem; }
.nav-links a:not(.btn):hover { color: #fff; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-2) 60%, #2f5a7d 100%);
  color: #fff; padding: 54px 0 60px;
}
.hero-tag { color: var(--red); font-weight: 800; letter-spacing: .12em; font-size: .78rem; margin-bottom: 10px; }
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 3rem); line-height: 1.1; font-weight: 900; }
.hero h1 span { color: #ff5722; }
.hero-sub { margin-top: 14px; max-width: 640px; color: #cbd8e4; font-size: 1.02rem; }

/* Layout */
.section { padding: 40px 0 56px; }
.planner-grid { display: grid; grid-template-columns: 420px 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .planner-grid { grid-template-columns: 1fr; } }

.card {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 24px; box-shadow: 0 6px 22px rgba(30,59,85,.06);
}
.card-title { font-size: 1.15rem; font-weight: 800; color: var(--dark); display: flex; align-items: center; gap: 9px; margin-bottom: 18px; }
.card-title i { color: var(--red); }

/* Form */
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .row { grid-template-columns: 1fr; } }
.field { margin-bottom: 14px; display: flex; flex-direction: column; }
.field label { font-size: .82rem; font-weight: 700; color: var(--dark-2); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: .95rem; color: var(--dark); background: #fbfcfd;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--red); background: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* Results */
.result { min-height: 260px; }
.result-empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.result-empty i { font-size: 2.6rem; color: #cbd5e1; margin-bottom: 14px; }
.result-empty p { font-weight: 700; color: var(--dark-2); }
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.result-head .card-title { margin-bottom: 0; }
.target-badge { background: linear-gradient(135deg, var(--red), #ff7a3c); color: #fff; border-radius: 14px; padding: 10px 20px; text-align: center; }
.target-num { display: block; font-size: 1.9rem; font-weight: 900; line-height: 1; }
.target-label { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .92; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
@media (max-width: 620px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--light); border-radius: 12px; padding: 12px 14px; }
.stat span { display: block; font-size: .74rem; color: var(--gray); font-weight: 600; }
.stat b { font-size: 1.05rem; color: var(--dark); }

.sub-title { margin: 24px 0 12px; font-size: 1rem; font-weight: 800; color: var(--dark); display: flex; align-items: center; gap: 8px; }
.sub-title i { color: var(--red); }

.macro-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.macro { border-radius: 12px; padding: 14px; text-align: center; color: #fff; }
.macro b { display: block; font-size: 1.35rem; font-weight: 900; }
.macro span { font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; opacity: .95; }
.macro-p { background: linear-gradient(135deg, #ef4444, #f97316); }
.macro-c { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.macro-f { background: linear-gradient(135deg, #f59e0b, #eab308); }

.macro-bars { display: flex; height: 8px; border-radius: 6px; overflow: hidden; margin-top: 10px; background: var(--line); }
.bar { flex: 1; }
.bar i { display: block; height: 100%; }
.bar-p { background: #ef4444; }
.bar-c { background: #3b82f6; }
.bar-f { background: #f59e0b; }

/* Meal chart */
.meal-chart { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.meal-row { display: grid; grid-template-columns: 150px 1fr 90px; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); align-items: center; }
.meal-row:last-child { border-bottom: none; }
.meal-row:nth-child(even) { background: #fafbfc; }
.meal-time { font-weight: 800; color: var(--dark); font-size: .86rem; }
.meal-time small { display: block; color: var(--muted); font-weight: 600; font-size: .72rem; }
.meal-items { font-size: .9rem; color: var(--dark-2); }
.meal-items .qty { font-weight: 800; color: var(--red); }
.meal-kcal { text-align: right; font-weight: 800; color: var(--dark); font-size: .88rem; }
.meal-kcal small { display: block; color: var(--muted); font-weight: 600; font-size: .7rem; }
@media (max-width: 560px) {
  .meal-row { grid-template-columns: 1fr 70px; }
  .meal-time { grid-column: 1 / -1; }
  .meal-items { grid-column: 1; }
}

.plan-meta { margin: 14px 0 4px; color: var(--gray); font-size: .85rem; }
.plan-meta i { color: var(--blue); }

/* Disclaimer */
.disclaimer { margin-top: 26px; background: #fff8e6; border: 1px solid #f5d78e; border-radius: 12px; padding: 14px 18px; color: #8a6d1f; font-size: .86rem; }
.disclaimer i { color: var(--amber); }

/* Footer */
.footer { background: var(--dark); color: #cbd8e4; text-align: center; padding: 26px 0; }
.footer a { color: #fde047; }
.footer .muted { color: #94a3b8; margin-top: 6px; }

/* Print / PDF */
@media print {
  .navbar, .hero, .footer, .actions, .disclaimer, #resultEmpty { display: none !important; }
  body { background: #fff; }
  .section { padding: 0; }
  .planner-grid { display: block; }
  .card { box-shadow: none; border: none; padding: 0; }
  .card:first-child { display: none; } /* hide the input form when printing */
  .result { display: block !important; }
  .target-badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .macro, .stat, .meal-row:nth-child(even) { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
