/* Malargue Voto — azul noche, laguna, ámbar y arena. Sobrio, claro, institucional. */
:root {
  --noche: #0B2E4F;
  --noche-2: #082238;
  --noche-3: #12406A;
  --laguna: #0E7C7B;
  --laguna-2: #0B5F66;
  --laguna-claro: #E3F1F0;
  --ambar: #F2A33A;
  --ambar-2: #D9861A;
  --ambar-claro: #FDF1DF;
  --arena: #F6F3EE;
  --tinta: #14212E;
  --texto: #3E4A57;
  --gris: #6B7785;
  --borde: #E3E7EC;
  --blanco: #FFFFFF;
  --ok: #1F9D6B;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(11, 46, 79, .06);
  --shadow: 0 12px 32px -14px rgba(11, 46, 79, .22);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --display: "Outfit", system-ui, sans-serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; background: var(--blanco); color: var(--tinta); font: 400 16.5px/1.6 var(--sans); -webkit-font-smoothing: antialiased; padding-bottom: 96px; overflow-x: hidden; }
svg { display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ambar); outline-offset: 3px; border-radius: 8px; }
.defs { position: absolute; }
.muted { color: var(--gris); margin: 0; font-size: .92rem; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--noche); color: #fff; padding: 8px 14px; border-radius: 10px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Marca ---------- */
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; color: var(--noche); }
.brand__mark { width: 40px; height: 44px; flex: none; color: var(--noche); }
.brand__word { display: flex; flex-direction: column; line-height: 1; }
.brand__word b { font: 800 1.28rem/1 var(--display); letter-spacing: .01em; color: var(--noche); }
.brand__word span { display: flex; align-items: center; gap: 7px; margin-top: 4px; font: 600 .66rem/1 var(--display); letter-spacing: .42em; color: var(--laguna); }
.brand__word span::before { content: ""; width: 16px; height: 2px; border-radius: 2px; background: var(--ambar); }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 50px; padding: 0 24px; border-radius: 12px; border: 1.5px solid transparent; font: 600 1rem/1 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform .2s var(--ease), background-color .2s, border-color .2s, box-shadow .2s, opacity .2s; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--laguna); color: #fff; box-shadow: 0 8px 20px -10px rgba(14, 124, 123, .8); }
.btn--primary:hover { background: var(--laguna-2); }
.btn--primary:disabled { background: #B9C4CC; box-shadow: none; cursor: not-allowed; }
.btn--light { background: #fff; color: var(--noche); }
.btn--light:hover { background: var(--arena); }
.btn--outline { border-color: rgba(255, 255, 255, .45); color: #fff; }
.btn--outline:hover { background: rgba(255, 255, 255, .08); border-color: #fff; }
.btn--sm { min-height: 40px; padding: 0 18px; font-size: .92rem; border-radius: 10px; }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--borde); }
.topbar__in { display: flex; align-items: center; gap: 28px; min-height: 70px; }
.topnav { display: flex; gap: 26px; }
.topnav a { text-decoration: none; color: var(--texto); font-weight: 500; font-size: .95rem; transition: color .2s; }
.topnav a:hover { color: var(--noche); }
@media (max-width: 860px) { .topnav { display: none; } }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; color: #fff; padding: 76px 0 40px; isolation: isolate; background: linear-gradient(160deg, var(--noche-3) 0%, var(--noche) 45%, var(--noche-2) 100%); }
.hero__bg { position: absolute; inset: 0; z-index: -1; }
.hero__stars { position: absolute; inset: 0 0 40% 0; opacity: .7;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 44% 30%, #cfe3f5 50%, transparent 51%),
    radial-gradient(1px 1px at 63% 16%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 78% 26%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 10%, #cfe3f5 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 48%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 55% 50%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 94% 44%, #fff 50%, transparent 51%); }
.hero__land { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 46%; }
.hero__land .l1 { fill: #0F3A60; }
.hero__land .l2 { fill: #0C3254; }
.hero__land .l3 { fill: var(--noche-2); }
.hero__in { position: relative; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr); align-items: center; gap: 40px; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px; padding: 7px 14px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); font-size: .86rem; font-weight: 500; color: #D6E2EE; }
.eyebrow__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ambar); box-shadow: 0 0 0 4px rgba(242, 163, 58, .2); }
.hero__title { font: 700 clamp(2.3rem, 5.4vw, 4.1rem)/1.06 var(--display); letter-spacing: -.02em; margin: 0 0 20px; max-width: 17ch; }
.hero__title span { color: var(--ambar); }
.hero__lead { font-size: clamp(1.02rem, 1.8vw, 1.18rem); color: #C9D6E3; max-width: 50ch; margin: 0 0 30px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; }
.hero__status { min-height: 1.5em; margin: 16px 0 0; color: #9FE0C6; font-weight: 500; font-size: .95rem; }
.hero__art { display: grid; place-items: center; }
.hero__mark { width: min(300px, 100%); aspect-ratio: 140 / 156; height: auto; color: #fff; filter: drop-shadow(0 24px 40px rgba(0, 0, 0, .35)); }
.hero__mark .mark__ballot { transform-box: fill-box; transform-origin: center; }
.stats { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 56px 0 0; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--radius); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.stat { padding: 18px 24px; min-width: 0; }
.stat + .stat { border-left: 1px solid rgba(255, 255, 255, .12); }
.stat dt { color: #9DB2C7; font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.stat dd { margin: 6px 0 0; font: 700 1.45rem/1.2 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 820px) {
  .hero { padding: 48px 0 28px; }
  .hero__in { grid-template-columns: 1fr; }
  .hero__art { display: none; }
  .stats { grid-template-columns: 1fr; margin-top: 36px; }
  .stat + .stat { border-left: 0; border-top: 1px solid rgba(255, 255, 255, .12); }
  .stat { padding: 14px 18px; }
  .hero__cta .btn { flex: 1 1 100%; }
}

/* ---------- Secciones ---------- */
.section { padding: 76px 0; }
.section--sand { background: var(--arena); }
.section--tight { padding-top: 8px; }
.section__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 24px; margin-bottom: 30px; }
.kicker { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; color: var(--laguna); font: 600 .8rem/1 var(--sans); text-transform: uppercase; letter-spacing: .14em; }
.h2 { font: 700 clamp(1.7rem, 3.4vw, 2.4rem)/1.12 var(--display); letter-spacing: -.015em; margin: 0; color: var(--noche); }
.step { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--noche); color: #fff; font: 700 .72rem/1 var(--sans); letter-spacing: 0; }

/* ---------- Resultados ---------- */
.live { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--texto); font-size: .9rem; font-weight: 500; }
.live__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); animation: pulse 2.2s infinite; }
.live.is-off .live__dot { background: var(--gris); animation: none; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(31, 157, 107, .45); } 70% { box-shadow: 0 0 0 9px rgba(31, 157, 107, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 157, 107, 0); } }
.results { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .results { grid-template-columns: 1fr; } }
.panel { background: #fff; border: 1px solid var(--borde); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); min-width: 0; }
.panel__head { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--borde); }
.panel__head h3 { margin: 0 0 2px; font: 600 1.2rem/1.25 var(--display); color: var(--noche); }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 15px; }
.bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; align-items: baseline; }
.bar__name { font-weight: 500; color: var(--tinta); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar__num { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--noche); font-size: .92rem; }
.bar__track { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: #EEF1F4; overflow: hidden; }
.bar__fill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--noche); transition: width 1s var(--ease); }
.bar.is-lead .bar__fill { background: linear-gradient(90deg, var(--noche), var(--laguna)); }
.bars--prop .bar__fill { background: var(--laguna); }
.bars--prop .bar.is-lead .bar__fill { background: linear-gradient(90deg, var(--laguna), #2FA59C); }
.bar.is-mine .bar__name::after { content: "Tu voto"; margin-left: 8px; font-size: .68rem; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--ambar-claro); color: var(--ambar-2); vertical-align: 2px; }
.paused { background: var(--arena); border: 1px dashed #CBD3DB; border-radius: var(--radius); padding: 32px; text-align: center; }
.paused h3 { font: 600 1.35rem var(--display); margin: 0 0 6px; color: var(--noche); }
.paused p { color: var(--texto); margin: 0 auto; max-width: 52ch; }

/* ---------- Candidatos ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.card { position: relative; display: flex; gap: 16px; align-items: center; text-align: left; width: 100%; padding: 18px 20px; border-radius: var(--radius); border: 1.5px solid var(--borde); background: #fff; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color .2s, box-shadow .25s, transform .25s var(--ease); }
.card:hover { border-color: #C6D0DA; box-shadow: var(--shadow); transform: translateY(-2px); }
.card[aria-checked="true"] { border-color: var(--noche); box-shadow: 0 0 0 3px rgba(11, 46, 79, .1), var(--shadow); }
.card__avatar { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 14px; background: var(--arena); font: 700 1rem/1 var(--display); letter-spacing: .03em; color: var(--noche); transition: background-color .2s, color .2s; }
.card[aria-checked="true"] .card__avatar { background: var(--noche); color: #fff; }
.card--other .card__avatar { background: transparent; border: 1.5px dashed #C6D0DA; color: var(--gris); }
.card__body { min-width: 0; flex: 1; }
.card__name { display: block; font: 600 1.06rem/1.3 var(--display); color: var(--noche); }
.card__party { display: block; color: var(--laguna); font-weight: 500; font-size: .88rem; margin-top: 2px; }
.card__note { display: block; color: var(--gris); font-size: .84rem; margin-top: 1px; }
.card__radio { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #C6D0DA; display: grid; place-items: center; color: #fff; transition: border-color .2s, background-color .2s; }
.card__radio svg { width: 13px; height: 13px; opacity: 0; transform: scale(.4); transition: opacity .2s, transform .3s var(--ease); }
.card[aria-checked="true"] .card__radio { border-color: var(--noche); background: var(--noche); }
.card[aria-checked="true"] .card__radio svg { opacity: 1; transform: scale(1); }

/* ---------- Propuestas ---------- */
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); gap: 12px; }
.chip { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 12px 16px; border-radius: var(--radius-sm); border: 1.5px solid var(--borde); background: #fff; text-align: left; cursor: pointer; font-weight: 500; color: var(--tinta); box-shadow: var(--shadow-sm); transition: border-color .2s, background-color .2s, transform .2s var(--ease); }
.chip:hover { border-color: #C6D0DA; }
.chip:active { transform: scale(.985); }
.chip__icon { flex: none; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--laguna-claro); color: var(--laguna); transition: background-color .2s, color .2s; }
.chip__icon svg { width: 20px; height: 20px; }
.chip__label { flex: 1; min-width: 0; line-height: 1.35; }
.chip__tick { flex: none; width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid #C6D0DA; display: grid; place-items: center; color: #fff; transition: background-color .2s, border-color .2s; }
.chip__tick svg { width: 13px; height: 13px; opacity: 0; transition: opacity .2s; }
.chip[aria-pressed="true"] { border-color: var(--laguna); background: #F4FAF9; }
.chip[aria-pressed="true"] .chip__icon { background: var(--laguna); color: #fff; }
.chip[aria-pressed="true"] .chip__tick { background: var(--laguna); border-color: var(--laguna); }
.chip[aria-pressed="true"] .chip__tick svg { opacity: 1; }

/* ---------- Confianza ---------- */
.trust { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 16px; }
.trust__item { padding: 24px; border-radius: var(--radius); background: #fff; border: 1px solid var(--borde); }
.trust__icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--arena); margin-bottom: 14px; }
.trust__icon svg { width: 22px; height: 22px; fill: none; stroke: var(--noche); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.trust__item h3 { margin: 0 0 6px; font: 600 1.08rem var(--display); color: var(--noche); }
.trust__item p { margin: 0; color: var(--texto); font-size: .94rem; }

/* ---------- Footer ---------- */
.footer { background: var(--noche-2); color: #C9D6E3; padding: 40px 0 44px; }
.footer__in { display: flex; flex-wrap: wrap; gap: 20px 48px; align-items: center; }
.footer__brand { display: flex; align-items: center; gap: 12px; }
.footer .brand__mark { color: #fff; }
.footer .brand__word b { color: #fff; }
.footer .brand__word span { color: #7FD3CF; }
.footer p { margin: 0 0 4px; font-size: .92rem; }
.footer__legal { color: #8FA4B8; font-size: .84rem !important; max-width: 70ch; }

/* ---------- Boleta fija ---------- */
.ballot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--borde); box-shadow: 0 -10px 30px -18px rgba(11, 46, 79, .35); transform: translateY(110%); transition: transform .45s var(--ease); }
.ballot.is-on { transform: translateY(0); }
.ballot__in { display: flex; align-items: center; gap: 16px; }
.ballot__summary { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ballot__label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gris); font-weight: 600; }
.ballot__text { font: 600 1.02rem/1.35 var(--display); color: var(--noche); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ballot__captcha:empty { display: none; }
@media (max-width: 640px) {
  .ballot__in { flex-wrap: wrap; gap: 10px; }
  .ballot__summary { flex-basis: 100%; }
  .ballot .btn { flex: 1; }
  .ballot__captcha { flex-basis: 100%; }
  body { padding-bottom: 140px; }
  .topbar__cta { display: none; }
}

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 104px; transform: translateX(-50%); z-index: 60; max-width: min(92vw, 460px); padding: 14px 20px; border-radius: 12px; background: var(--noche); color: #fff; font-weight: 500; box-shadow: var(--shadow); text-align: center; }
.toast.is-error { background: #8A1C1C; }

.confetti { position: fixed; z-index: 70; width: 8px; height: 8px; border-radius: 2px; pointer-events: none; }
.noscript { position: fixed; inset: auto 0 0 0; margin: 0; padding: 16px; background: var(--ambar); color: var(--noche); text-align: center; font-weight: 600; z-index: 99; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
