/* PesoRadar — hoja de estilo propia
   Paleta: verde salvia + coral suave + blanco. Mobile-first. */

:root {
  --sage: #7fa88f;
  --sage-dark: #4f7361;
  --sage-deep: #395446;
  --sage-tint: #eaf1ec;
  --sage-tint-2: #dbe7de;
  --coral: #ef8a7a;
  --coral-dark: #d9634f;
  --coral-tint: #fdeae5;
  --ink: #263330;
  --muted: #5e6d68;
  --line: #d8e2db;
  --white: #ffffff;
  --bg: #f6faf7;
  --warn-bg: #fff6ec;
  --warn-border: #f2c48a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(57, 84, 70, 0.08);
  --shadow-lg: 0 12px 40px rgba(57, 84, 70, 0.14);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Nunito", "Quicksand",
    system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

img { max-width: 100%; height: auto; }

a { color: var(--sage-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 250, 247, 0.92);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--sage-deep);
  letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand .logo {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--sage) 0%, var(--sage-dark) 100%);
  color: #fff; font-size: 1.05rem;
}
.brand b { color: var(--coral-dark); }

.nav-toggle {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 12px;
  cursor: pointer;
  color: var(--sage-deep);
}
.nav-toggle:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }

.main-nav ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; gap: 4px; flex-wrap: wrap;
}
.main-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--sage-deep);
  font-weight: 600;
  font-size: 0.97rem;
}
.main-nav a:hover { background: var(--sage-tint); text-decoration: none; }
.main-nav a[aria-current="page"] { background: var(--sage-tint-2); color: var(--sage-deep); }

@media (max-width: 860px) {
  .main-nav {
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    display: none;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; padding: 10px 16px; }
  .main-nav a { padding: 12px 10px; }
}
@media (min-width: 861px) {
  .nav-toggle { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(900px 300px at 85% -10%, var(--coral-tint), transparent 60%),
    linear-gradient(180deg, var(--sage-tint) 0%, var(--bg) 100%);
  padding: 48px 0 36px;
}
.hero h1 {
  font-size: clamp(1.9rem, 6vw, 3rem);
  line-height: 1.1;
  margin: 0 0 14px;
  letter-spacing: -0.03em;
  color: var(--sage-deep);
}
.hero h1 .accent { color: var(--coral-dark); }
.hero p.lead {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 640px;
  margin: 0 0 22px;
}
.hero .badges {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 8px;
}
.badge {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sage-dark);
  box-shadow: var(--shadow);
}

/* ---------- Sections ---------- */
main { padding: 8px 0 40px; }
section { padding: 30px 0; }
h2 {
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  letter-spacing: -0.02em;
  color: var(--sage-deep);
  margin: 0 0 16px;
}
h3 { font-size: 1.2rem; color: var(--sage-deep); margin: 22px 0 8px; }
p { margin: 0 0 14px; }

.section-intro { color: var(--muted); max-width: 680px; }

/* ---------- Cards grid ---------- */
.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 620px) { .grid.cols-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 780px) { .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
  display: flex; flex-direction: column;
}
a.card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card .icon {
  font-size: 1.8rem;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: var(--sage-tint);
  margin-bottom: 12px;
}
.card h3 { margin: 0 0 6px; }
.card p { color: var(--muted); font-size: 0.97rem; margin: 0; }
.card .cta { margin-top: 14px; font-weight: 700; color: var(--coral-dark); }

/* ---------- Tool / calculator ---------- */
.tool {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 24px;
}
@media (min-width: 720px) { .tool { padding: 30px; } }

.tool h2 { margin-top: 0; }

.field-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) { .field-grid.two { grid-template-columns: 1fr 1fr; } }

.field label {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: var(--sage-deep);
}
.field .hint { font-weight: 500; color: var(--muted); font-size: 0.82rem; }

input[type="number"], input[type="text"], select {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  appearance: none;
}
input:focus, select:focus {
  outline: 3px solid var(--coral);
  outline-offset: 1px;
  border-color: var(--coral);
  background: #fff;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234f7361' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 700; color: var(--sage-deep); font-size: 0.95rem; margin-bottom: 6px; }
.radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.radio-pill {
  position: relative;
  flex: 1 1 auto;
  min-width: 90px;
}
.radio-pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.radio-pill span {
  display: block;
  text-align: center;
  padding: 11px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.radio-pill input:checked + span {
  background: var(--sage-tint-2);
  border-color: var(--sage);
  color: var(--sage-deep);
}
.radio-pill input:focus-visible + span { outline: 3px solid var(--coral); outline-offset: 2px; }

.btn {
  display: inline-block;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: 1.02rem;
  padding: 14px 22px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-dark) 100%);
  box-shadow: 0 8px 20px rgba(217, 99, 79, 0.28);
  transition: filter .15s ease, transform .1s ease;
}
.btn:hover { filter: brightness(1.05); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--sage-deep); outline-offset: 3px; }
.btn.full { width: 100%; }
.btn.secondary {
  background: var(--white);
  color: var(--sage-deep);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.form-actions { margin-top: 22px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Result ---------- */
.result {
  margin-top: 24px;
  padding: 22px;
  border-radius: var(--radius);
  background: var(--sage-tint);
  border: 1px solid var(--sage-tint-2);
}
.result[hidden] { display: none; }
.result .big {
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 800;
  line-height: 1;
  color: var(--sage-deep);
  letter-spacing: -0.03em;
}
.result .big small { font-size: 1rem; font-weight: 600; color: var(--muted); }
.result .verdict {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 14px;
  border-radius: 999px;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--line);
}
.result .detail-grid {
  display: grid; gap: 12px; margin-top: 18px;
  grid-template-columns: 1fr;
}
@media (min-width: 520px) { .result .detail-grid.three { grid-template-columns: repeat(3,1fr); } }
.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  text-align: center;
}
.stat .k { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 1.4rem; font-weight: 800; color: var(--sage-deep); }
.stat .v small { font-size: .8rem; font-weight: 600; color: var(--muted); }

