/* Nutriario — sitio oficial. Paleta y tipografía alineadas con la app
   (lib/core/theme/app_theme.dart). Sin dependencias externas. */
:root {
  --bg: #FAF7EF;
  --surface: #FFFFFF;
  --surface-2: #F2EEE2;
  --ink: #3A4231;
  --ink-soft: #6B7461;
  --ink-faint: #8C947F;
  --line: #E3DECE;
  --green: #6C8B4B;
  --green-deep: #4E6B39;
  --green-soft: #EAF0DE;
  --clay: #C86C36;
  --clay-ink: #A9541F;
  --clay-soft: #FAE9DC;
  --heart: #E07A6B;

  /* Un color por sección, igual que AppColors.of() en la app. */
  --sec-alim: #7BA05B;
  --sec-hidr: #5AA6C4;
  --sec-mov: #C98A2E;
  --sec-sueno: #7C6FB0;
  --sec-bien: #D9628A;
  --sec-trat: #4F9A7C;
  --sec-dig: #B87849;

  --shadow: 0 1px 2px rgba(58, 66, 49, .05), 0 20px 44px rgba(58, 66, 49, .10);
  --shadow-sm: 0 1px 2px rgba(58, 66, 49, .05), 0 6px 16px rgba(58, 66, 49, .07);
  --radius: 18px;
  --display: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14180F;
    --surface: #1D2217;
    --surface-2: #262C1F;
    --ink: #ECEFE3;
    --ink-soft: #A7AF9B;
    --ink-faint: #8A9280;
    --line: #303726;
    --green: #A2C077;
    --green-deep: #BDD79A;
    --green-soft: #253018;
    --clay: #E5A06A;
    --clay-ink: #EFB183;
    --clay-soft: #35251A;
    --heart: #E8907F;

    --sec-alim: #9CBF7C;
    --sec-hidr: #7FC3DC;
    --sec-mov: #E0A44E;
    --sec-sueno: #A196D2;
    --sec-bien: #EC93B2;
    --sec-trat: #7ECBAC;
    --sec-dig: #D8A375;

    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 24px 54px rgba(0, 0, 0, .55);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 18px rgba(0, 0, 0, .4);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green-deep); }
a:hover { color: var(--green); }
img, svg { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; letter-spacing: -.02em; }

