/* Colores: se pueden cambiar en config.js → colores */
:root {
  --fondo: #FDF8F5;
  --texto: #1F1D1B;
  --gris: #8A837D;
  --acento: #0F7A3D;
  --acento-suave: #E4F3E9;
  --dorado: #B7791F;
  --boton: #1F1D1B;
  --linea: rgba(31, 29, 27, .10);
  --linea-fuerte: rgba(31, 29, 27, .28);
  --tarjeta: #FFFFFF;
  --suave: rgba(31, 29, 27, .62);
  --radio: 18px;
  --curva: cubic-bezier(.2, .8, .2, 1);
  --fuente: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font-family: var(--fuente);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { -webkit-tap-highlight-color: transparent; }

/* ---------- Barra de progreso con brillo ---------- */
.progreso { position: fixed; top: 0; left: 0; right: 0; height: 4px; background: rgba(31, 29, 27, .06); z-index: 20; }
.progreso-barra { position: relative; height: 100%; width: 0; background: var(--acento); transition: width .5s var(--curva); overflow: hidden; border-radius: 0 4px 4px 0; }
.progreso-barra::after { content: ""; position: absolute; inset: 0; width: 40%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: brillo 1.8s ease-in-out infinite; }
@keyframes brillo { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------- Contenedor y transiciones ---------- */
.app { max-width: 520px; margin: 0 auto; padding: 56px 22px calc(130px + env(safe-area-inset-bottom)); min-height: 100svh; }
.pantalla { will-change: transform, opacity; }
.pantalla.entra-adelante { animation: entraAdelante .34s var(--curva) both; }
.pantalla.entra-atras { animation: entraAtras .34s var(--curva) both; }
.pantalla.sale-adelante { animation: saleAdelante .16s ease-in both; }
.pantalla.sale-atras { animation: saleAtras .16s ease-in both; }
@keyframes entraAdelante { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes entraAtras { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes saleAdelante { to { opacity: 0; transform: translateX(-20px); } }
@keyframes saleAtras { to { opacity: 0; transform: translateX(20px); } }

/* Cada bloque entra en su turno (el retraso lo pone app.js) */
.escalon { animation: subir .45s var(--curva) both; }
@keyframes subir { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }
@keyframes crecer { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes rebote { 0% { transform: scale(1); } 40% { transform: scale(1.05); } 100% { transform: scale(1); } }

/* ---------- Guía (burbuja tipo chat) ---------- */
.guia { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 18px; }
.avatar { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; background: var(--tarjeta); border: 1px solid var(--linea); display: grid; place-items: center; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar img.marca-img { width: 64%; height: 64%; object-fit: contain; }
.burbuja { position: relative; background: var(--tarjeta); border: 1px solid var(--linea); border-radius: 18px 18px 18px 6px; padding: 10px 14px; font-size: 15px; line-height: 1.4; color: var(--texto); box-shadow: 0 1px 2px rgba(0, 0, 0, .03); min-height: 41px; max-width: calc(100% - 44px); }
.burbuja .quien { display: block; font-size: 12px; font-weight: 600; color: var(--gris); margin-bottom: 1px; }
.burbuja .msg { animation: aparecer .3s ease-out .55s both; }
.escribiendo { position: absolute; left: 14px; bottom: 14px; display: flex; gap: 4px; animation: aparecer .1s reverse .55s forwards; }
.escribiendo i { width: 6px; height: 6px; border-radius: 50%; background: var(--gris); opacity: .5; animation: punto 1s infinite; }
.escribiendo i:nth-child(2) { animation-delay: .15s; }
.escribiendo i:nth-child(3) { animation-delay: .3s; }
@keyframes punto { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-3px); opacity: .9; } }
.burbuja .quien + .msg { display: block; }

/* ---------- Tipografía ---------- */
.marca { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; letter-spacing: -.02em; margin-bottom: 30px; }
.marca img { width: 22px; height: 22px; }
h1, h2 { font-weight: 600; letter-spacing: -.028em; margin: 0 0 22px; color: var(--texto); }
h1 { font-size: 34px; line-height: 1.08; }
h2 { font-size: 28px; line-height: 1.15; }
.pregunta { font-size: 19px; font-weight: 600; color: var(--suave); letter-spacing: -.015em; margin: 0 0 16px; }
p { margin: 0 0 14px; }
.texto { color: var(--suave); font-size: 17px; }
.ayuda { color: var(--gris); font-size: 14px; margin-top: 10px; }
.pie { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--gris); font-size: 14px; margin-top: 22px; }
.pie svg { width: 15px; height: 15px; }

/* ---------- Opciones de toque ---------- */
.opciones { display: grid; gap: 10px; }
.opciones.dos { grid-template-columns: 1fr 1fr; }
.opcion {
  position: relative; display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 64px; padding: 14px 18px;
  background: var(--tarjeta); color: var(--texto);
  border: 1.5px solid var(--linea); border-radius: var(--radio);
  font: inherit; font-weight: 600; font-size: 17px; letter-spacing: -.01em; text-align: left; cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .15s var(--curva);
}
.opcion:hover { border-color: var(--linea-fuerte); transform: translateY(-1px); }
.opcion:active { transform: scale(.985); }
.opciones.dos .opcion { justify-content: center; font-size: 22px; min-height: 84px; font-variant-numeric: tabular-nums; }
.opcion .emoji { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; background: #F6F0EB; display: grid; place-items: center; font-size: 20px; }
.opcion .marca-ok { position: absolute; right: 16px; top: 50%; width: 24px; height: 24px; margin-top: -12px; border-radius: 50%; background: var(--acento); color: #fff; display: grid; place-items: center; opacity: 0; transform: scale(.4); transition: opacity .18s, transform .28s var(--curva); }
.opciones.dos .opcion .marca-ok { top: 12px; right: 12px; margin: 0; width: 20px; height: 20px; }
.opcion .marca-ok svg { width: 14px; height: 14px; }
.opcion.elegida { border-color: var(--texto); box-shadow: 0 0 0 1px var(--texto), 0 6px 18px rgba(31, 29, 27, .08); animation: rebote .3s var(--curva); }
.opcion.elegida .marca-ok { opacity: 1; transform: scale(1); }
.opciones.bloqueadas .opcion:not(.elegida) { opacity: .45; transition: opacity .2s; }

/* ---------- Campos ---------- */
.campo { display: flex; align-items: center; background: var(--tarjeta); border: 1.5px solid var(--linea); border-radius: var(--radio); padding: 0 18px; transition: border-color .2s, box-shadow .2s; }
.campo:focus-within { border-color: var(--acento); box-shadow: 0 0 0 4px rgba(15, 122, 61, .12); }
.campo input, .campo select { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: var(--texto); padding: 17px 0; }
.campo.grande input { font-size: 26px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.campo input::placeholder { color: rgba(31, 29, 27, .28); font-weight: 400; }
.prefijo { color: var(--gris); font-weight: 600; margin-right: 10px; font-size: 16px; }
.campo select { flex: 0 0 auto; padding-right: 8px; margin-right: 10px; border-right: 1px solid var(--linea); font-size: 16px; }
label.etiqueta { display: block; font-size: 14px; font-weight: 600; margin: 18px 0 7px; color: var(--suave); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 11px 16px; border-radius: 999px; border: 1.5px solid var(--linea); background: var(--tarjeta); font: inherit; font-size: 15px; font-weight: 500; color: var(--texto); cursor: pointer; transition: all .2s var(--curva); }
.chip.elegida { border-color: var(--texto); background: var(--texto); color: var(--fondo); animation: rebote .3s var(--curva); }
.error { color: #B42318; font-size: 13px; margin-top: 6px; min-height: 18px; }

/* ---------- Cifras grandes ---------- */
.cifra { background: var(--acento-suave); border-radius: 24px; padding: 30px 20px 26px; text-align: center; margin: 4px 0 22px; animation: crecer .5s var(--curva) both; }
.cifra b { display: block; white-space: nowrap; color: var(--acento); font-size: clamp(32px, 10.5vw, 50px); font-weight: 700; letter-spacing: -.04em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.cifra b.larga { font-size: clamp(26px, 8.6vw, 40px); }
.cifra b.listo { animation: rebote .35s var(--curva); }
.cifra span { display: block; margin-top: 6px; color: var(--suave); font-size: 15px; font-weight: 500; }
.cifra.fuga { background: var(--texto); }
.cifra.fuga b { color: #fff; }
.cifra.fuga span { color: rgba(255, 255, 255, .6); }
.cifra .etiqueta-cifra { display: inline-block; margin: 0 0 12px; padding: 4px 10px; border-radius: 999px; background: rgba(255, 120, 90, .16); color: #FF9B83; font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.nota { color: var(--gris); font-size: 12.5px; line-height: 1.45; margin-top: 18px; }

/* ---------- Pantalla puente (cargando) ---------- */
.carga { padding-top: 12vh; text-align: center; }
.anillo { width: 64px; height: 64px; margin: 0 auto 26px; position: relative; }
.anillo svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.anillo circle { fill: none; stroke-width: 5; }
.anillo .fondo-anillo { stroke: rgba(31, 29, 27, .08); }
.anillo .frente { stroke: var(--acento); stroke-linecap: round; stroke-dasharray: 176; stroke-dashoffset: 176; animation: llenar var(--dur, 2s) var(--curva) forwards; }
@keyframes llenar { to { stroke-dashoffset: 0; } }
.carga h2 { font-size: 24px; margin-bottom: 26px; }
.lista-carga { list-style: none; padding: 0; margin: 0 auto; max-width: 300px; text-align: left; }
.lista-carga li { display: flex; align-items: center; gap: 12px; padding: 10px 0; color: var(--gris); font-size: 15px; opacity: 0; animation: subir .4s var(--curva) both; }
.lista-carga li .ok { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; border: 1.5px solid var(--linea-fuerte); display: grid; place-items: center; color: transparent; transition: all .25s var(--curva); }
.lista-carga li .ok svg { width: 13px; height: 13px; }
.lista-carga li.hecho { color: var(--texto); }
.lista-carga li.hecho .ok { background: var(--acento); border-color: var(--acento); color: #fff; animation: rebote .3s var(--curva); }
.lista-carga li b { margin-left: auto; font-weight: 600; color: var(--texto); font-variant-numeric: tabular-nums; }

/* ---------- Insignia y estado de zona ---------- */
.insignia { display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(180deg, #F7D774, #E3A92B); color: #4A2F00; font-size: 12.5px; font-weight: 700; padding: 7px 13px; border-radius: 999px; margin-bottom: 18px; letter-spacing: .03em; text-transform: uppercase; box-shadow: 0 2px 8px rgba(180, 120, 0, .3); }
.estado { display: flex; gap: 12px; align-items: center; border-radius: var(--radio); padding: 18px; margin-bottom: 16px; font-weight: 600; animation: crecer .45s var(--curva) both; }
.estado.libre { background: var(--acento-suave); color: var(--acento); }
.estado.ocupada { background: #FBF1DE; color: #7A4E0F; }

/* ---------- Viñetas con palomita ---------- */
.palomitas { list-style: none; padding: 0; margin: 0 0 22px; }
.palomitas li { position: relative; padding-left: 34px; margin-bottom: 12px; }
.palomitas li::before { content: ""; position: absolute; left: 0; top: 1px; width: 22px; height: 22px; border-radius: 50%; background: var(--acento) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/13px no-repeat; }

/* Consentimiento */
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--suave); margin-top: 16px; cursor: pointer; line-height: 1.45; }
.consent input { width: 20px; height: 20px; margin: 0; accent-color: var(--texto); flex: 0 0 auto; }
.consent a { color: var(--texto); }

/* Prueba social */
.social { margin-top: 26px; text-align: center; color: var(--gris); font-size: 14px; }
.social .estrellas { color: #E2A400; letter-spacing: 2px; }
.logos { display: flex; justify-content: center; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 12px; }
.logos img { height: 22px; width: auto; opacity: .8; }

/* ---------- Cómo funciona ---------- */
.escena { position: relative; height: 250px; margin: 4px 0 26px; display: flex; justify-content: center; }
.escena .tarjeta-wallet { width: 150px; height: auto; border-radius: 14px; box-shadow: 0 18px 40px rgba(31, 29, 27, .22); transform: rotate(-4deg); animation: crecer .6s var(--curva) .15s both; }
.notificacion { position: absolute; left: 50%; bottom: 6px; width: min(310px, 94%); margin-left: max(-155px, -47%); display: flex; gap: 10px; align-items: flex-start; background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border: 1px solid var(--linea); border-radius: 18px; padding: 11px 13px; box-shadow: 0 10px 30px rgba(31, 29, 27, .16); font-size: 13.5px; line-height: 1.35; animation: notif .55s var(--curva) .9s both; }
.notificacion .ico { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 8px; background: var(--texto); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.notificacion b { display: flex; justify-content: space-between; font-size: 13px; }
.notificacion b small { font-weight: 400; color: var(--gris); }
@keyframes notif { from { opacity: 0; transform: translateY(22px) scale(.96); } to { opacity: 1; transform: none; } }
.ejemplo { position: absolute; top: 0; right: 0; font-size: 11px; color: var(--gris); }
.pasos { list-style: none; padding: 0; margin: 0 0 20px; position: relative; }
.pasos::before { content: ""; position: absolute; left: 17px; top: 20px; bottom: 20px; width: 2px; background: var(--linea); }
.paso { position: relative; display: flex; gap: 14px; padding: 8px 0 14px; }
.paso .num { position: relative; z-index: 1; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; background: var(--tarjeta); border: 1.5px solid var(--linea); display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.paso b { display: block; font-size: 17px; margin: 6px 0 2px; letter-spacing: -.01em; }
.paso p { margin: 0; font-size: 15px; color: var(--suave); }
.cierre { font-weight: 600; text-align: center; font-size: 18px; letter-spacing: -.015em; }
.foto { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; display: block; margin-bottom: 16px; }

/* ---------- Caja de oferta ---------- */
.caja-verde { background: var(--acento-suave); border: 1px solid rgba(15, 122, 61, .18); border-radius: 22px; padding: 22px 20px; animation: crecer .5s var(--curva) both; }
.caja-verde p { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.caja-verde p:last-child { margin-bottom: 0; }
.caja-verde .garantia { font-size: 15px; font-weight: 500; border-top: 1px solid rgba(15, 122, 61, .18); padding-top: 14px; }

/* ---------- Gráfica ---------- */
.grafica { background: var(--tarjeta); border: 1px solid var(--linea); border-radius: 22px; padding: 18px 14px 12px; margin-bottom: 20px; }
.grafica svg { width: 100%; height: auto; display: block; overflow: visible; }
.leyenda { display: flex; gap: 16px; justify-content: center; font-size: 13px; color: var(--gris); margin-top: 8px; }
.leyenda i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.linea-dibujo { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: dibujar 1.4s var(--curva) .25s forwards; }
@keyframes dibujar { to { stroke-dashoffset: 0; } }
.punto-final { animation: crecer .35s var(--curva) 1.5s both; transform-box: fill-box; transform-origin: center; }
.destacado { font-size: 20px; font-weight: 600; letter-spacing: -.02em; line-height: 1.3; }
.destacado em { color: var(--acento); font-style: normal; }

/* ---------- Pantalla final ---------- */
.franja { background: var(--acento); color: #fff; border-radius: 14px; padding: 12px 16px; font-weight: 600; font-size: 15px; margin-bottom: 18px; }
.planes { display: grid; gap: 10px; margin: 6px 0 18px; }
.plan { position: relative; display: flex; align-items: center; gap: 12px; background: var(--tarjeta); border: 1.5px solid var(--linea); border-radius: var(--radio); padding: 16px; cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.plan.elegida { border-color: var(--texto); box-shadow: 0 0 0 1px var(--texto), 0 6px 18px rgba(31, 29, 27, .08); }
.plan input { accent-color: var(--texto); width: 18px; height: 18px; margin: 0; }
.plan .info { flex: 1; }
.plan .nombre { display: block; font-weight: 700; }
.plan .detalle { display: block; font-size: 13px; line-height: 1.35; color: var(--gris); margin-top: 2px; }
.plan .precio { text-align: right; font-weight: 700; white-space: nowrap; }
.plan .precio small { display: block; font-weight: 500; color: var(--gris); font-size: 12px; }
.plan .etiqueta-plan { position: absolute; top: -10px; right: 14px; background: var(--acento); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.confianza { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; font-size: 13.5px; color: var(--suave); margin: 14px 0; }
.confianza span::before { content: "✓ "; color: var(--acento); font-weight: 800; }
.letra-chica { font-size: 12px; color: var(--gris); line-height: 1.5; }
.pie-pagina { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--linea); font-size: 12px; color: var(--gris); text-align: center; }
.pie-pagina a { color: var(--gris); }

/* ---------- Botón fijo ---------- */
.cta-fija { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--fondo) 72%, rgba(253, 248, 245, 0)); transition: transform .3s var(--curva), opacity .3s; }
.cta-fija[hidden] { display: block; transform: translateY(110%); opacity: 0; pointer-events: none; }
.boton { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; max-width: 476px; margin: 0 auto; min-height: 58px; border: 0; border-radius: 16px; background: var(--boton); color: #fff; font: inherit; font-size: 17px; font-weight: 600; letter-spacing: -.01em; cursor: pointer; box-shadow: 0 8px 20px rgba(31, 29, 27, .18); transition: background .2s, box-shadow .2s, transform .15s var(--curva); }
.boton:active { transform: scale(.985); }
.boton:disabled { background: #D9D2CB; box-shadow: none; cursor: default; }
.boton.cargando { opacity: .7; }

/* Marcador de dato pendiente: visible a propósito */
mark.pendiente { background: #FFE58A; color: #5A4500; padding: 0 3px; border-radius: 3px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
  .burbuja .msg { opacity: 1; }
  .escribiendo { display: none; }
}

/* Solo para capturas (?quieto=1): todo en su estado final */
.quieto *, .quieto *::before, .quieto *::after { animation-duration: 0s !important; animation-delay: 0s !important; transition: none !important; }
.quieto .escribiendo { display: none; }
.quieto .anillo .frente { animation: none; stroke-dashoffset: 60; }
.quieto .progreso-barra::after { display: none; }
