/* Concepto: la fachada de A.S.I. — cielo del mural, lomas verdes, manos de colores
   y el azul marino del cartel institucional. Columna de relato + tarjeta de firma fija. */
:root {
  --navy: #13294b;        /* cartel institucional */
  --navy-2: #1d3d6e;
  --sky: #5aa6dc;         /* cielo del mural */
  --sky-soft: #e6f2fb;
  --leaf: #3d8b52;        /* lomas */
  --leaf-soft: #e7f3ea;
  --sun: #f3c623;         /* mano amarilla */
  --rose: #e0567d;        /* mano rosa */
  --paper: #f6f9fc;
  --surface: #ffffff;
  --text: #1b2433;
  --muted: #56657a;
  --line: #d9e2ed;
  --danger: #b4233c;

  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --f-hand: "Caveat", "Segoe Print", cursive;

  --s-1: clamp(2rem, 1.3rem + 3.2vw, 3.4rem);
  --s-2: clamp(1.45rem, 1.2rem + 1vw, 1.85rem);
  --s-3: 1.2rem;
  --radius: 14px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 1.075rem/1.62 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy-2); }
h1, h2, h3 { font-family: var(--f-display); color: var(--navy); line-height: 1.12; text-wrap: balance; margin: 0; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 6px; }

.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }

/* ---------- barra superior ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--navy); }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--navy); color: #fff; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--f-display); font-size: 1.05rem; }
.brand b { color: var(--sun); margin-right: 4px; }
.brand-mano { width: 22px; height: 26px; fill: var(--sun); }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 1.05rem/1 var(--f-body); text-decoration: none; cursor: pointer;
  background: var(--rose); color: #fff; border: 0; border-radius: 999px;
  padding: 15px 26px; min-height: 48px;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
  box-shadow: 0 2px 0 rgba(19, 41, 75, .18);
}
.btn:hover { background: #c94469; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .65; cursor: progress; }
.btn-sm { padding: 9px 18px; min-height: 38px; font-size: .95rem; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); }
.btn-ghost:hover { background: var(--sky-soft); }

/* ---------- intro ---------- */
.intro { padding-block: clamp(28px, 5vw, 56px) 22px; display: grid; gap: 16px; }
.eyebrow { font-size: .82rem; letter-spacing: .09em; text-transform: uppercase; color: var(--leaf); font-weight: 700; }
.intro h1 { font-size: var(--s-1); font-weight: 800; max-width: 20ch; letter-spacing: -0.01em; }
.para { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; color: var(--muted); font-size: .98rem; }
.para-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--navy); background: var(--sky-soft); padding: 3px 9px; border-radius: 6px; }

/* ---------- layout principal ---------- */
.layout {
  display: grid; gap: 28px 44px; align-items: start;
  grid-template-columns: minmax(0, 1fr) 380px;
  grid-template-areas: "media sign" "story sign";
  padding-bottom: 56px;
}
.media { grid-area: media; margin: 0; min-width: 0; }
.media img { border-radius: var(--radius); width: 100%; aspect-ratio: 1156 / 651; object-fit: cover; }
.media figcaption { margin-top: 10px; font-size: .92rem; color: var(--muted); }
.story { grid-area: story; min-width: 0; display: grid; gap: 36px; max-width: 68ch; }
.sign { grid-area: sign; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 72px); }
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "media" "sign" "story"; }
  .sign { position: static; }
}

/* ---------- relato ---------- */
.lead { font-size: 1.25rem; line-height: 1.55; color: var(--text); }
.lead + .lead { margin-top: -22px; font-weight: 700; color: var(--navy); }
.block { display: grid; gap: 14px; }
.block h2 { font-size: var(--s-2); font-weight: 700; }
.block-tinted { background: var(--leaf-soft); border-radius: var(--radius); padding: 24px 24px 26px; }
.block-tinted h2 { color: #1f5a33; }
.pull { margin: 6px 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--sun); }
.pull p { font-family: var(--f-display); font-weight: 500; font-size: 1.32rem; line-height: 1.35; color: var(--navy); }

.demands { margin: 0; padding: 0; list-style: none; counter-reset: d; display: grid; gap: 10px; }
.demands li { counter-increment: d; position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 14px 64px; min-height: 62px; }
.demands li::before { content: counter(d); position: absolute; left: 16px; top: 13px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: var(--sun); font: 700 1rem/1 var(--f-display); }
.demands b { color: var(--navy); }