.wrap { width: 100%; max-width: 1060px; margin: 0 auto; padding: 0 22px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Encabezado ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg); /* fallback si no hay color-mix() */
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 64px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink); font-family: var(--display);
}
.brand b { font-size: 1.14rem; font-weight: 800; letter-spacing: -.01em; }
.brand .mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 11px;
  background: linear-gradient(150deg, var(--green) 0%, var(--green-deep) 100%);
  box-shadow: var(--shadow-sm);
}
.brand .mark svg { width: 21px; height: 21px; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
  text-decoration: none; color: var(--ink-soft); font-size: .93rem;
  font-weight: 600; padding: 8px 11px; border-radius: 10px;
}
.nav a:hover { color: var(--green-deep); background: var(--green-soft); }
.nav a[aria-current="page"] { color: var(--green-deep); background: var(--green-soft); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 20px; border-radius: 13px; text-decoration: none;
  font-weight: 700; font-size: .97rem; border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary {
  background: var(--green-deep); color: #FFF; box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--green); color: #FFF; transform: translateY(-1px); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--green); color: var(--green-deep); }
.btn-store {
  background: var(--surface); color: var(--ink-soft);
  border: 1px dashed var(--line); cursor: default; font-weight: 600;
}
.btn-store:hover { transform: none; color: var(--ink-soft); }
.btn-store small { display: block; font-size: .72rem; font-weight: 500; opacity: .8; }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 40px; }
.hero .wrap {
  display: grid; grid-template-columns: 1.08fr .92fr; gap: 48px; align-items: center;
}
.eyebrow {
  margin: 0 0 12px; font-size: .78rem; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--clay-ink);
}
.hero h1 { margin: 0 0 16px; font-size: clamp(2rem, 4.6vw, 3rem); font-weight: 800; }
.lead { margin: 0 0 26px; font-size: 1.09rem; color: var(--ink-soft); max-width: 34em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.trust {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: .88rem; font-weight: 600; color: var(--green-deep);
  background: var(--green-soft); border-radius: 999px; padding: 8px 15px;
}
.trust svg { width: 16px; height: 16px; flex: none; }

/* ---------- Maqueta del teléfono (replica "Resumen semanal") ---------- */
.phone-wrap { display: grid; place-items: center; }
.phone {
  width: 100%; max-width: 296px; padding: 11px;
  background: linear-gradient(160deg, #3D4534, #262C20);
  border-radius: 40px; box-shadow: var(--shadow);
}
.phone .screen {
  background: var(--bg); border-radius: 30px; padding: 16px 15px 18px;
  border: 1px solid rgba(0, 0, 0, .08);
}
.screen-bar {
  display: flex; align-items: baseline; justify-content: center; gap: 6px;
  color: var(--ink-faint); font-size: .68rem; margin-bottom: 2px;
}
.screen-week {
  text-align: center; font-weight: 700; font-size: .87rem; margin-bottom: 12px;
}
.total-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px 12px; text-align: center; margin-bottom: 13px;
}
.total-card .score { font-family: var(--display); line-height: 1; }
.total-card .score b { font-size: 2.5rem; font-weight: 800; color: var(--green-deep); }
.total-card .score span { font-size: 1.25rem; color: var(--ink-faint); font-weight: 600; }
.total-card .band {
  margin: 7px 0 0; font-size: .76rem; font-weight: 700; color: var(--clay-ink);
}
.bars { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 18px 1fr 40px; gap: 8px; align-items: center; }
.bar-row .ico { width: 18px; height: 18px; color: var(--c); }
.bar-track {
  height: 11px; border-radius: 6px; overflow: hidden;
  background: color-mix(in srgb, var(--c) 18%, transparent);
}
.bar-fill { height: 100%; border-radius: 6px; background: var(--c); }
.bar-row .val {
  font-size: .7rem; font-weight: 700; text-align: right; color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.screen-foot {
  margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line); border-radius: 11px; padding: 9px;
  font-size: .74rem; font-weight: 700; color: var(--green-deep);
  background: var(--surface);
}
.screen-foot svg { width: 14px; height: 14px; }

/* ---------- Secciones ---------- */
section { scroll-margin-top: 80px; }
.band-alt { background: var(--surface-2); border-block: 1px solid var(--line); }
.block { padding: 62px 0; }
.block-head { max-width: 42em; margin-bottom: 34px; }
.block-head h2 { margin: 0 0 10px; font-size: clamp(1.55rem, 3vw, 2.1rem); }
.block-head p { margin: 0; color: var(--ink-soft); font-size: 1.03rem; }

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm);
}
.card h3 { margin: 0 0 6px; font-size: 1.06rem; }
.card p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.card .pill {
  display: inline-block; margin-top: 12px; font-size: .74rem; font-weight: 800;
  letter-spacing: .04em; padding: 4px 10px; border-radius: 999px;
  color: var(--c, var(--green-deep));
  background: color-mix(in srgb, var(--c, var(--green)) 15%, transparent);
}
.card-ico {
  display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 13px; margin-bottom: 14px;
  color: var(--c, var(--green));
  background: color-mix(in srgb, var(--c, var(--green)) 14%, transparent);
}
.card-ico svg { width: 22px; height: 22px; }

/* Pasos numerados */
.steps { counter-reset: step; }
.step { position: relative; padding-left: 58px; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 22px; top: 22px;
  display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 9px; background: var(--green-deep); color: #FFF;
  font-family: var(--display); font-weight: 800; font-size: .95rem;
}

/* Lista con check */
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 13px; }
.checks li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; }
.checks svg { width: 22px; height: 22px; color: var(--green); margin-top: 3px; }
.checks b { display: block; }
.checks span { color: var(--ink-soft); font-size: .95rem; }

