/* =====================================================================
 * Nítido — estilos del calibrador (diagnóstico + módulo Pro)
 * ===================================================================== */
.app { display: grid; grid-template-columns: 300px 1fr; gap: 24px; padding: 2rem 0 1rem; align-items: start }

/* Guía lateral: Nito + globo + pasos */
.guide { position: sticky; top: 86px; display: grid; gap: 1rem }
.guide__nito { width: 150px; justify-self: center; margin-top: 1.2rem }
.guide .bubble { animation: pop .45s cubic-bezier(.3,1.4,.5,1) both; min-height: 3.2em }
.guide .bubble::after { content: ""; position: absolute; width: 16px; height: 16px; background: #fff; transform: rotate(45deg); left: 50%; bottom: -7px; margin-left: -8px }
.steps { list-style: none; display: grid; gap: 6px; counter-reset: s }
.steps li { display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; border-radius: 14px; color: var(--text3); font-weight: 600; font-size: 14.5px; border: 1px solid transparent; transition: all .3s }
.steps li::before { counter-increment: s; content: counter(s); width: 26px; height: 26px; flex: none; border-radius: 8px; display: grid; place-items: center; font: 700 12.5px var(--display); background: var(--surface); border: 1px solid var(--line2) }
.steps li.on { color: var(--text); background: var(--surface); border-color: var(--line2) }
.steps li.on::before { background: var(--btn); border-color: transparent; color: #fff }
.steps li.done { color: var(--text2) }
.steps li.done::before { content: "✓"; background: rgba(31,212,180,.15); color: var(--mint); border-color: rgba(31,212,180,.4) }
.pro-badge { display: inline-flex; align-items: center; gap: .35rem; font: 700 12px var(--body); letter-spacing: .04em; text-transform: uppercase; background: var(--btn); color: #fff; border-radius: 999px; padding: .25rem .7rem }

/* Escenario */
.stage { display: grid; gap: 16px; min-width: 0 }
.viz { padding: 1rem 1rem .9rem }
.viz__top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: .7rem; font-size: 13.5px; color: var(--text2) }
.viz__dev { display: inline-flex; align-items: center; gap: .45rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.viz__dev i { width: 8px; height: 8px; border-radius: 50%; background: var(--text3); flex: none }
.viz__dev.live i { background: var(--mint); animation: ping 1.6s infinite }
.viz__db { font: 700 15px var(--display); font-variant-numeric: tabular-nums; color: var(--text) }
.viz canvas { width: 100%; height: 150px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line) }
.meter { position: relative; height: 14px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; margin-top: .7rem }
.meter__bar { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--mint), var(--cyan) 55%, var(--warn) 82%, var(--red)); transition: width .06s linear }
.meter__thr { position: absolute; top: -2px; bottom: -2px; width: 3px; border-radius: 2px; background: #fff; box-shadow: 0 0 8px #fff; display: none }
.scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--text3); margin-top: .3rem }

.step { animation: fadeUp .45s ease both }
.step h2 { font: 800 clamp(1.5rem, 3.4vw, 2.1rem)/1.15 var(--display); letter-spacing: -.02em; margin: .4rem 0 .6rem }
.step > p { color: var(--text2); max-width: 62ch }
.step .actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.4rem; align-items: center }
.feat { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-top: 1.2rem }
.feat li { display: flex; gap: .6rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .75rem .85rem; font-size: 14.5px; color: var(--text2) }
.feat li b { color: var(--text) }
.feat li .lock { margin-left: auto; flex: none }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.2rem }
.q { font: 700 14px var(--body); color: var(--text2); margin-bottom: .5rem }

/* Anillo de cuenta regresiva */
.ring { position: relative; width: 190px; height: 190px; margin: 1.4rem auto .6rem }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg) }
.ring circle { fill: none; stroke-width: 12 }
.ring .bg { stroke: var(--surface2) }
.ring .fg { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset .1s linear }
.ring__in { position: absolute; inset: 0; display: grid; place-content: center; text-align: center }
.ring__in b { font: 800 3rem/1 var(--display); font-variant-numeric: tabular-nums }
.ring__in span { font-size: 13px; color: var(--text2) }
.phrase { text-align: center; font: 700 clamp(1.1rem, 2.6vw, 1.45rem)/1.4 var(--display); background: var(--surface); border: 1px dashed var(--line2); border-radius: 18px; padding: 1rem 1.2rem; margin-top: 1rem }
.found { list-style: none; display: grid; gap: .55rem; margin-top: 1rem }
.found li { display: flex; align-items: center; gap: .75rem; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .7rem .9rem; animation: pop .45s cubic-bezier(.3,1.4,.5,1) both }
.found li .ic { font-size: 22px; flex: none }
.found li .tx { flex: 1; min-width: 0 }
.found li .tx small { display: block; color: var(--text3); font-size: 12.5px }

/* Resultado */
.result-head { display: grid; grid-template-columns: auto 1fr; gap: 1.6rem; align-items: center }
.score { position: relative; width: 170px; height: 170px }
.score svg { width: 100%; height: 100%; transform: rotate(-90deg) }
.score circle { fill: none; stroke-width: 13 }
.score .bg { stroke: var(--surface2) }
.score .fg { stroke-linecap: round; transition: stroke-dashoffset 1.4s cubic-bezier(.2,.8,.2,1), stroke .4s }
.score__in { position: absolute; inset: 0; display: grid; place-content: center; text-align: center }
.score__in b { font: 800 3.4rem/1 var(--display); font-variant-numeric: tabular-nums }
.score__in span { font-size: 12.5px; color: var(--text3); letter-spacing: .1em; text-transform: uppercase }
.result-head .eyebrow { display: block }
.grade { display: block; font: 800 1.9rem/1.15 var(--display); margin: .2rem 0 .4rem }

