/* Paleta y tipografía tomadas del proyecto YMCA Tolima (Manual de Identidad YMCA Colombia 2020).
   Tríada: celeste (transparencia), azul (confianza), amarillo (calidez). */
:root {
  --celeste: #0082b7;
  --celeste-ink: #006c99;
  --azul: #00548f;
  --azul-deep: #003f6c;
  --amarillo: #ffb618;
  --gris: #d8d6d4;
  --ink: #12324a;
  --muted: #4a6274;
  --mist: #eef6fa;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius: 28px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: 'Nunito', ui-rounded, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

::selection { background: var(--amarillo); color: var(--azul-deep); }
:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 3px; border-radius: 6px; }

.wrap {
  width: 100%;
  max-width: 640px;
  margin-inline: auto;
  padding-inline: 16px;
}

.display { font-weight: 900; letter-spacing: -0.02em; line-height: 1.02; }
.sun { color: var(--amarillo); }
.muted { color: var(--muted); }

.tri-bullet {
  display: inline-block;
  width: 0.7em;
  height: 0.6em;
  background: var(--amarillo);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.dotted-rule {
  flex: 1;
  min-width: 3rem;
  height: 4px;
  color: var(--celeste);
  opacity: 0.6;
  background-image: radial-gradient(circle, currentColor 1.4px, transparent 1.6px);
  background-size: 9px 4px;
  background-repeat: repeat-x;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: calc(56px + env(safe-area-inset-top)) 0 120px;
  color: #fff;
  background: linear-gradient(160deg, var(--azul-deep) 0%, var(--azul) 60%, var(--celeste) 130%);
}

.tri { position: absolute; z-index: -1; pointer-events: none; }
.tri polygon { stroke-width: 44; stroke-linejoin: round; }
.tri--a { width: 72vw; max-width: 460px; right: -22vw; top: -12vw; rotate: 8deg; mix-blend-mode: multiply; }
.tri--a polygon { fill: var(--celeste); stroke: var(--celeste); opacity: 0.55; }
.tri--b { width: 13vw; max-width: 96px; right: 7vw; top: 64px; rotate: -14deg; }
.tri--b polygon { fill: var(--amarillo); stroke: var(--amarillo); }
.tri--c { width: 40vw; max-width: 260px; left: -10vw; bottom: -14vw; rotate: 200deg; mix-blend-mode: multiply; }
.tri--c polygon { fill: var(--azul); stroke: var(--azul); opacity: 0.85; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.hero__title {
  margin-top: 14px;
  max-width: 11ch;
  font-size: clamp(2.9rem, 1.6rem + 7vw, 4.8rem);
  line-height: 0.95;
}

.hero__lead {
  margin-top: 18px;
  max-width: 34ch;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.95);
}

/* ---------- Tarjetas ---------- */
.main {
  display: grid;
  gap: 20px;
  margin-top: -84px;
  padding-bottom: 40px;
  position: relative;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: 0 30px 60px -40px rgba(0, 63, 108, 0.6);
  outline: 1px solid rgba(0, 84, 143, 0.08);
}

.label {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--celeste-ink);
}

.amount {
  margin-top: 6px;
  font-size: clamp(2.8rem, 1.8rem + 6vw, 4rem);
  color: var(--azul);
  font-variant-numeric: tabular-nums;
}

.goal { margin-top: 6px; color: var(--muted); font-weight: 600; }
.goal strong { color: var(--ink); font-weight: 800; }

.bar {
  position: relative;
  margin-top: 20px;
  height: 18px;
  border-radius: 999px;
  background: var(--mist);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 130, 183, 0.15);
}

.bar__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--celeste), var(--amarillo));
  transition: width 1.4s var(--ease);
}