/* Nota / aviso */
.note {
  background: var(--clay-soft); border: 1px solid color-mix(in srgb, var(--clay) 35%, transparent);
  border-radius: 14px; padding: 16px 18px; color: var(--ink);
  font-size: .95rem;
}
.note b { color: var(--clay-ink); }

/* ---------- Páginas de texto legal / soporte ---------- */
.page { padding: 46px 0 70px; }
.page .wrap { max-width: 780px; }
.page h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 4vw, 2.5rem); }
.page .updated { margin: 0 0 30px; color: var(--ink-faint); font-size: .88rem; }
.page h2 {
  margin: 40px 0 12px; font-size: 1.28rem;
  padding-top: 22px; border-top: 1px solid var(--line);
}
.page h2:first-of-type { border-top: 0; padding-top: 0; }
.page h3 { margin: 26px 0 8px; font-size: 1.03rem; }
.page p, .page li { color: var(--ink-soft); }
.page p { margin: 0 0 14px; }
.page strong { color: var(--ink); }
.page ul, .page ol { margin: 0 0 16px; padding-left: 22px; }
.page li { margin-bottom: 8px; }
.page .tldr {
  background: var(--green-soft); border: 1px solid color-mix(in srgb, var(--green) 32%, transparent);
  border-radius: var(--radius); padding: 20px 22px; margin-bottom: 34px;
}
.page .tldr h2 { margin: 0 0 10px; border: 0; padding: 0; font-size: 1.1rem; color: var(--green-deep); }
.page .tldr p:last-child, .page .tldr ul:last-child { margin-bottom: 0; }
.page .tldr li { color: var(--ink); }

.table-wrap { overflow-x: auto; margin: 0 0 18px; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 420px; }
th, td { text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 700; color: var(--ink); background: var(--surface-2); }
td { color: var(--ink-soft); }

/* FAQ */
details {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 2px 18px; margin-bottom: 11px;
}
details[open] { box-shadow: var(--shadow-sm); }
summary {
  cursor: pointer; font-weight: 700; color: var(--ink);
  padding: 15px 0; list-style: none; display: flex; justify-content: space-between; gap: 14px;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+"; font-family: var(--display); font-size: 1.35rem; line-height: 1;
  color: var(--green); flex: none;
}
details[open] summary::after { content: "\2013"; }
details .body { padding: 0 0 16px; }
details .body p:last-child, details .body ul:last-child { margin-bottom: 0; }

/* Tarjeta de contacto */
.contact {
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm);
  margin-bottom: 34px;
}
.contact .who { flex: 1 1 260px; }
.contact .who p { margin: 4px 0 0; font-size: .93rem; }
.contact .mail {
  font-family: var(--display); font-size: 1.15rem; font-weight: 800;
  color: var(--green-deep); text-decoration: none; word-break: break-all;
}

/* CTA final */
.cta { padding: 56px 0; text-align: center; }
.cta h2 { margin: 0 0 10px; font-size: clamp(1.5rem, 3vw, 2rem); }
.cta p { margin: 0 auto 24px; color: var(--ink-soft); max-width: 40em; }
.cta .hero-cta { justify-content: center; }

/* ---------- Pie ---------- */
.site-footer {
  border-top: 1px solid var(--line); background: var(--surface-2);
  padding: 34px 0; font-size: .9rem; color: var(--ink-soft);
}
.site-footer .wrap {
  display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 18px; }
.site-footer a { color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.site-footer a:hover { color: var(--green-deep); text-decoration: underline; }
.site-footer .legal { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .hero { padding: 36px 0 26px; }
  .hero .wrap { grid-template-columns: 1fr; gap: 34px; }
  .phone-wrap { order: -1; }
  .block { padding: 46px 0; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .site-header .wrap { min-height: 58px; }
  .nav a { padding: 7px 9px; font-size: .88rem; }
}
@media (max-width: 420px) {
  .nav { gap: 0; }
  .btn { width: 100%; }
}