/* Bloqueo (diagnóstico gratis) */
.locked { position: relative; border-radius: 22px; overflow: hidden; border: 1px solid var(--line2); margin-top: 1.2rem }
.locked__blur { filter: blur(6px); opacity: .55; pointer-events: none; user-select: none; padding: 1.2rem; display: grid; gap: .55rem }
.locked__blur div { display: flex; justify-content: space-between; background: var(--surface); border-radius: 12px; padding: .6rem .8rem }
.locked__cta { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; gap: .7rem; padding: 1.2rem; background: linear-gradient(180deg, rgba(10,15,31,.35), rgba(10,15,31,.92) 60%) }
.locked__cta h3 { font: 800 1.3rem var(--display); max-width: 28ch }
.locked__cta p { color: var(--text2); font-size: 14.5px; max-width: 46ch }
.locked__cta .row { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center }
.lockico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; background: var(--btn); box-shadow: 0 14px 30px -12px rgba(123,77,242,.9); animation: tpulse 2.4s ease-in-out infinite }

/* Diálogo de código */
dialog.modal { margin: auto; border: 1px solid var(--line2); border-radius: 24px; background: var(--panel); color: var(--text); padding: 1.6rem; width: min(440px, calc(100vw - 32px)); box-shadow: 0 40px 80px -20px #000 }
dialog.modal::backdrop { background: rgba(6,9,20,.75); backdrop-filter: blur(6px) }
dialog.modal h3 { font: 800 1.35rem var(--display); margin-bottom: .4rem }
dialog.modal p { color: var(--text2); font-size: 14.5px }
dialog.modal form { display: grid; gap: .8rem; margin-top: 1rem }
dialog.modal input { text-transform: uppercase; letter-spacing: .12em; font: 700 18px var(--display); text-align: center }
.err { color: var(--red); font-size: 14px; min-height: 1.2em }

/* ===== Módulo Pro ===== */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 5px; margin-top: 1.2rem }
.tabs button { flex: 1; min-width: 120px; border: 0; background: none; color: var(--text2); font: 600 14px var(--body); padding: .6rem .8rem; border-radius: 12px; cursor: pointer; transition: background .2s, color .2s }
.tabs button[aria-selected="true"] { background: var(--btn); color: #fff }
.tabpane { margin-top: 1rem; animation: fadeUp .35s ease both }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin-top: 1rem }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .7rem .8rem }
.stat b { display: block; font: 800 1.35rem var(--display); font-variant-numeric: tabular-nums }
.stat span { font-size: 12px; color: var(--text3) }
.stat.hl { background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--btn) border-box; border: 1.5px solid transparent }
.settings { list-style: none; display: grid; gap: .45rem; margin-top: .8rem }
.settings li { display: flex; justify-content: space-between; align-items: center; gap: .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: .6rem .8rem; font-size: 14.5px; animation: fadeUp .35s ease both }
.settings li small { display: block; color: var(--text3); font-size: 12.5px }
.fixes { list-style: none; display: grid; gap: .6rem; margin-top: .8rem; counter-reset: f }
.fixes li { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .8rem .9rem .8rem 3rem; font-size: 14.5px; color: var(--text2) }
.fixes li::before { counter-increment: f; content: counter(f); position: absolute; left: .9rem; top: .8rem; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font: 700 12px var(--display); background: var(--btn); color: #fff }
.fixes li b { color: var(--text) }
.live { display: grid; grid-template-columns: auto 1fr; gap: 1.2rem; align-items: center; margin-top: .6rem }
.live__dot { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; font: 800 12px var(--display); text-align: center; background: var(--surface2); border: 3px solid var(--line2); color: var(--text3); transition: all .12s }
.live__dot.on { background: rgba(31,212,180,.18); border-color: var(--mint); color: var(--mint); box-shadow: 0 0 0 8px rgba(31,212,180,.12), 0 0 40px rgba(31,212,180,.45) }
.live__bar { height: 10px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; margin-top: .4rem }
.live__bar i { display: block; height: 100%; width: 0; background: var(--flow); transition: width .3s }
.ab { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: .8rem }
.ab .card { padding: 1rem }
.ab audio { width: 100%; margin-top: .6rem }
.profiles { list-style: none; display: grid; gap: .5rem; margin-top: .8rem }
.profiles li { display: grid; grid-template-columns: auto 1fr auto auto; gap: .8rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: .65rem .8rem }
.profiles .sc { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font: 800 15px var(--display); background: var(--bg); border: 1px solid var(--line2) }
.profiles small { color: var(--text3); display: block; font-size: 12.5px }
.iconbtn { border: 1px solid var(--line2); background: var(--bg); color: var(--text2); border-radius: 10px; padding: .35rem .6rem; cursor: pointer; font-size: 13px }
.iconbtn:hover { border-color: var(--cyan); color: var(--text) }

@media (max-width: 920px) {
    .app { grid-template-columns: 1fr }
    .guide { position: static; grid-template-columns: 110px 1fr; align-items: center }
    .guide__nito { width: 100px; margin: 0 }
    .guide .bubble::after { left: -7px; top: 50%; bottom: auto; margin: -8px 0 0 }
    .steps { grid-column: 1 / -1; grid-template-columns: repeat(4, 1fr) }
    .steps li { flex-direction: column; gap: .3rem; padding: .5rem .2rem; font-size: 12px; text-align: center }
    .stats { grid-template-columns: 1fr 1fr }
}
@media (max-width: 600px) {
    .feat, .grid2, .ab { grid-template-columns: 1fr }
    .result-head { grid-template-columns: 1fr; justify-items: center; text-align: center }
    .profiles li { grid-template-columns: auto 1fr auto }
    .profiles li .iconbtn:first-of-type { display: none }
}
