/* Calculadora de comisiones · KINFORTIS Web (pensada primero para el celular) */
:root {
  --navy: #00020e; --ink: #14212a; --muted: #5d6b72; --paper: #f4f1ec; --line: #e2ddd3;
  --kf: #1a6fd6; --kf-light: #3ea6ff; --red: #c4453c; --green: #1f8a57; --warm: #d9824b;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); background: var(--paper); line-height: 1.45; }

.top { background: var(--navy); color: #fff; padding: 1.4rem 1.2rem 1.6rem; display: flex; gap: 1rem; align-items: flex-start;
       background-image: radial-gradient(circle at 90% 0%, rgba(62,166,255,.3), transparent 60%); }
.top img { width: 52px; height: auto; border-radius: 10px; flex: none; box-shadow: 0 0 20px -4px rgba(62,166,255,.7); }
.marca { font-size: .78rem; font-weight: 800; letter-spacing: .16em; color: #cfe0f2; }
.marca b { color: var(--kf-light); }
h1 { font-size: 1.45rem; line-height: 1.15; margin: .3rem 0 .4rem; letter-spacing: -.01em; }
.sub { color: #cfe0f2; font-size: .92rem; }

main { max-width: 640px; margin: -0.8rem auto 0; padding: 0 .9rem 1.5rem; display: grid; gap: .9rem; }
.card, .resultado { background: #fff; border-radius: 18px; padding: 1.1rem 1rem 1.2rem; box-shadow: 0 10px 30px -18px rgba(0,2,14,.35); }
h2 { font-size: 1.02rem; display: flex; align-items: center; gap: .55rem; margin-bottom: .9rem; }
h2 .n { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: .82rem; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.campo { display: grid; gap: .35rem; margin-bottom: .9rem; font-size: .88rem; font-weight: 600; }
.campo > span:first-child b { color: var(--kf); }
.fila { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.fila .campo { align-content: start; }
select, input:not([type=range]) { width: 100%; font: 600 1rem system-ui, sans-serif; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line); border-radius: 12px; padding: .7rem .75rem; min-height: 46px; }
select:focus, input:focus { outline: 2px solid var(--kf); outline-offset: 1px; }
.dinero, .pct { position: relative; display: block; }
.dinero i, .pct i { position: absolute; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); font-weight: 700; }
.dinero i { left: .8rem; }
.dinero input { padding-left: 1.6rem; }
.pct i { right: .85rem; }
.pct input { padding-right: 2rem; }
input[type=range] { width: 100%; accent-color: var(--kf); height: 28px; }
.ayuda { font-weight: 400; color: var(--muted); font-size: .76rem; line-height: 1.35; }
.incluye { font-size: .8rem; color: var(--muted); background: var(--paper); border-radius: 10px; padding: .6rem .7rem; }
.incluye b { color: var(--ink); }

.resultado { display: grid; gap: .8rem; border: 2px solid var(--navy); }
.grande { border-radius: 14px; padding: .85rem .9rem; display: grid; gap: .15rem; }
.grande small { font-size: .82rem; }
.grande strong { font-size: 2rem; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.grande.malo { background: #fdf0ee; color: #7d2a24; }
.grande.malo strong { color: var(--red); }
.grande.bueno { background: #eaf6ef; color: #17583a; }
.grande.bueno strong { color: var(--green); }

.barras { display: grid; gap: .45rem; font-size: .76rem; color: var(--muted); }
.barra { display: grid; grid-template-columns: 7.5rem 1fr; align-items: center; gap: .5rem; }
.barra > div { background: var(--paper); border-radius: 6px; height: 12px; overflow: hidden; }
.barra i { display: block; height: 100%; border-radius: 6px; width: 0; transition: width .35s ease; }
.b-malo { background: var(--red); }
.b-bueno { background: var(--green); }

.detalle { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.detalle div { background: var(--paper); border-radius: 12px; padding: .6rem .7rem; }
.detalle dt { font-size: .74rem; color: var(--muted); font-weight: 600; }
.detalle dd { font-size: 1.05rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.detalle dd.pos { color: var(--green); }
.detalle dd.neg { color: var(--red); }

.claves { list-style: none; display: grid; gap: .4rem; font-size: .88rem; }
.claves li { padding-left: 1.5rem; position: relative; }
.claves li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--kf); color: #fff; font-size: .7rem; display: grid; place-items: center; font-weight: 800; }
.claves b { color: var(--kf); }
.consejo { background: #fff6e8; color: #7a4a12; border-radius: 12px; padding: .7rem .8rem; font-size: .84rem; font-weight: 600; }

.acciones { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.btn { display: grid; place-items: center; text-align: center; min-height: 48px; border-radius: 999px; padding: .6rem 1rem; font: 700 .92rem system-ui, sans-serif;
       background: var(--navy); color: #fff; text-decoration: none; border: 2px solid var(--navy); cursor: pointer; }
.btn.sec { background: #fff; color: var(--navy); }
.btn:focus-visible { outline: 3px solid var(--kf-light); outline-offset: 2px; }
.copiado { font-size: .8rem; color: var(--green); font-weight: 600; text-align: center; }

.nota { font-size: .78rem; color: var(--muted); padding: 0 .3rem; }
.nota b { color: var(--ink); }
.privado { font-size: .76rem; color: var(--muted); text-align: center; }
footer { text-align: center; font-size: .72rem; color: var(--muted); padding: 0 1rem 1.6rem; }

@media (max-width: 380px) {
  .fila, .acciones, .detalle { grid-template-columns: 1fr; }
  .grande strong { font-size: 1.7rem; }
}
@media (min-width: 700px) {
  .top { justify-content: center; padding: 2rem 1.5rem 2.2rem; }
  .top > div { max-width: 540px; }
  h1 { font-size: 1.9rem; }
}
@media (prefers-reduced-motion: reduce) { .barra i { transition: none; } }