.ana { background: var(--navy); color: #e9eff8; border-radius: var(--radius); padding: 28px 26px 30px; position: relative; overflow: hidden; }
.ana h2 { color: #fff; }
.ana b { color: var(--sun); font-weight: 700; }
.hand { font-family: var(--f-hand); font-size: 2rem; line-height: 1; color: var(--sky); font-weight: 700; }

.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 16px; position: relative; padding-bottom: 18px; }
.timeline li::before { content: ""; position: absolute; left: 86px; top: 8px; bottom: -4px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li p { padding-left: 18px; position: relative; }
.timeline li p::before { content: ""; position: absolute; left: -6px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--sky); box-shadow: 0 0 0 3px var(--paper); }
.t-year { font: 700 1rem/1.5 var(--f-display); color: var(--navy); text-align: right; font-variant-numeric: tabular-nums; }
.t-now .t-year { color: var(--rose); }
.t-now p { font-weight: 700; color: var(--navy); }
.t-now p::before { background: var(--rose) !important; }

.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 7px 14px; border-radius: 999px; font-size: .95rem; background: var(--surface); border: 1px solid var(--line); }
.chips li:nth-child(4n+1) { border-color: var(--sky); }
.chips li:nth-child(4n+2) { border-color: var(--leaf); }
.chips li:nth-child(4n+3) { border-color: var(--sun); }
.chips li:nth-child(4n+4) { border-color: var(--rose); }
.note { font-size: .9rem; color: var(--muted); }

/* ---------- tarjeta de firma ---------- */
.sign-card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: 0 10px 30px -14px rgba(19, 41, 75, .28); padding: 22px; display: grid; gap: 18px; }
.counter { display: grid; gap: 8px; }
.counter-num { font: 800 2.4rem/1 var(--f-display); color: var(--navy); font-variant-numeric: tabular-nums; }
.counter-unit { font: 700 1.05rem var(--f-body); color: var(--muted); }
.bar { height: 12px; background: var(--sky-soft); border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--sky), var(--leaf) 45%, var(--sun) 75%, var(--rose)); transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.counter-meta { font-size: .95rem; color: var(--muted); }
.counter-meta b { color: var(--navy); }

.recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.recent:empty { display: none; }
.recent li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: center; font-size: .92rem; color: var(--muted); }
.recent svg { width: 20px; height: 24px; }
.recent b { color: var(--text); }

