/* La Música de las Esferas — lenguaje del cartel: grotesca negra pesada,
   blanco papel, líneas azules, esferas coral y noche azul. */
:root {
  --paper: #fff;
  --paper-2: #f4f1ec;
  --ink: #111;
  --muted: #5f5b56;
  --rule: #e2ddd5;
  --blue: #2a86d9;
  --brand: #1f5bd6;
  --coral: #e8826b;
  --coral-ink: #c4553d;
  --night: #121826;
  --err: #b3261e;
  --ok: #2e7d4f;
  --sans: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --gutter: 20px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1119;
    --paper-2: #151b27;
    --ink: #f3efe8;
    --muted: #a7a196;
    --rule: #262d3b;
    --blue: #5aa8ee;
    --coral: #f0927b;
    --coral-ink: #f0927b;
    --err: #ff8a80;
    --ok: #7fd1a0;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
.page { max-width: 600px; margin: 0 auto; }
.pad { padding-left: var(--gutter); padding-right: var(--gutter); }

/* --- Cabecera ------------------------------------------------------------ */
.art { position: relative; aspect-ratio: 16 / 9; background: var(--paper-2); }
.art img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  position: absolute; left: var(--gutter); bottom: -1px;
  width: 64px; height: 64px; padding: 11px;
  background: var(--paper);
}
.badge img { width: 100%; height: 100%; object-fit: contain; }
@media (prefers-color-scheme: dark) { .logo { filter: invert(1); } }