.pct { margin-top: 8px; font-weight: 600; color: var(--muted); }
.pct strong { color: var(--azul); font-weight: 900; }

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 22px 0 0;
  border-top: 2px dotted rgba(0, 130, 183, 0.3);
}
.stats > div { padding-top: 16px; }
.stats > div + div { padding-left: 16px; border-left: 2px dotted rgba(0, 130, 183, 0.3); }
.stats dt { font-size: 14px; font-weight: 700; color: var(--muted); line-height: 1.3; }
.stats dd { margin: 6px 0 0; font-size: clamp(1.6rem, 1.2rem + 2vw, 2.1rem); color: var(--azul); font-variant-numeric: tabular-nums; }

.dots { margin: 24px 0 0; text-align: center; }
.dots svg { display: block; width: 100%; max-width: 260px; margin-inline: auto; }
.dots circle.on { transform-box: fill-box; transform-origin: center; animation: pop 0.7s var(--ease) both; }
.dots figcaption { margin: 12px auto 0; max-width: 30ch; font-size: 14px; font-weight: 600; color: var(--muted); }

@keyframes pop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

/* ---------- Nequi ---------- */
.section-title { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.2rem); color: var(--celeste-ink); }
.nequi .muted { margin-top: 8px; }

.nequi__box {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  margin-top: 16px;
  padding: 18px;
  border-radius: 20px;
  background: var(--mist);
  border: 2px dashed rgba(0, 130, 183, 0.35);
}

.nequi__num {
  font-size: clamp(2rem, 1.4rem + 4vw, 2.6rem);
  color: var(--azul-deep);
  text-align: center;
  font-variant-numeric: tabular-nums;
  user-select: all;
}

.hint { margin-top: 14px; font-size: 14px; color: var(--muted); }

/* ---------- Botones ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 12px 24px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: translate 0.3s var(--ease), color 0.3s var(--ease);
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  translate: -101% 0;
  transition: translate 0.45s var(--ease);
}
.btn > * { position: relative; }
.btn:hover::before,
.btn:focus-visible::before { translate: 0 0; }
.btn:active { translate: 0 1px; }

.btn-sun { background: var(--amarillo); color: var(--azul-deep); box-shadow: 0 8px 24px -10px rgba(255, 182, 24, 0.9); }
.btn-sun::before { background: #fff; }
.btn-sun.is-done { background: #00933a; color: #fff; }

.btn-ghost-blue { margin-top: 16px; width: 100%; background: transparent; color: var(--azul); box-shadow: inset 0 0 0 2px var(--azul); }
.btn-ghost-blue::before { background: var(--azul); }
.btn-ghost-blue:hover,
.btn-ghost-blue:focus-visible { color: #fff; }

/* ---------- Lista de aportes ---------- */
.section-head { display: flex; align-items: center; gap: 16px; }

.donations { list-style: none; margin: 16px 0 0; padding: 0; }
.donations li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 2px dotted rgba(0, 130, 183, 0.25);
}
.donations li:last-child { border-bottom: 0; }

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-weight: 900;
  font-size: 16px;
  color: #fff;
}
.who { min-width: 0; }
.who strong { display: block; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who time { font-size: 13px; color: var(--muted); }
.money { font-weight: 900; color: var(--azul); font-variant-numeric: tabular-nums; }

.empty { margin-top: 12px; }

.status { text-align: center; font-size: 13px; color: var(--muted); }
.status.is-error { color: #b3261e; font-weight: 700; }

/* ---------- Pie ---------- */
.foot {
  padding: 28px 0 calc(28px + env(safe-area-inset-bottom));
  background: var(--azul-deep);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
}
.foot .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.refresh {
  min-height: 44px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 14px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.4);
  cursor: pointer;
}
.refresh:hover { background: #fff; color: var(--azul); }

/* ---------- Pantallas más grandes ---------- */
@media (min-width: 560px) {
  .card { padding: 32px; }
  .nequi__box { flex-direction: row; align-items: center; justify-content: space-between; }
  .nequi__num { text-align: left; }
}

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