:root {
  --verde: #1f8a4c;
  --verde-oscuro: #0e3b25;
  --verde-suave: #eef7f1;
  --tinta: #14211a;
  --gris: #4d5b53;
  --linea: #d9e4dc;
  --blanco: #fff;
  --radio: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--tinta);
  background: var(--blanco);
  line-height: 1.6;
}
img, svg { max-width: 100%; }
a { color: var(--verde); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); }
h2.small { font-size: 1rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gris); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.narrow { max-width: 720px; }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px 12px; z-index: 100; }

:focus-visible { outline: 3px solid #f5b700; outline-offset: 2px; }

/* Botones */
.btn {
  display: inline-block; padding: .75em 1.4em; border-radius: 999px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 2px solid transparent;
}
.btn-primary { background: var(--verde); color: #fff; }
.btn-primary:hover { background: #17703d; }
.btn-outline { border-color: var(--verde); color: var(--verde); background: transparent; }
.btn-outline:hover { background: var(--verde-suave); }
.btn-dark { background: var(--verde-oscuro); color: #fff; }
.btn-dark:hover { background: #072616; }
.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }

/* Cabecera */
.site-header { position: sticky; top: 0; background: #fff; border-bottom: 1px solid var(--linea); z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--tinta); font-weight: 700; }
.nav { display: flex; align-items: center; gap: 24px; }
.nav > ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav button { background: none; border: 0; font: inherit; font-weight: 500; color: var(--tinta); padding: 10px 12px; cursor: pointer; border-radius: 8px; }
.nav button:hover { background: var(--verde-suave); }
.has-sub { position: relative; }
.sub { display: none; position: absolute; top: 100%; left: 0; min-width: 240px; background: #fff; border: 1px solid var(--linea); border-radius: var(--radio); padding: 8px; list-style: none; margin: 0; box-shadow: 0 12px 30px rgba(0,0,0,.08); }
.has-sub.open .sub { display: block; }
.sub a { display: block; padding: 8px 12px; text-decoration: none; color: var(--tinta); border-radius: 8px; }
.sub a:hover { background: var(--verde-suave); color: var(--verde); }
.nav-actions { display: flex; align-items: center; gap: 16px; }
.link-quiet { color: var(--gris); text-decoration: none; font-size: .95rem; }
.link-quiet:hover { text-decoration: underline; }
.menu-toggle { display: none; border: 1px solid var(--linea) !important; }

/* Hero */
.hero { background: var(--verde-oscuro); color: #fff; padding: clamp(56px, 10vw, 110px) 0; text-align: center; }
.hero h1 { max-width: 16ch; margin-inline: auto; }
.check { display: flex; gap: 10px; max-width: 560px; margin: 2rem auto 0; }
.check input { flex: 1; padding: .9em 1.2em; border-radius: 999px; border: 0; font: inherit; }
.check-result { min-height: 1.6em; margin: 1rem 0 0; font-weight: 600; }
.check-result a { color: #fff; }
.veredicto { display: inline-block; padding: .35em 1em; border-radius: 999px; }
.veredicto.si { background: #2bb673; color: #062d19; }
.veredicto.no { background: #f5c04a; color: #3a2a00; }
.detalle { max-width: 560px; margin: 1rem auto 0; text-align: left; font-weight: 400; background: rgba(255,255,255,.08); border-radius: var(--radio); padding: 16px 20px; }
.carbon { margin-top: .5rem; font-weight: 400; }
.detalle .nota { font-size: .85rem; opacity: .8; }
.detalle .fila { margin: 0 0 .4em; }
.detalle ul { margin: 0 0 .4em; padding-left: 1.2em; }
.hint { font-size: .85rem; opacity: .7; margin-top: .5rem; }

/* Secciones */
.section { padding: clamp(48px, 8vw, 96px) 0; }
.lead { font-size: 1.2rem; color: var(--gris); }
.band { background: var(--verde-suave); }
.band-soft { background: #f7faf8; }
.split { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.split p { margin: 0; color: var(--gris); max-width: 56ch; }
.split h2 { margin-bottom: .3em; }

/* Tarjetas */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 2.5rem; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.card { border: 1px solid var(--linea); border-radius: var(--radio); padding: 28px; background: #fff; display: flex; flex-direction: column; align-items: flex-start; }
.card p { color: var(--gris); flex: 1; }
.card a { font-weight: 600; }
.card .btn { margin-top: .5rem; }
.tag { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--verde); background: var(--verde-suave); padding: 4px 10px; border-radius: 999px; margin-bottom: 1rem; }
.post time { font-size: .85rem; color: var(--gris); margin-bottom: .5rem; }
.post h3 a { color: var(--tinta); text-decoration: none; }
.post h3 a:hover { color: var(--verde); }
.row-head { display: flex; justify-content: space-between; align-items: baseline; }

.supporters { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 40px; font-weight: 700; color: var(--gris); font-size: 1.1rem; }

/* Impacto anual */
.impacto { max-width: 720px; margin: 1.5rem auto 0; text-align: left; background: rgba(255,255,255,.08); border-radius: var(--radio); padding: 24px; font-weight: 400; }
.impacto-titulo { font-size: 1.25rem; line-height: 1.5; margin: 0 0 1.2rem; }
.impacto-titulo label { display: inline-block; }
.impacto-titulo input { width: 7em; padding: .2em .5em; font: inherit; font-weight: 700; color: var(--verde-oscuro); background: #fff; border: 0; border-radius: 8px; text-align: center; }
.tarjetas { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.tarjeta { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; }
.tarjeta .icono { color: #7be3a8; line-height: 0; }
.tarjeta .cifra { font-size: 1.6rem; line-height: 1.2; color: #fff; }
.tarjeta .etiqueta { font-size: .9rem; opacity: .85; }
.impacto .nota { margin: 1rem 0 0; font-size: .8rem; opacity: .7; }

/* Sello */
.sello-form { display: flex; gap: 10px; max-width: 520px; margin: 1.5rem auto 0; }
.sello-form input { flex: 1; min-width: 0; padding: .8em 1.1em; border-radius: 999px; border: 1px solid var(--linea); font: inherit; }
.sello-tipo { border: 0; padding: 0; margin: 1rem 0 0; display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.sello-tipo label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.sello-error { color: #a23b00; min-height: 1.4em; margin: .8rem 0 0; }
.sello-salida { margin-top: 1rem; text-align: left; background: #fff; border: 1px solid var(--linea); border-radius: var(--radio); padding: 24px; }
.sello-vista { display: flex; align-items: center; justify-content: center; min-height: 64px; padding: 16px; margin-bottom: 1rem; background: var(--verde-suave); border-radius: 8px; text-align: center; }
.sello-estado { margin: 0; color: var(--gris); }
.sello-estado:empty { display: none; }
.sello-vista img[hidden], #sello-codigo-caja[hidden] { display: none; }
.sello-etiqueta { display: block; font-weight: 600; margin-bottom: .5rem; }
#sello-codigo { width: 100%; padding: 12px; border: 1px solid var(--linea); border-radius: 8px; font-family: ui-monospace, Menlo, monospace; font-size: .85rem; margin-bottom: 1rem; resize: vertical; }
@media (max-width: 600px) { .sello-form { flex-direction: column; } }

/* Metodología */
#calculo h3 { margin-top: 2rem; }
.pasos { padding-left: 1.3em; }
.pasos li { margin-bottom: .8em; color: var(--gris); }
.pasos strong { color: var(--tinta); }
.tabla-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--linea); }
th { background: var(--verde-suave); font-size: .9rem; }
.nota-pie { font-size: .9rem; color: var(--gris); margin-top: .8rem; }
.formula { background: var(--verde-suave); border-left: 4px solid var(--verde); padding: 16px 20px; border-radius: 8px; font-family: ui-monospace, Menlo, monospace; font-size: .95rem; }
.ejemplo li { margin-bottom: .4em; }
.fuentes { margin-top: 2rem; font-size: .9rem; color: var(--gris); }

.calc { background: #f7faf8; border: 1px solid var(--linea); border-radius: var(--radio); padding: 20px; }
.calc-campos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.calc label { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; font-weight: 600; }
.calc input[type="number"] { padding: .6em .8em; border: 1px solid var(--linea); border-radius: 8px; font: inherit; }
.calc .check-label { flex-direction: row; align-items: center; gap: 8px; grid-column: 1 / -1; }
.calc-salida { margin-top: 18px; }
.calc-total { font-size: 1.6rem; font-weight: 700; color: var(--verde); margin: 0 0 .5rem; }
.calc-salida table { background: #fff; }
@media (max-width: 600px) { .calc-campos { grid-template-columns: 1fr; } }

/* Pie */
.site-footer { background: var(--verde-oscuro); color: #d4e6db; padding: 64px 0 24px; }
.site-footer a { color: #fff; }
.site-footer h3 { color: #fff; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
address { font-style: normal; margin-bottom: 1rem; }
.newsletter { display: flex; gap: 8px; margin-bottom: .5rem; }
.newsletter input { flex: 1; min-width: 0; padding: .7em 1em; border-radius: 999px; border: 0; font: inherit; }
.badge { display: inline-block; border: 1px solid #4b7a61; border-radius: 8px; padding: 8px 12px; font-size: .9rem; }
.links { list-style: none; padding: 0; }
.legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid #23573b; font-size: .85rem; opacity: .8; }
.check-result.light { color: #fff; }

/* Móvil */
@media (max-width: 900px) {
  .menu-toggle { display: block; }
  .nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--linea); flex-direction: column; align-items: stretch; padding: 12px 16px 20px; max-height: calc(100vh - 68px); overflow: auto; }
  .nav.open { display: flex; }
  .nav > ul { flex-direction: column; }
  .nav button { width: 100%; text-align: left; }
  .sub { position: static; box-shadow: none; border: 0; }
  .nav-actions { justify-content: space-between; }
  .grid, .grid.two, .footer-grid { grid-template-columns: 1fr; }
  .split { flex-direction: column; align-items: flex-start; }
  .check, .newsletter { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