.title { padding-top: 22px; padding-bottom: 8px; }
.eyebrow {
  margin: 0 0 14px;
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--coral-ink);
}
h1 {
  margin: 0;
  font-size: clamp(46px, 14vw, 68px); font-weight: 800; line-height: .94; letter-spacing: -.035em;
}
.band { margin: 22px 0 2px; font-size: 21px; font-weight: 800; line-height: 1.08; letter-spacing: -.01em; text-transform: uppercase; }
.dir { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.when { margin: 20px 0 0; padding-top: 14px; border-top: 2px solid var(--ink); }
.when strong { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.when span { display: block; font-size: 15px; color: var(--muted); }

/* --- Contador: una esfera recorre su órbita ------------------------------ */
.orbit {
  position: relative;
  margin: 26px 0 0;
  padding: 26px var(--gutter) 24px;
  color: #f6f2ea;
  background-color: var(--night);
  background-image: linear-gradient(180deg, rgba(18,24,38,.72), rgba(18,24,38,.94)), url(/img/esferas-noche.webp);
  background-image: linear-gradient(180deg, rgba(18,24,38,.72), rgba(18,24,38,.94)),
    image-set(url(/img/esferas-noche.avif) type("image/avif"), url(/img/esferas-noche.webp) type("image/webp"));
  background-size: cover; background-position: center;
}
.live { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #cfc7ba; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(232,130,107,.6); } 70%, 100% { box-shadow: 0 0 0 10px rgba(232,130,107,0); } }
.total {
  display: block; margin: 10px 0 0;
  font-size: clamp(56px, 18vw, 84px); font-weight: 800; line-height: 1; letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}
.total.bump { animation: bump .8s ease; }
@keyframes bump { 35% { color: #ffc2b2; } }
.count { margin: 8px 0 0; font-size: 15px; color: #cfc7ba; }
.track { position: relative; height: 2px; margin: 28px 7px 0; background: rgba(255,255,255,.22); }
.track .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--blue); transition: width 1.2s cubic-bezier(.2,.7,.2,1); }
.track .sphere {
  position: absolute; top: 50%; left: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px;
  border-radius: 50%; background: var(--coral);
  box-shadow: 0 0 0 4px rgba(232,130,107,.22);
  transition: left 1.2s cubic-bezier(.2,.7,.2,1);
}
.goal { display: flex; justify-content: space-between; margin: 12px 0 0; font-size: 13px; color: #cfc7ba; font-variant-numeric: tabular-nums; }

/* --- Formulario ---------------------------------------------------------- */
.give { padding-top: 34px; }
h2 { margin: 0 0 16px; font-size: 28px; font-weight: 800; line-height: 1.05; letter-spacing: -.025em; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
.amounts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.amounts button {
  height: 56px;
  font: 800 19px/1 var(--sans); letter-spacing: -.01em;
  color: var(--ink); background: var(--paper);
  border: 2px solid var(--ink); border-radius: 0;
  cursor: pointer;
  transition: background .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.amounts button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.other { position: relative; margin-top: 8px; }
.other input { padding-right: 44px; font-weight: 700; font-size: 19px; }
.other span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--muted); pointer-events: none; }
.hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

input[type="number"], input[type="text"], textarea {
  width: 100%; height: 54px; padding: 0 16px;
  font: 400 17px var(--sans); color: var(--ink);
  background: var(--paper-2); border: 0; border-bottom: 2px solid var(--rule); border-radius: 0;
  -webkit-appearance: none; appearance: none;
}
input[type="number"] { -moz-appearance: textfield; }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
textarea { height: auto; min-height: 84px; padding: 14px 16px; resize: vertical; line-height: 1.4; }
input:focus, textarea:focus { outline: none; border-bottom-color: var(--blue); }
button:focus-visible, summary:focus-visible, a:focus-visible, .check input:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.note { margin-top: 22px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.note summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 0; font-weight: 700; cursor: pointer; list-style: none;
}
.note summary::-webkit-details-marker { display: none; }
.note summary small { font-weight: 400; color: var(--muted); }
.note summary::after { content: "+"; font-size: 26px; font-weight: 400; line-height: 1; transition: transform .2s; }
.note[open] summary::after { transform: rotate(45deg); }
.note .body { padding: 0 0 18px; }
.note label.t { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 700; }
.note .mt { margin-top: 14px; }
.check { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; font-size: 14px; line-height: 1.45; }
.check input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--ink); }

/* Barra de donar fija en toda la página: un toque desde la primera pantalla. */
.cta-wrap {
  position: sticky; bottom: 0; z-index: 5;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: var(--paper);
  box-shadow: 0 -1px 0 var(--rule);
}
.cta {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; height: 62px; padding: 0 22px;
  font: 800 20px var(--sans); letter-spacing: -.01em;
  color: #fff; background: var(--brand); border: 0; border-radius: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cta svg { width: 26px; height: 26px; transition: transform .2s; }
.cta:active svg { transform: translateX(4px); }
.cta[disabled] { opacity: .7; cursor: progress; }
.err { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--err); }
.err:empty { display: none; }
.secure { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.secure svg { flex: none; width: 16px; height: 16px; margin-top: 2px; }

/* --- Muro de mensajes ---------------------------------------------------- */
.wall { padding-top: 44px; }
.msgs { list-style: none; margin: 0; padding: 0; }
.msgs li { position: relative; padding: 14px 0 14px 26px; border-top: 1px solid var(--rule); animation: in .6s ease both; overflow-wrap: anywhere; }
.msgs li::before { content: ""; position: absolute; left: 2px; top: 21px; width: 10px; height: 10px; border-radius: 50%; background: var(--coral); }
.msgs li:nth-child(3n+2)::before { background: var(--blue); }
.msgs li:nth-child(3n)::before { background: var(--ink); }
.msgs q { display: block; font-size: 17px; line-height: 1.4; quotes: "«" "»"; }
.msgs cite { display: block; margin-top: 4px; font-size: 13px; font-style: normal; font-weight: 700; color: var(--muted); }
.msgs .empty { padding-left: 0; color: var(--muted); font-size: 15px; }
.msgs .empty::before { display: none; }
@keyframes in { from { opacity: 0; transform: translateY(-6px); } }

/* --- Destino ------------------------------------------------------------- */
.about { padding-top: 44px; }
.about p { margin: 0 0 14px; font-size: 16px; color: var(--muted); }
.uses { display: grid; grid-template-columns: 1fr 1fr; margin: 20px 0 16px; border-top: 2px solid var(--ink); }
.uses div { padding: 12px 0 14px; border-bottom: 1px solid var(--rule); font-weight: 700; font-size: 15px; }
.uses div:nth-child(odd) { padding-right: 12px; border-right: 1px solid var(--rule); }
.uses div:nth-child(even) { padding-left: 14px; }
.uses b { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--coral-ink); }

footer.site { margin-top: 48px; padding-top: 22px; padding-bottom: 36px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--muted); }
footer.site .logo { width: 44px; height: auto; margin-bottom: 14px; }
footer.site p { margin: 0 0 6px; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* --- Páginas de texto (legal, gracias) ----------------------------------- */
.doc { padding-top: 28px; padding-bottom: 8px; }
.doc .back { display: inline-block; margin-bottom: 22px; font-size: 14px; font-weight: 700; }
.doc h1 { font-size: 34px; line-height: 1.02; }
.doc h2 { margin: 30px 0 8px; font-size: 19px; letter-spacing: -.01em; }
.doc p, .doc li { font-size: 15px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 8px 8px 8px 0; border-bottom: 1px solid var(--rule); }
.doc th { width: 30%; font-weight: 700; }

/* --- Admin --------------------------------------------------------------- */
.adm { max-width: 900px; padding: 24px var(--gutter); }
.adm h1 { font-size: 34px; }
.adm table { width: 100%; border-collapse: collapse; font-size: 15px; }
.adm td, .adm th { padding: 10px 6px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
.adm .st-pending { color: var(--coral-ink); font-weight: 700; }
.adm .st-approved { color: var(--ok); font-weight: 700; }
.adm .st-hidden { color: var(--muted); text-decoration: line-through; }
.adm button { margin: 2px; padding: 8px 12px; font: 700 14px var(--sans); color: var(--ink); background: var(--paper); border: 2px solid var(--ink); cursor: pointer; }
.adm .tools { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; margin: 12px 0 18px; }

/* Escritorio: la columna como una hoja del cartel sobre papel. */
@media (min-width: 720px) {
  body { background: var(--paper-2); }
  .page { background: var(--paper); box-shadow: 0 0 0 1px var(--rule); }
}
