/* Encuesta de vecinos · Providencia */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('fuentes/bricolage-grotesque.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: 'Public Sans';
  src: url('fuentes/public-sans.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --tinta: #10202c;
  --suave: #3d4f5e;
  --tenue: #5a6b79;
  --azul: #17508f;
  --azul-claro: #eaf2fb;
  --naranja: #eb6834;
  --papel: #fbfcfd;
  --borde: #d5dde5;
  --riel: #e3eaf1;
  --titulos: 'Bricolage Grotesque', 'Public Sans', system-ui, sans-serif;
  --texto: 'Public Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--texto);
  font-size: 17px;
  line-height: 1.45;
  color: var(--tinta);
  background: #10202c;
}

/* ---------- Fondo: la ciudad ---------- */

.ciudad {
  --t: 0.2; /* 0 = noche, 1 = día. Lo mueve app.js con el avance. */
  position: fixed;
  inset: 0;
  overflow: hidden;
}
.cielo { position: absolute; inset: 0; }
.cielo-dia { background: linear-gradient(#86c0ec 0%, #cbe4f4 52%, #fbe6c9 100%); }
.cielo-noche {
  background: linear-gradient(#0a1530 0%, #1b2b52 42%, #6d4a5e 72%, #d98755 92%, #f2ab66 100%);
  opacity: calc(1 - var(--t));
  transition: opacity 1.4s ease;
}
.paisaje {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: max(min(70vh, 720px), 50vw);
  min-height: 340px;
}

#estrellas circle { fill: #fff; opacity: calc((1 - var(--t)) * 0.9); transition: opacity 1.4s ease; }
.sol { fill: #ffd27a; }
.sol, .sol-halo {
  transform: translateY(calc((1 - var(--t)) * 270px));
  transition: transform 1.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.nube ellipse { fill: #fff; }
.nube { opacity: calc(0.25 + var(--t) * 0.65); transition: opacity 1.4s ease; }
.nube-a { --y: 120px; animation: deriva 130s linear infinite; animation-delay: -40s; }
.nube-b { --y: 210px; animation: deriva 170s linear infinite; animation-delay: -110s; }
.nube-c { --y: 70px; animation: deriva 210s linear infinite; animation-delay: -150s; }
@keyframes deriva {
  from { transform: translate(-240px, var(--y)); }
  to { transform: translate(1680px, var(--y)); }
}

/* La ciudad se aclara con el avance */
.urbe {
  filter: brightness(calc(0.5 + 0.5 * var(--t))) saturate(calc(0.75 + 0.25 * var(--t)));
  transition: filter 1.4s ease;
}
.andes-lejos { fill: #adc0dc; }
.andes-cerca { fill: #839bbd; }
.nieve { fill: #f2f6fa; }
.cerro { fill: #5b8a63; }
.cerro-sombra { fill: #4a7653; }
.antena { stroke: #55626f; stroke-width: 2; }
.virgen { fill: #f7f9fb; }
.cable { stroke: #55626f; stroke-width: 1.5; }
.e1 { fill: #dfe6ee; }
.e2 { fill: #cdd8e4; }
.e3 { fill: #eadfd2; }
.e4 { fill: #c2cfdc; }
.vidrio { fill: #22313f; opacity: 0.2; }
.telefonica { fill: #d2dae4; }
.telefonica-b { fill: #b9c5d2; }
.costanera { fill: #9cc2e0; }
.costanera-brillo { fill: #c9e0f1; }
.costanera-baja { fill: #b4cbe0; }
.copa-a { fill: #5f9e6e; }
.copa-b { fill: #4c8a5d; }
.tronco { fill: #6b5a48; }
.avenida { fill: #5c6875; }
.rio { fill: #7fb1cc; }

.cabina {
  fill: #eb6834;
  offset-path: path('M452 546 L588 402');
  offset-rotate: 0deg;
  animation: sube 28s linear infinite alternate;
}
.cabina-b { animation-delay: -14s; }
@keyframes sube { from { offset-distance: 0%; } to { offset-distance: 100%; } }

.bus { animation: pasa 36s linear infinite; }
@keyframes pasa { from { transform: translateX(-80px); } to { transform: translateX(1500px); } }
.bus-cuerpo { fill: #d8392e; }
.bus-franja { fill: #f4f6f8; }
.bus-vidrio { fill: #22313f; }
.bus-rueda { fill: #1d2630; }

.onda { fill: none; stroke: #eaf4fa; stroke-width: 2; opacity: 0.6; animation: corre 9s linear infinite; }
.onda-b { opacity: 0.4; animation-duration: 13s; }
@keyframes corre { to { transform: translateX(-120px); } }

.luz { fill: #ffd98a; opacity: calc((1 - var(--t)) * 0.95); transition: opacity 1.4s ease; }

/* ---------- Hoja ---------- */

.marco {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-block: max(16px, env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-bottom, 0px));
  gap: 22px;
  padding-left: max(14px, env(safe-area-inset-left, 0px));
  padding-right: max(14px, env(safe-area-inset-right, 0px));
}
.hoja {
  width: 100%;
  max-width: 560px;
  margin-top: clamp(4px, 4vh, 48px);
  background: rgba(251, 252, 253, 0.97);
  border-radius: 24px;
  padding: 24px 20px 16px;
  box-shadow: 0 18px 50px rgba(6, 14, 28, 0.32);
}
@media (min-width: 520px) { .hoja { padding: 32px 32px 20px; } }

.vista { animation: entra 0.26s ease both; }
@keyframes entra {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.ceja {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--azul);
}
h1, h2, h3 { font-family: var(--titulos); color: var(--tinta); text-wrap: balance; }
h1 { font-size: clamp(28px, 7.4vw, 40px); line-height: 1.05; letter-spacing: -0.01em; margin: 10px 0 12px; }
h2 { font-size: clamp(23px, 6.2vw, 30px); line-height: 1.12; margin: 4px 0 6px; }
h3 { font-size: 17px; line-height: 1.25; margin: 0 0 8px; }
h1:focus, h2:focus { outline: none; }
p { margin: 0 0 12px; }
.bajada { color: var(--suave); }
.ayuda { color: var(--tenue); font-size: 15px; margin: 0; }

.garantias { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 12px; }
.garantias li { display: grid; grid-template-columns: 12px 1fr; gap: 12px; align-items: start; color: var(--suave); }
.garantias li::before { content: ''; width: 10px; height: 10px; margin-top: 8px; border-radius: 50%; background: var(--naranja); }
.garantias strong { color: var(--tinta); }
.contador { color: var(--tenue); font-size: 15px; text-align: center; margin: 12px 0 0; }

/* Botones */
button { font-family: inherit; }
.boton {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 12px 18px;
  border: 2px solid var(--azul);
  border-radius: 16px;
  background: var(--azul);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
}
.boton:hover { background: #123f73; }
.boton:active { transform: scale(0.985); }
.boton.whatsapp { background: #167a40; border-color: #167a40; }
.boton.whatsapp:hover { background: #116234; }
.boton.claro { background: #fff; color: var(--azul); }
.boton.claro:hover { background: var(--azul-claro); }
.boton[disabled] { opacity: 0.6; cursor: progress; }
:focus-visible { outline: 3px solid var(--naranja); outline-offset: 2px; }

/* Avance */
.avance { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.atras {
  flex: none;
  width: 44px;
  height: 44px;
  border: 2px solid var(--borde);
  border-radius: 50%;
  background: #fff;
  color: var(--tinta);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.atras:hover { border-color: var(--azul); }
.pasos { flex: 1; display: flex; gap: 5px; }
.paso { flex: 1; height: 6px; border-radius: 3px; background: var(--riel); }
.paso.hecho { background: var(--naranja); }
.cuenta { flex: none; font-size: 13px; color: var(--tenue); font-variant-numeric: tabular-nums; }

/* Opciones */
.opciones { display: grid; gap: 10px; margin-top: 16px; }
.opcion {
  min-height: 58px;
  padding: 14px 18px;
  border: 2px solid var(--borde);
  border-radius: 16px;
  background: #fff;
  color: var(--tinta);
  font-size: 18px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.08s ease;
}
.opcion:hover { border-color: var(--azul); }
.opcion:active { transform: scale(0.985); }
.opcion.elegida { border-color: var(--azul); background: var(--azul-claro); }
.opciones.muchas { grid-template-columns: 1fr 1fr; }
.opciones.muchas .opcion { font-size: 15px; line-height: 1.25; min-height: 56px; padding: 8px 12px; }
@media (min-width: 420px) { .opciones.muchas .opcion { font-size: 16px; padding: 10px 14px; } }

textarea {
  display: block;
  width: 100%;
  min-height: 110px;
  margin: 16px 0 6px;
  padding: 14px;
  border: 2px solid var(--borde);
  border-radius: 16px;
  background: #fff;
  color: var(--tinta);
  font: inherit;
  resize: vertical;
}
textarea:focus { border-color: var(--azul); outline: none; }
.nota { font-size: 14px; color: var(--tenue); margin: 0 0 14px; }
.aviso { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: #fdeee6; color: #7a2e0c; font-size: 15px; }

/* Resultados */
.total { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 4px; }
.total .numero { font-family: var(--titulos); font-size: 54px; font-weight: 800; line-height: 1; color: var(--azul); font-variant-numeric: tabular-nums; }
.total .rotulo { color: var(--suave); }
.grafico { margin: 22px 0 0; }
.fila { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; margin: 10px 0 0; }
.etiqueta { font-size: 15px; color: var(--suave); }
.etiqueta .mia { color: var(--azul); font-weight: 700; }
.valor { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.riel { grid-column: 1 / -1; height: 10px; border-radius: 5px; background: var(--riel); overflow: hidden; }
.barra { width: 0; height: 100%; border-radius: 5px; background: var(--azul); transition: width 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.compartir { margin: 28px 0 0; padding-top: 22px; border-top: 2px solid var(--riel); display: grid; gap: 10px; }
.compartir h2 { margin: 0; }
.compartir p { margin: 0 0 4px; color: var(--suave); }

/* Firma */
.firma {
  width: 100%;
  max-width: 560px;
  margin-top: auto;
  padding: 12px 16px 8px;
  border-radius: 16px;
  background: rgba(13, 27, 40, 0.82);
  color: #dfe7ee;
  font-size: 13px;
  line-height: 1.45;
}
.firma p { margin: 0 0 4px; }
.firma strong { color: #fff; }
.firma summary { cursor: pointer; color: #ffd27a; font-weight: 600; padding: 6px 0; }
.firma details p { margin-top: 4px; }
.firma a { color: #ffd27a; }

/* Pantallas anchas: la hoja a la izquierda, para que se vean el cerro y la torre */
@media (min-width: 1000px) {
  .marco { align-items: flex-start; padding-left: max(24px, 4vw); }
  .hoja, .firma { max-width: 520px; }
}

@media (prefers-reduced-motion: reduce) {
  .nube, .bus, .cabina, .onda, .vista { animation: none; }
  .cabina-b { offset-distance: 60%; }
  .nube-a { transform: translate(300px, 120px); }
  .nube-b { transform: translate(900px, 210px); }
  .nube-c { transform: translate(1150px, 70px); }
  .bus { transform: translateX(1010px); }
  .cielo-noche, .urbe, .luz, .sol, .sol-halo, .barra, #estrellas circle { transition: none; }
}
