/* ═══════════════════════════════════════════
   DIAGNÓSTICO WEB (mstudio.tv/diagnostico/ · inc/diagnostico.php + assets/js/diagnostico.js)
   Mismo lenguaje de las landings: fondo oscuro, magenta de acento; el amarillo queda solo en el botón de la cabecera.
   Semáforo: rojo #ff5c6c · amarillo #ffbb00 · verde #2bd48a (sobre fondo oscuro).
   ═══════════════════════════════════════════ */
:root { --dg-red: #ff5c6c; --dg-yellow: #ffbb00; --dg-green: #2bd48a; }

.ms-dg-sec { padding-block: 0 clamp(4rem, 9vw, 7rem); }
.ms-diag-result .ms-lp-hero { display: none; }
.ms-diag-result .ms-dg-sec { padding-top: clamp(2.5rem, 6vw, 4.5rem); }

.ms-dg {
    max-width: 760px; margin-inline: auto; scroll-margin-top: 96px;
    padding: clamp(1.4rem, 4vw, 2.6rem);
    background: rgba(255,255,255,.025); border: 1px solid var(--clr-border); border-radius: var(--radius-lg);
    box-shadow: 0 30px 80px rgba(0,0,0,.35);
}
.ms-dg[data-ms-diag]:not(.is-ready) { min-height: 360px; }
.ms-dg__note { color: var(--clr-text-muted); font-size: .88rem; line-height: 1.6; margin: 0; }
.ms-dg__note a, .ms-dg__lead a { color: var(--clr-text); text-decoration: underline; }

/* ── Test ── */
.ms-dg__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .7rem; min-height: 1.8rem; }
.ms-dg__count { font-size: .78rem; letter-spacing: .08em; color: var(--clr-text-muted); font-variant-numeric: tabular-nums; }
.ms-dg__back { background: none; border: 0; padding: .3rem 0; color: var(--clr-text-muted); font: inherit; font-size: .85rem; cursor: pointer; }
.ms-dg__back:hover { color: var(--clr-text); }
.ms-dg__progress { height: 4px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; margin-bottom: clamp(1.6rem, 4vw, 2.4rem); }
.ms-dg__progress span { display: block; height: 100%; border-radius: 99px; background: var(--grad-text); transition: width .45s var(--ease-out); }
.ms-dg__q { font-family: var(--font-display); font-size: clamp(1.6rem, 3.6vw, 2.25rem); line-height: 1.12; margin: 0 0 .6rem; outline: none; }
.ms-dg__help { color: var(--clr-text-muted); font-size: .92rem; line-height: 1.6; margin: 0 0 1.2rem; }
.ms-dg__opts { display: grid; gap: .65rem; margin-top: 1.4rem; }
.ms-dg__opt {
    display: flex; align-items: center; gap: .9rem; width: 100%; text-align: left; cursor: pointer;
    padding: 1rem 1.1rem; border-radius: var(--radius-md);
    background: rgba(255,255,255,.03); border: 1px solid var(--clr-border); color: var(--clr-text);
    font: inherit; font-size: 1rem; line-height: 1.4;
    transition: border-color .2s, background .2s, transform .2s var(--ease-out);
}
.ms-dg__opt:hover { border-color: rgba(227,63,255,.45); background: rgba(227,63,255,.05); transform: translateX(3px); }
.ms-dg__opt:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(227,63,255,.3); }
.ms-dg__opt.is-on { border-color: var(--clr-accent); background: rgba(227,63,255,.1); }
.ms-dg__key {
    flex: none; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 8px;
    border: 1px solid rgba(255,255,255,.16); font-size: .78rem; font-weight: 500; color: var(--clr-text-muted);
    padding-top: var(--ms-text-nudge);
}
.ms-dg__opt.is-on .ms-dg__key { background: var(--clr-accent); border-color: var(--clr-accent); color: #fff; }

.ms-dg__form .ms-cf__grid { margin-top: 1.4rem; }
.ms-dg__form > .ms-cf__field { margin-top: 1.2rem; }
.ms-dg__form input[type="text"] { font-size: 1.05rem; }
.ms-dg__next { margin-top: 1.4rem; justify-content: center; }
.ms-dg__send { width: 100%; }
.ms-dg__skip { display: block; margin: 1rem 0 0; padding: .4rem 0; background: none; border: 0; color: var(--clr-text-muted); font: inherit; font-size: .9rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ms-dg__skip:hover { color: var(--clr-text); }
.ms-dg__send[disabled] { opacity: .75; cursor: progress; }
.ms-dg__opt-l { color: var(--clr-text-muted); font-weight: 400; }
.ms-dg__hp, .ms-dg .screen-reader-text { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ms-dg__rc { margin: .9rem 0 0; text-align: center; font-size: .72rem; color: var(--clr-text-muted); }
.ms-dg__rc a { color: inherit; text-decoration: underline; }
.grecaptcha-badge { visibility: hidden; }

/* ── Resultado ── */
.ms-dg--result { max-width: 860px; }
.ms-dg__summary { display: flex; gap: clamp(1.2rem, 4vw, 2.4rem); align-items: center; margin-bottom: clamp(1.8rem, 4vw, 2.6rem); }
.ms-dg__light {
    flex: none; display: grid; gap: .55rem; padding: .8rem .7rem; border-radius: 1.4rem;
    background: #06051a; border: 1px solid rgba(255,255,255,.1); box-shadow: inset 0 2px 10px rgba(0,0,0,.6);
}
.ms-dg__light span { width: clamp(2.4rem, 7vw, 3.4rem); aspect-ratio: 1; border-radius: 50%; background: rgba(255,255,255,.06); }
.ms-dg__light--rojo span:nth-child(1) { background: var(--dg-red); box-shadow: 0 0 28px var(--dg-red), 0 0 6px var(--dg-red); }
.ms-dg__light--amarillo span:nth-child(2) { background: var(--dg-yellow); box-shadow: 0 0 28px var(--dg-yellow), 0 0 6px var(--dg-yellow); }
.ms-dg__light--verde span:nth-child(3) { background: var(--dg-green); box-shadow: 0 0 28px var(--dg-green), 0 0 6px var(--dg-green); }
.ms-dg__eyebrow { font-size: .72rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--clr-accent); margin: 0 0 .6rem; }
.ms-dg__headline { font-family: var(--font-display); font-size: clamp(1.8rem, 4.4vw, 2.9rem); line-height: 1.05; margin: 0 0 .9rem; }
.ms-dg__score { display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem .6rem; margin: 0; }
.ms-dg__score b { font-family: var(--font-display); font-size: clamp(2.4rem, 6vw, 3.4rem); line-height: 1; }
.ms-dg__score > span { color: var(--clr-text-muted); }
.ms-dg__score em { font-style: normal; font-size: .82rem; font-weight: 500; padding: calc(.3rem + var(--ms-text-nudge)) .8rem calc(.3rem - var(--ms-text-nudge)); border-radius: 99px; border: 1px solid currentColor; margin-left: .3rem; }
.ms-dg__url { margin: .5rem 0 0; color: var(--clr-text-muted); font-size: .88rem; overflow-wrap: anywhere; }
.is-rojo { color: var(--dg-red); } .is-amarillo { color: var(--dg-yellow); } .is-verde { color: var(--dg-green); }

.ms-dg__areas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.ms-dg__area { padding: 1.1rem 1.2rem; border-radius: var(--radius-md); background: rgba(255,255,255,.03); border: 1px solid var(--clr-border); }
.ms-dg__area-top { display: flex; align-items: center; gap: .6rem; margin-bottom: .7rem; font-size: .95rem; }
.ms-dg__area-n { margin-left: auto; color: var(--clr-text-muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.ms-dg__dot { width: .7rem; height: .7rem; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; flex: none; }
.ms-dg__bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.ms-dg__bar span { display: block; height: 100%; border-radius: 99px; background: currentColor; }
.ms-dg__area p { margin: .7rem 0 0; color: #bdbbd6; font-size: .9rem; line-height: 1.5; }

.ms-dg__h2 { font-family: var(--font-display); font-size: clamp(1.35rem, 3vw, 1.7rem); margin: clamp(2rem, 5vw, 2.8rem) 0 1rem; }
.ms-dg__finds, .ms-dg__gains { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.ms-dg__finds li {
    display: grid; gap: .3rem; padding: 1rem 1.2rem 1rem 1.3rem; border-radius: 0 var(--radius-md) var(--radius-md) 0;
    background: rgba(255,255,255,.03); border: 1px solid var(--clr-border); border-left: 3px solid var(--clr-text-muted);
}
.ms-dg__finds li.sev-3 { border-left-color: var(--dg-red); }
.ms-dg__finds li.sev-2 { border-left-color: var(--dg-yellow); }
.ms-dg__finds b, .ms-dg__gains b { font-size: 1rem; }
.ms-dg__finds span, .ms-dg__gains span { color: #bdbbd6; font-size: .92rem; line-height: 1.55; }
.ms-dg__gains { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ms-dg__gains li { display: grid; gap: .3rem; padding: 1rem 1.2rem; border-radius: var(--radius-md); background: rgba(43,212,138,.05); border: 1px solid rgba(43,212,138,.2); }

.ms-dg__cta {
    display: flex; align-items: center; justify-content: space-between; gap: 1.4rem; flex-wrap: wrap;
    margin: clamp(2rem, 5vw, 2.8rem) 0 1.2rem; padding: clamp(1.3rem, 3vw, 1.8rem);
    border-radius: var(--radius-lg); background: var(--grad-glow), rgba(227,63,255,.06); border: 1px solid var(--clr-border-acc);
}
.ms-dg__cta > div { flex: 1 1 320px; }
.ms-dg__adv { display: grid; margin: 0 0 .6rem; }
.ms-dg__adv b { font-family: var(--font-display); font-size: 1.4rem; }
.ms-dg__adv span { color: var(--clr-text-muted); font-size: .88rem; }
.ms-dg__lead { color: #bdbbd6; font-size: .95rem; line-height: 1.6; margin: 0; }
.ms-dg__wa { flex: none; }

@media (max-width: 640px) {
    .ms-dg { border-radius: var(--radius-md); }
    .ms-dg__opt { padding: .9rem; font-size: .95rem; }
    .ms-dg__summary { align-items: flex-start; }
    .ms-dg__areas, .ms-dg__gains { grid-template-columns: 1fr; }
    .ms-dg__wa { width: 100%; justify-content: center; white-space: normal; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
    .ms-dg__opt, .ms-dg__progress span { transition: none; }
}
.ms-lp-sec.ms-dg-sec { border-top: 0; }
.ms-dg h1, .ms-dg h2 { max-width: none; }
.ms-lp-hero:has(+ .ms-dg-sec) { padding-bottom: clamp(2rem, 4vw, 3rem); }

/* ── Celular: la primera pregunta tiene que verse sin bajar (la mayoría llega desde anuncios de Facebook en Android).
   Antes la portada ocupaba casi toda la pantalla y el aviso de cookies tapaba las opciones: solo 6 % empezaba el test. ── */
@media (max-width: 640px) {
    .ms-lp-hero:has(+ .ms-dg-sec) { padding-top: 1.4rem; padding-bottom: 1rem; }
    .ms-lp-hero:has(+ .ms-dg-sec) .ms-lp-eyebrow { margin-bottom: .75rem; }
    .ms-lp-hero:has(+ .ms-dg-sec) .ms-lp-title { font-size: 2rem; line-height: 1.05; max-width: none; margin-bottom: .6rem; }
    .ms-lp-hero:has(+ .ms-dg-sec) .ms-lp-lead { font-size: .95rem; line-height: 1.5; margin-bottom: 0; }
    .ms-dg:not(.ms-dg--result) { padding: 1rem 1rem 1.2rem; scroll-margin-top: 76px; }
    .ms-dg__top { margin-bottom: .4rem; min-height: 1.5rem; }
    .ms-dg__progress { margin-bottom: 1rem; }
    .ms-dg__q { font-size: 1.35rem; }
    .ms-dg__opts { margin-top: .9rem; gap: .5rem; }
    .ms-dg__opt { padding: .75rem .85rem; }
    .ms-dg__key { width: 1.7rem; height: 1.7rem; }
}

/* ── Revisión de la web (fase 2) ── */
.ms-dg__wait { display: flex; gap: 1rem; align-items: center; margin-top: 1.4rem; padding: 1.1rem 1.3rem; border-radius: var(--radius-md); border: 1px solid var(--clr-border-acc); background: rgba(227,63,255,.05); }
.ms-dg__wait b { display: block; margin-bottom: .2rem; }
.ms-dg__wait span:not(.ms-dg__spin) { color: #bdbbd6; font-size: .9rem; line-height: 1.5; }
.ms-dg__spin { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--clr-accent); animation: ms-dg-spin .9s linear infinite; }
@keyframes ms-dg-spin { to { transform: rotate(360deg); } }
.ms-dg__tech { display: flex; gap: 1.6rem; align-items: flex-start; }
.ms-dg__facts { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: .55rem 1rem; margin: 0; font-size: .9rem; }
.ms-dg__facts dt { color: var(--clr-text-muted); }
.ms-dg__facts dd { margin: 0; overflow-wrap: anywhere; }
.ms-dg__fdot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin-right: .5rem; background: currentColor; }
.ms-dg__fdot.is-ok { color: var(--dg-green); } .ms-dg__fdot.is-warn { color: var(--dg-yellow); } .ms-dg__fdot.is-bad { color: var(--dg-red); }
.ms-dg__shot { flex: none; width: 170px; margin: 0; text-align: center; }
.ms-dg__shot img { width: 100%; display: block; border: 6px solid #06051a; border-radius: 20px; box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 20px 50px rgba(0,0,0,.5); }
.ms-dg__shot figcaption { margin-top: .6rem; font-size: .78rem; color: var(--clr-text-muted); }
.ms-dg__src { font-style: normal; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--clr-accent); }
@media (max-width: 640px) {
    .ms-dg__tech { flex-direction: column-reverse; align-items: center; }
    .ms-dg__facts { width: 100%; grid-template-columns: 1fr; gap: .1rem; }
    .ms-dg__facts dd { margin-bottom: .6rem; }
}
@media (prefers-reduced-motion: reduce) { .ms-dg__spin { animation-duration: 3s; } }

/* ── Pantalla de espera: primero la revisión de la web, después la nota ── */
.ms-dg--wait { text-align: center; max-width: 640px; }
.ms-dg--wait .ms-dg__url { margin: -.3rem 0 1.6rem; }
.ms-dg__radar { position: relative; width: 84px; height: 84px; margin: .4rem auto 1.6rem; }
.ms-dg__radar span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--clr-accent); opacity: 0; animation: ms-dg-ping 2.4s var(--ease-out) infinite; }
.ms-dg__radar span:nth-child(2) { animation-delay: .8s; }
.ms-dg__radar span:nth-child(3) { animation-delay: 1.6s; }
.ms-dg__radar::after { content: ''; position: absolute; inset: 30px; border-radius: 50%; background: var(--grad-text); box-shadow: 0 0 24px rgba(227,63,255,.6); }
@keyframes ms-dg-ping { 0% { transform: scale(.35); opacity: .9; } 100% { transform: scale(1); opacity: 0; } }
.ms-dg__steps { list-style: none; margin: 0 auto 1.6rem; padding: 0; display: inline-grid; gap: .7rem; text-align: left; }
.ms-dg__steps li { position: relative; padding-left: 2rem; color: var(--clr-text-muted); font-size: .95rem; transition: color .4s; }
.ms-dg__steps li::before { content: ''; position: absolute; left: 0; top: .1rem; width: 1.15rem; height: 1.15rem; border-radius: 50%; border: 2px solid rgba(255,255,255,.15); box-sizing: border-box; }
.ms-dg__steps li.is-on { color: var(--clr-text); }
.ms-dg__steps li.is-on::before { border-color: rgba(255,255,255,.15); border-top-color: var(--clr-accent); animation: ms-dg-spin .9s linear infinite; }
.ms-dg__steps li.is-done { color: #bdbbd6; }
.ms-dg__steps li.is-done::before { border-color: var(--dg-green); background: var(--dg-green); }
.ms-dg__steps li.is-done::after { content: ''; position: absolute; left: .38rem; top: .3rem; width: .3rem; height: .55rem; border: solid #06051a; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ms-dg__acts { display: grid; gap: .6rem; flex: none; }
.ms-dg__acts .ms-btn { justify-content: center; }
@media (prefers-reduced-motion: reduce) { .ms-dg__radar span, .ms-dg__steps li.is-on::before { animation: none; } }