.sign-title { font-size: 1.35rem; margin-bottom: 12px; }
form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 380px) { .field-row { grid-template-columns: minmax(0, 1fr); } }
label { font-weight: 700; font-size: .95rem; color: var(--navy); }
.opt { font-weight: 400; color: var(--muted); font-size: .85rem; }
input, select, textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 10px;
  padding: 11px 12px; min-height: 46px;
}
textarea { resize: vertical; min-height: 88px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 3px rgba(90, 166, 220, .3); background: var(--surface); }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--danger); }
small { font-size: .82rem; color: var(--muted); }
.check { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; font-weight: 400; font-size: .9rem; color: var(--text); cursor: pointer; }
.check input { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; accent-color: var(--navy); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { color: var(--danger); font-weight: 700; font-size: .95rem; }
.ts-box { min-height: 0; }
.ts-box:empty { display: none; }

.thanks { display: grid; gap: 12px; text-align: center; justify-items: center; }
.thanks:focus { outline: none; }
.thanks-mano { width: 56px; height: 68px; fill: var(--sun); animation: wave 1.2s ease 1; transform-origin: 50% 90%; }
@keyframes wave { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 60% { transform: rotate(10deg); } }
.thanks h2 { font-size: 1.5rem; }

/* ---------- compartir ---------- */
.share-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; }
.share-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 12px;
  border-radius: 12px; border: 0; cursor: pointer; text-decoration: none;
  font: 700 .95rem/1.1 var(--f-body); color: #fff; background: var(--navy-2);
  transition: transform .15s ease, filter .15s ease;
}
.share-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.share-btn svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.share-btn.wa { background: #1f9e55; grid-column: 1 / -1; font-size: 1.05rem; min-height: 52px; }
.share-btn.fb { background: #1f5fc9; }
.share-btn.x { background: #1b2433; }
.share-btn.tg { background: #2a8bc7; }
.share-btn.copy { background: var(--surface); color: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); }
.share-btn.native { background: var(--rose); }

/* ---------- muro ---------- */
.wall-section { background: var(--sky-soft); padding-block: 56px; position: relative; }
.wall-section::before { content: ""; position: absolute; inset: auto 0 0; height: 46px; background: var(--leaf-soft); clip-path: ellipse(70% 100% at 30% 100%); opacity: .9; }
.wall-section > .wrap { position: relative; display: grid; gap: 26px; }
.section-head { display: grid; gap: 10px; max-width: 62ch; }
.section-head h2 { font-size: var(--s-2); }
.wall-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .wall-grid { grid-template-columns: minmax(0, 1fr); } }
.wall-form { background: var(--surface); border-radius: var(--radius); padding: 22px; border: 1px solid var(--line); }
.wall-form h3 { font-size: 1.2rem; }
.wall { columns: 2 260px; column-gap: 16px; min-width: 0; }
.msg { break-inside: avoid; margin: 0 0 16px; background: var(--surface); border-radius: 4px 14px 14px 14px; padding: 16px 18px 14px; border-top: 5px solid var(--c, var(--sky)); box-shadow: 0 4px 14px -10px rgba(19, 41, 75, .4); display: grid; gap: 10px; }
.msg-text { white-space: pre-line; overflow-wrap: anywhere; }
.msg-meta { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: .85rem; color: var(--muted); }
.msg-meta b { color: var(--navy); }
.msg-badge { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #1f5a33; background: var(--leaf-soft); padding: 2px 7px; border-radius: 5px; }
.msg.is-new { animation: pop .5s ease; }
@keyframes pop { from { transform: scale(.96); opacity: .3; } to { transform: none; opacity: 1; } }
.wall-empty { color: var(--muted); font-style: italic; }
#wall-more { justify-self: center; }

/* ---------- apoyos ---------- */
.support { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; padding-block: 60px; align-items: start; }
@media (max-width: 820px) { .support { grid-template-columns: minmax(0, 1fr); } }
.support-copy { display: grid; gap: 16px; justify-items: start; }
.support-copy h2 { font-size: var(--s-2); }
.support-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: grid; gap: 12px; }
.support-list h3 { font-size: 1.1rem; }
.orgs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.orgs:empty { display: none; }
.orgs li { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.orgs li span { color: var(--muted); font-size: .88rem; }

/* ---------- difusión ---------- */
.spread { background: var(--navy); color: #e9eff8; padding-block: 56px; }
.spread-in { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 36px; align-items: center; }
@media (max-width: 760px) { .spread-in { grid-template-columns: minmax(0, 1fr); } }
.spread h2 { color: #fff; font-size: var(--s-2); margin-bottom: 10px; }
.spread p { margin-bottom: 18px; }
.spread .share-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 520px) { .spread .share-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.qr-box { background: #fff; color: var(--text); border-radius: var(--radius); padding: 16px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.qr-box p { margin: 0; font-size: .88rem; }
.qr svg, .qr img { width: 180px; height: 180px; }

/* ---------- pie ---------- */
.footer { background: #0c1b33; color: #b9c6d9; padding-block: 36px calc(36px + 64px); font-size: .92rem; }
.footer-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
@media (max-width: 700px) { .footer-in { grid-template-columns: minmax(0, 1fr); } }
.footer p + p { margin-top: 6px; }
.footer a { color: var(--sun); }
.footer-brand { color: #fff; font-family: var(--f-display); font-size: 1.1rem; }
.footer-brand b { color: var(--sun); }

/* ---------- botón móvil y aviso ---------- */
.mobile-cta {
  position: fixed; z-index: 25; left: 0; right: 0; bottom: 0; border-radius: 0;
  padding-bottom: calc(15px + env(safe-area-inset-bottom, 0px));
  padding-left: var(--gutter-l); padding-right: var(--gutter-r);
  box-shadow: 0 -6px 18px -8px rgba(0, 0, 0, .35);
  transition: transform .25s ease;
}
.mobile-cta.is-hidden { transform: translateY(110%); }
@media (min-width: 901px) { .mobile-cta { display: none; } .footer { padding-bottom: 36px; } }
.toast {
  position: fixed; z-index: 40; left: 50%; transform: translateX(-50%);
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 700;
  max-width: calc(100% - 32px); box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .45);
}