/* ---------- Gauge (IMC) ---------- */
.gauge {
  margin-top: 18px;
}
.gauge-bar {
  position: relative;
  height: 20px;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(90deg,
    #6fb1c9 0 18%,   /* bajo peso */
    #7fbf7f 18% 42%, /* normal */
    #f2c14e 42% 62%, /* sobrepeso */
    #ef8a5a 62% 82%, /* obesidad I-II */
    #d9634f 82% 100% /* obesidad III */
  );
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
}
.gauge-needle {
  position: absolute;
  top: -6px;
  width: 4px; height: 32px;
  background: var(--ink);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: left .5s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 0 0 2px #fff;
}
.gauge-scale {
  display: flex; justify-content: space-between;
  font-size: 0.72rem; color: var(--muted);
  margin-top: 6px;
}

/* ---------- Disclaimer ---------- */
.disclaimer {
  display: flex; gap: 12px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 22px 0;
  font-size: 0.92rem;
  color: #7a5a2e;
}
.disclaimer .ico { font-size: 1.3rem; line-height: 1.4; }
.disclaimer strong { color: #6b4a1e; }

/* ---------- Prose (guides / legal) ---------- */
.prose { max-width: 760px; }
.prose h2 { margin-top: 34px; }
.prose h3 { margin-top: 24px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 16px; }
.prose li { margin-bottom: 6px; }
.prose blockquote {
  margin: 18px 0;
  padding: 12px 18px;
  border-left: 4px solid var(--sage);
  background: var(--sage-tint);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--sage-deep);
}
.prose table {
  width: 100%; border-collapse: collapse; margin: 18px 0;
  font-size: 0.94rem;
}
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.prose th { background: var(--sage-tint); color: var(--sage-deep); }

/* ---------- FAQ ---------- */
.faq details {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px 18px;
  margin-bottom: 10px;
}
.faq summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--sage-deep);
  padding: 12px 0;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; font-size: 1.3rem; color: var(--coral-dark); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding-bottom: 12px; margin: 0; color: var(--muted); }

/* ---------- Ad slot ---------- */
.adslot {
  margin: 26px auto;
  min-height: 90px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  color: #b6c4bd;
  font-size: 0.8rem;
  background: repeating-linear-gradient(45deg, #fbfdfc, #fbfdfc 10px, #f3f7f4 10px, #f3f7f4 20px);
}

/* ---------- Breadcrumb ---------- */
.crumbs { font-size: 0.85rem; color: var(--muted); padding: 16px 0 0; }
.crumbs a { color: var(--sage-dark); }

/* ---------- Related / callout ---------- */
.callout {
  background: linear-gradient(135deg, var(--sage-tint) 0%, var(--coral-tint) 130%);
  border: 1px solid var(--sage-tint-2);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}
.callout h2 { margin-top: 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--sage-deep);
  color: #d6e4db;
  padding: 40px 0 24px;
  margin-top: 30px;
}
.site-footer a { color: #eaf1ec; }
.footer-grid {
  display: grid; gap: 24px;
  grid-template-columns: 1fr;
}
@media (min-width: 680px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-grid h4 { color: #fff; margin: 0 0 10px; font-size: 1rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 7px; }
.footer-brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.15rem; color: #fff; margin-bottom: 8px; }
.footer-disclaimer {
  margin-top: 26px; padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.15);
  font-size: 0.82rem; color: #b9cdc1;
}
.footer-bottom {
  margin-top: 16px; font-size: 0.8rem; color: #a9c0b4;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  z-index: 100;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 18px;
  display: none;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.cookie-banner.show { display: flex; }
.cookie-banner p { margin: 0; flex: 1 1 260px; font-size: 0.9rem; color: var(--muted); }
.cookie-banner .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cookie-banner .btn { padding: 10px 18px; font-size: 0.92rem; }
@media (min-width: 620px) { .cookie-banner { left: auto; right: 20px; max-width: 460px; } }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.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;
}
.error-page { text-align: center; padding: 80px 0; }
.error-page .code { font-size: clamp(4rem, 20vw, 9rem); font-weight: 800; color: var(--sage); line-height: 1; letter-spacing: -0.04em; }
.field-error { color: var(--coral-dark); font-size: 0.85rem; font-weight: 600; margin-top: 6px; }
