/* Estilos compartidos de las calculadoras públicas (public/calculadora-*.html). */
:root { --fondo: #0f1411; --tarjeta: #17201a; --texto: #eef2ef; --suave: #a8b3ab; --linea: #26302a; --lima: #c8e86a; --lima-txt: #17251a; --rojo: #ff8a7a; --campo: #0f1411; }
@media (prefers-color-scheme: light) {
  :root { --fondo: #f5f7f4; --tarjeta: #ffffff; --texto: #17251a; --suave: #56605a; --linea: #e1e6e2; --lima: #17251a; --lima-txt: #ffffff; --rojo: #c0392b; --campo: #f5f7f4; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fondo); color: var(--texto); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 640px; margin: 0 auto; padding: 24px 16px 56px; }
header a { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
header img { width: 36px; height: 36px; border-radius: 10px; }
h1 { font-size: clamp(1.7rem, 6vw, 2.3rem); line-height: 1.15; margin: 24px 0 8px; letter-spacing: -0.02em; }
.bajada { color: var(--suave); margin: 0 0 20px; }
.tarjeta { background: var(--tarjeta); border: 1px solid var(--linea); border-radius: 20px; padding: 18px; }
label { display: block; font-weight: 700; font-size: .95rem; margin: 14px 0 6px; }
label:first-child { margin-top: 0; }
.ayuda { color: var(--suave); font-weight: 400; font-size: .85rem; }
input[type=text] { width: 100%; font: inherit; font-size: 1.15rem; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--linea); background: var(--campo); color: var(--texto); }
input[type=text]:focus { outline: 2px solid var(--lima); outline-offset: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-weight: 700; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--linea); background: transparent; color: var(--texto); cursor: pointer; }
.chip[aria-pressed=true] { background: var(--lima); color: var(--lima-txt); border-color: var(--lima); }
.fila { display: flex; gap: 10px; align-items: center; }
.fila input { flex: 1; }
#resultado { margin-top: 16px; border-radius: 20px; padding: 18px; border: 1px solid var(--linea); background: var(--tarjeta); }
#resultado.vacio { color: var(--suave); }
.veredicto { font-size: 1.35rem; font-weight: 800; margin: 0 0 6px; }
.veredicto.cuotas { color: var(--lima); }
.veredicto.contado { color: var(--rojo); }
.detalle { margin: 0; color: var(--suave); }
.numeros { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.numeros div { border: 1px solid var(--linea); border-radius: 14px; padding: 10px 12px; }
.numeros small { display: block; color: var(--suave); font-size: .8rem; }
.numeros b { font-size: 1.1rem; }
.cta { margin-top: 20px; background: var(--tarjeta); border: 1px solid var(--linea); border-radius: 20px; padding: 18px; }
.cta h2 { font-size: 1.1rem; margin: 0 0 4px; }
.cta p { margin: 0 0 14px; color: var(--suave); }
.boton { display: inline-block; padding: 13px 22px; border-radius: 999px; text-decoration: none; font-weight: 700; background: var(--lima); color: var(--lima-txt); }
.tiendas { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.tiendas a { display: inline-flex; }
.tiendas .apple { height: 44px; width: auto; }
.tiendas .google { height: 59px; width: auto; margin: -7px -7px; }
h2.sec { font-size: 1.15rem; margin: 36px 0 8px; }
p { margin: 0 0 12px; }
.nota { color: var(--suave); font-size: .9rem; }
footer { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--linea); color: var(--suave); font-size: .9rem; }
footer a { color: inherit; margin-right: 14px; }
.tarjeta + .tarjeta { margin-top: 12px; }
table.comp { width: 100%; border-collapse: collapse; margin-top: 12px; }
table.comp td { padding: 10px 4px; border-top: 1px solid var(--linea); }
table.comp td:last-child { text-align: right; font-weight: 700; }
table.comp tr.mejor td { color: var(--lima); }
.etiqueta { display: inline-block; white-space: nowrap; font-size: .75rem; font-weight: 700; border: 1px solid currentColor; border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.otras { display: grid; gap: 8px; margin-top: 8px; }
.otras a { display: block; padding: 12px 14px; border: 1px solid var(--linea); border-radius: 14px; text-decoration: none; color: inherit; font-weight: 700; }
.codigo { font-size: 2.2rem; font-weight: 800; letter-spacing: .2em; margin: 4px 0 8px; color: var(--lima); }
.tarjeta .detalle { margin-bottom: 12px; }

/* ─── Barra de arriba, cinta y movimiento (como la portada) ─── */
nav.barra { display: flex; align-items: center; justify-content: space-between; }
nav.barra .marca { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 800; }
nav.barra .marca img { width: 36px; height: 36px; border-radius: 10px; }
nav.barra .entrar { text-decoration: none; font-weight: 700; font-size: .95rem; padding: 8px 16px; border: 1px solid var(--linea); border-radius: 999px; color: inherit; }
.ticker { overflow: hidden; margin-top: 14px; border: 1px solid var(--linea); border-radius: 999px; background: var(--tarjeta); font-size: .85rem; color: var(--suave); }
.ticker .pista { display: flex; gap: 32px; width: max-content; padding: 7px 0; animation: correr 34s linear infinite; }
.ticker:hover .pista { animation-play-state: paused; }
.ticker b { color: var(--texto); font-weight: 700; margin-left: 6px; }
.ticker .punto { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--lima); margin-right: 8px; vertical-align: 1px; animation: latido 2s infinite; }
@keyframes correr { to { transform: translateX(-50%); } }
@keyframes latido { 0% { box-shadow: 0 0 0 0 rgba(200,232,106,.6); } 70% { box-shadow: 0 0 0 7px rgba(200,232,106,0); } 100% { box-shadow: 0 0 0 0 rgba(200,232,106,0); } }
h1 em { font-style: normal; white-space: nowrap; background: linear-gradient(90deg, var(--lima), #e9ffb0, var(--lima)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: brillo 6s linear infinite; }
@keyframes brillo { to { background-position: -200% 0; } }
.chip { transition: background .15s, color .15s, transform .15s; }
.chip:active { transform: scale(.96); }
.otras a { transition: border-color .15s, transform .15s; }
.otras a:hover { border-color: var(--lima); transform: translateY(-2px); }
#resultado.pop { animation: pop .35s ease-out; }
@keyframes pop { from { transform: scale(.985); opacity: .6; } to { transform: none; opacity: 1; } }

/* Barras del resultado */
.barras { display: grid; gap: 12px; margin-top: 16px; }
.barra-fila .cab { display: flex; justify-content: space-between; gap: 10px; font-size: .92rem; margin-bottom: 5px; }
.barra-fila .cab b { white-space: nowrap; }
.barra-fila.mejor .cab { color: var(--lima); }
.riel { height: 12px; border-radius: 999px; background: var(--linea); overflow: hidden; }
.relleno { height: 100%; width: 0; border-radius: 999px; background: var(--suave); transition: width .7s cubic-bezier(.2,.8,.2,1); }
.barra-fila.mejor .relleno { background: var(--lima); }
.apilada { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: var(--linea); margin-top: 16px; }
.apilada span { display: block; height: 100%; width: 0; transition: width .7s cubic-bezier(.2,.8,.2,1); }
.leyenda { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: .85rem; color: var(--suave); }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

@media (prefers-reduced-motion: reduce) {
  .ticker .pista, .ticker .punto, h1 em, #resultado.pop { animation: none; }
  .relleno, .apilada span { transition: none; }
}
