/*!
 * M4 Tests — Frontend styles.
 * Typeform-style immersive experience with full-viewport takeover,
 * slide transitions, M4 brand palette.
 */

.m4t {
    /* ---- Paleta de marca M4 (ref. "Mejoras Test M4.pdf", pág. 9) ----
       Tokens oficiales: teal #476867, sage #88B7A8, ink #333333, amarillo #D4C65E.
       Se conservan --m4-dark (#0d3330, verde premium para CTAs sólidos) y
       --m4-medium como escalones más oscuros del mismo teal. */
    --m4-dark: #0d3330;
    --m4-medium: #2d4f4d;
    --m4-teal: #476867;          /* teal de marca (fondo hero/topbar) */
    --m4-sage: #88b7a8;          /* verde salvia (acentos suaves) */
    --m4-ink: #333333;           /* texto de marca */
    --m4-yellow: #d4c65e;        /* amarillo de marca (#D4C65E) */
    --m4-yellow-strong: #c2b24a; /* amarillo intenso para hover */
    --m4-bg-soft: #f4f4f0;
    --m4-bg-deep: #fafaf6;
    --m4-text: #1a1a1a;
    --m4-muted: #6b7775;
    --m4-border: #d8dcd6;
    --m4-error: #b94a4a;

    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--m4-text);
    background: linear-gradient(180deg, #ffffff 0%, var(--m4-bg-soft) 100%);
    border-radius: 14px;
    overflow: hidden;
    min-height: 560px;
    position: relative;
    box-shadow: 0 4px 32px rgba(13, 51, 48, 0.08);
    max-width: 920px;
    margin: 32px auto;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.m4t *,
.m4t *::before,
.m4t *::after {
    box-sizing: inherit;
}

/* ---- v1.3.0 defensive baseline ----
   When the shortcode is embedded inside a theme (Hello Elementor, Astra,
   GeneratePress, etc.), the theme styles generic <h1..h6>, <p>, <a>, <button>
   elements with its own brand. Force the M4 baseline so the test always
   looks like M4, never like the host theme. Applied with high specificity
   AND !important on color/font so neither selector tricks nor inheritance
   leak in. */
.m4t h1,
.m4t h2,
.m4t h3,
.m4t h4,
.m4t h5,
.m4t h6 {
    color: var(--m4-dark) !important;
    font-family: inherit !important;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 12px;
    text-shadow: none !important;
    text-transform: none;
    letter-spacing: -0.3px;
}
.m4t p,
.m4t li,
.m4t span,
.m4t label,
.m4t small,
.m4t strong {
    font-family: inherit !important;
}
.m4t a {
    color: var(--m4-dark);
    text-decoration: none;
}
.m4t a:hover {
    text-decoration: underline;
}

/* ---- IMMERSIVE MODE: full-viewport takeover ----
   v1.2.9: the JS reparents the test container to <body> on enter so we
   own the topmost stacking context. Combined with max int z-index this
   reliably hides theme headers/footers without breaking visibility
   inheritance on the test itself (that was the v1.2.7 regression). */
.m4t.is-immersive {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    max-width: none !important;
    border-radius: 0 !important;
    z-index: 2147483647 !important; /* max signed 32-bit int */
    background: linear-gradient(135deg, #ffffff 0%, #f4f4f0 100%) !important;
    color: #0d3330 !important; /* default text color inside the overlay, so themes that style * with light gray don't bleed in */
    overflow: hidden;
}
body.m4t-locked {
    overflow: hidden !important;
}

/* ---- DARK HERO: intro + "¿Continuar donde dejaste?" (Mejoras PDF pág. 1-4) ----
   El JS marca la raíz con .is-intro mientras se muestra el intro o el prompt de
   reanudación. Ahí el test se pinta como una tarjeta teal oscura (matchea las
   capturas del PDF) con título amarillo y textos claros. En cualquier otro paso
   la clase se retira y vuelve el fondo claro para las preguntas. */
.m4t.is-intro,
.m4t.is-intro.is-immersive {
    background: linear-gradient(150deg, var(--m4-teal) 0%, #33595a 45%, var(--m4-dark) 100%) !important;
    color: #fff;
}
.m4t.is-intro .m4t__stage {
    color: #fff;
}
/* Título en amarillo (antes forzado a verde oscuro → ilegible sobre teal). */
.m4t.is-intro .m4t__intro h2,
.m4t.is-intro.is-immersive .m4t__intro h2 {
    color: var(--m4-yellow) !important;
}
/* Eyebrow "M4 Mediación · Diagnóstico" en blanco. */
.m4t.is-intro .m4t__intro-pre {
    color: #fff;
}
/* Párrafo descriptivo en blanco atenuado. */
.m4t.is-intro .m4t__intro p,
.m4t.is-intro.is-immersive .m4t__intro p {
    color: rgba(255, 255, 255, 0.82) !important;
}
/* Fila de métricas (5 · 26 · 5-8 min · 100%): divisores VERTICALES blancos con
   padding-right 2rem; números en amarillo; labels en blanco a 14px. */
.m4t.is-intro .m4t__intro-meta {
    border-top: none;
    border-bottom: none;
    gap: 2rem;
    color: #fff;
}
.m4t.is-intro .m4t__intro-meta-item {
    padding-right: 2rem;
    border-right: 1px solid rgba(255, 255, 255, 0.32);
}
.m4t.is-intro .m4t__intro-meta-item:last-child {
    padding-right: 0;
    border-right: none;
}
.m4t.is-intro .m4t__intro-meta-item strong {
    color: var(--m4-yellow);
}
.m4t.is-intro .m4t__intro-meta-item span {
    color: #fff;
    font-size: 14px;
}
/* CTA primario del hero en amarillo sólido (matchea "Comenzar test" /
   "Continuar test" del PDF): resalta sobre el teal oscuro. */
.m4t.is-intro .m4t__btn--primary,
.m4t.is-intro a.m4t__btn--primary,
.m4t.is-intro button.m4t__btn--primary {
    background: var(--m4-yellow);
    background-color: var(--m4-yellow);
    color: var(--m4-dark);
    box-shadow: 0 8px 22px rgba(212, 198, 94, 0.35);
}
.m4t.is-intro .m4t__btn--primary:hover:not([disabled]),
.m4t.is-intro button.m4t__btn--primary:hover:not([disabled]) {
    background: var(--m4-yellow-strong);
    background-color: var(--m4-yellow-strong);
    color: var(--m4-dark);
}
.m4t.is-intro .m4t__btn--primary:focus,
.m4t.is-intro .m4t__btn--primary:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}
/* Hint "o presiona Enter" y el <kbd> legibles sobre el teal. */
.m4t.is-intro .m4t__hint {
    color: rgba(255, 255, 255, 0.7);
}
.m4t.is-intro .m4t__hint kbd {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

/* ---- Secondary button (overlay actions, e.g. "Empezar de nuevo" / "Volver") ----
   Mejoras PDF pág. 4: "el botón volver… le pondría texto amarillo y outline
   amarillo". Se muestra sobre el hero teal oscuro, donde el verde anterior
   quedaba invisible. Ahora: texto + borde amarillo, hover relleno amarillo. */
/* Doble clase (.m4t__btn.m4t__btn--secondary → especificidad 0-3-0) para GANARLE
   a la base `.m4t button.m4t__btn { border:none }` (0-2-1); si no, el outline
   amarillo no se pintaba en el botón real "Empezar de nuevo". */
.m4t .m4t__btn.m4t__btn--secondary {
    background: transparent;
    color: var(--m4-yellow);
    border: 1.5px solid var(--m4-yellow);
    padding: 12px 22px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    font-family: inherit;
    line-height: 1.2;
}
.m4t .m4t__btn.m4t__btn--secondary:hover,
.m4t .m4t__btn.m4t__btn--secondary:focus {
    background: var(--m4-yellow);
    color: var(--m4-dark);
    outline: none;
}

/* ---- Top bar (only in immersive) ----
   Mejoras PDF pág. 6: barra superior teal oscura con el título del test en
   AMARILLO ("TEST: Diagnóstico — ¿Cómo se comunica tu organización?"). */
.m4t__topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 6;
    background: var(--m4-dark);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.m4t.is-immersive .m4t__topbar {
    opacity: 1;
    pointer-events: auto;
}
.m4t__brand {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    color: var(--m4-yellow);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    overflow: hidden;
}
.m4t__brand-dot {
    align-self: center;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--m4-yellow);
    box-shadow: 0 0 0 3px rgba(212, 198, 94, 0.25);
    flex-shrink: 0;
}
.m4t__brand-title {
    color: var(--m4-yellow);
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}
/* Subtítulo con el nombre del diagnóstico; se oculta en pantallas chicas. */
.m4t__brand-sub {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    letter-spacing: 0.6px;
    text-transform: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.m4t .m4t__close,
.m4t button.m4t__close {
    background: transparent;
    background-image: none;
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: rgba(255, 255, 255, 0.85);
    padding: 8px 14px;
    margin: 0;
    min-height: 0;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    text-shadow: none;
    text-transform: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.m4t .m4t__close:hover,
.m4t button.m4t__close:hover {
    background: #fff;
    background-color: #fff;
    color: var(--m4-dark);
    border-color: var(--m4-medium);
}

/* ---- Progress bar ----
   Mejoras PDF pág. 6: barra de progreso VISIBLE ("ayuda a la ansiedad por
   terminar"). En modo inmersivo se ancla justo debajo de la topbar teal
   (top:56px) para que no quede tapada por ella, con más grosor y contraste. */
.m4t__progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(13, 51, 48, 0.06);
    z-index: 4;
}
.m4t.is-immersive .m4t__progress {
    top: 56px;
    height: 5px;
    background: rgba(13, 51, 48, 0.10);
    box-shadow: 0 1px 4px rgba(13, 51, 48, 0.08);
}
.m4t__progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--m4-yellow) 0%, var(--m4-sage) 60%, var(--m4-medium) 100%);
    transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.m4t__progress-label {
    position: absolute;
    right: 24px;
    top: 14px;
    font-size: 12px;
    color: var(--m4-muted);
    font-variant-numeric: tabular-nums;
    z-index: 5;
    letter-spacing: 0.5px;
    pointer-events: none;
}
.m4t.is-immersive .m4t__progress-label {
    top: 72px;
    right: 32px;
    font-weight: 600;
    color: var(--m4-medium);
}

/* ---- Stage ---- */
.m4t__stage {
    position: relative;
    padding: 80px 64px 64px;
    min-height: 560px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}
.m4t.is-immersive .m4t__stage {
    padding: 100px 24px 60px;
    min-height: 100vh;
    max-width: 880px;
    margin: 0 auto;
}
/* Result step needs scroll: content can be much taller than viewport.
   Constrain the stage to exactly 100vh (instead of just min-height) so that
   overflow-y can actually trigger the inner scrollbar. We also drop the
   880px max-width here so the scrollbar lives at the viewport edge instead
   of floating in the middle gutter; the inner step constrains its own width. */
.m4t.is-immersive .m4t__stage.is-scrollable {
    justify-content: flex-start;
    min-height: 0;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    max-width: none;
    padding-left: 24px;
    padding-right: 24px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--m4-medium) transparent;
}
.m4t.is-immersive .m4t__stage.is-scrollable::-webkit-scrollbar {
    width: 10px;
}
.m4t.is-immersive .m4t__stage.is-scrollable::-webkit-scrollbar-track {
    background: transparent;
}
.m4t.is-immersive .m4t__stage.is-scrollable::-webkit-scrollbar-thumb {
    background: rgba(45, 79, 77, 0.35);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}
.m4t.is-immersive .m4t__stage.is-scrollable::-webkit-scrollbar-thumb:hover {
    background: rgba(45, 79, 77, 0.6);
    background-clip: padding-box;
    border: 2px solid transparent;
}
/* When the result step renders, the stage becomes scrollable and centers the result block horizontally. */
.m4t__stage.is-scrollable .m4t__step {
    width: 100%;
    max-width: 880px;
    margin: 0 auto;
    padding-bottom: 64px;
}

/* ---- Step card (slide animations) ---- */
.m4t__step {
    will-change: transform, opacity;
}
.m4t__step.is-entering {
    animation: m4t-step-enter 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.m4t__step.is-leaving {
    animation: m4t-step-leave 0.28s cubic-bezier(0.4, 0, 0.2, 1) both;
    pointer-events: none;
}
.m4t__step.is-entering-back {
    animation: m4t-step-enter-back 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.m4t__step.is-leaving-back {
    animation: m4t-step-leave-back 0.28s cubic-bezier(0.4, 0, 0.2, 1) both;
    pointer-events: none;
}

@keyframes m4t-step-enter {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes m4t-step-leave {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-28px); }
}
@keyframes m4t-step-enter-back {
    from { opacity: 0; transform: translateY(-28px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes m4t-step-leave-back {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(28px); }
}

/* ---- Intro / hero ---- */
.m4t__intro {
    text-align: left;
    max-width: 720px;
}
.m4t__intro-pre {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--m4-medium);
    font-weight: 600;
    margin: 0 0 20px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.m4t__intro-pre::before {
    content: '';
    width: 28px;
    height: 2px;
    background: var(--m4-yellow);
    display: inline-block;
}
.m4t .m4t__intro h2,
.m4t.is-immersive .m4t__intro h2 {
    margin: 0 0 18px !important;
    color: #0d3330 !important;
    font-size: clamp(28px, 4vw, 44px) !important;
    line-height: 1.1 !important;
    font-weight: 700 !important;
    letter-spacing: -1px !important;
    opacity: 1 !important;
    background: transparent !important;
}
.m4t .m4t__intro p,
.m4t.is-immersive .m4t__intro p {
    margin: 0 0 28px !important;
    color: var(--m4-muted) !important;
    font-size: clamp(16px, 1.4vw, 18px) !important;
    line-height: 1.65 !important;
    max-width: 620px;
    opacity: 1 !important;
}
.m4t__intro-meta {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    margin: 0 0 36px;
    padding: 18px 0;
    border-top: 1px solid var(--m4-border);
    border-bottom: 1px solid var(--m4-border);
    color: var(--m4-muted);
    font-size: 14px;
}
.m4t__intro-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.m4t__intro-meta-item strong {
    color: var(--m4-dark);
    font-size: 18px;
    font-weight: 700;
}
.m4t__intro-meta-item span {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---- Question label / meta ---- */
.m4t__qmeta {
    color: var(--m4-medium);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.m4t__qmeta-num {
    background: var(--m4-dark);
    color: #fff;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
}
/* Píldora de sección: "BLOQUE 1", "BLOQUE 2"… (o "PERFIL" en el perfil).
   Mejoras PDF pág. 6: dar contexto de bloque además del "Pregunta X de Y". */
.m4t__qmeta-badge {
    background: rgba(212, 198, 94, 0.22);
    color: #6f6414;
    border: 1px solid rgba(212, 198, 94, 0.5);
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
}
.m4t__qmeta-block {
    color: var(--m4-medium);
    font-weight: 600;
}
.m4t__qmeta-tag {
    /* Dark text on the soft yellow background — WCAG AA at 4.5:1 minimum.
       The previous yellow-on-white pairing fell to ~2.5:1. */
    color: var(--m4-dark);
    font-weight: 700;
    background: rgba(212, 198, 94, 0.28);
    padding: 3px 8px;
    border-radius: 4px;
}

.m4t .m4t__qtext,
.m4t.is-immersive .m4t__qtext {
    margin: 0 0 32px !important;
    color: #0d3330 !important;
    font-size: clamp(22px, 2.2vw, 30px) !important;
    line-height: 1.3 !important;
    font-weight: 700 !important;
    letter-spacing: -0.5px !important;
    max-width: 800px;
    opacity: 1 !important;
    text-shadow: none !important;
    background: transparent !important;
}

/* ---- Likert scale ---- */
.m4t__likert {
    display: grid;
    gap: 12px;
    max-width: 680px;
    margin-bottom: 12px;
}
.m4t__likert-option {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 22px;
    border: 2px solid var(--m4-border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.06s ease, color 0.18s ease;
    background: #fff;
    font-size: 16px;
    text-align: left;
    user-select: none;
}
.m4t__likert-option:hover {
    border-color: var(--m4-medium);
    background: var(--m4-bg-deep);
    transform: translateX(2px);
}
.m4t__likert-option.is-selected {
    border-color: var(--m4-dark);
    background: var(--m4-dark);
    color: #fff;
}
.m4t__likert-option.is-selected .m4t__likert-key {
    background: var(--m4-yellow);
    color: var(--m4-dark);
}
.m4t__likert-option:active {
    transform: scale(0.99);
}
.m4t__likert-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--m4-bg-soft);
    color: var(--m4-medium);
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    transition: background 0.18s ease, color 0.18s ease;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.06);
}
.m4t__likert-label {
    flex: 1;
    line-height: 1.4;
}
.m4t__likert-hint {
    margin-top: 10px;
    font-size: 12px;
    color: var(--m4-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.m4t__likert-hint kbd {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    background: var(--m4-bg-soft);
    border: 1px solid var(--m4-border);
    color: var(--m4-medium);
    font-size: 11px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
}

/* ---- Choice ---- */
.m4t__choice {
    display: grid;
    gap: 12px;
    max-width: 680px;
}
.m4t__choice-option {
    padding: 18px 22px;
    border: 2px solid var(--m4-border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.06s ease;
    background: #fff;
    font-size: 16px;
    line-height: 1.4;
    user-select: none;
}
.m4t__choice-option:hover {
    border-color: var(--m4-medium);
    background: var(--m4-bg-deep);
    transform: translateX(2px);
}
.m4t__choice-option.is-selected {
    border-color: var(--m4-dark);
    background: var(--m4-dark);
    color: #fff;
}

.m4t__yesno {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    max-width: 680px;
}
.m4t__yesno .m4t__choice-option {
    text-align: left;
    padding: 22px 24px;
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 16px;
}
.m4t__yesno .m4t__choice-option::before {
    content: '';
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--m4-bg-soft);
    border: 2px solid var(--m4-border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    color: var(--m4-medium);
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.m4t__yesno .m4t__choice-option:first-child::before { content: '✓'; }
.m4t__yesno .m4t__choice-option:last-child::before  { content: '✕'; }
.m4t__yesno .m4t__choice-option.is-selected::before {
    background: var(--m4-yellow);
    border-color: var(--m4-yellow);
    color: var(--m4-dark);
}

/* ---- Inputs ---- */
.m4t__input,
.m4t__textarea {
    width: 100%;
    max-width: 600px;
    padding: 16px 0;
    border: none;
    border-bottom: 2px solid var(--m4-border);
    font-size: clamp(20px, 2vw, 26px);
    font-weight: 500;
    font-family: inherit;
    color: var(--m4-dark);
    background: transparent;
    transition: border-color 0.18s ease;
    border-radius: 0;
}
.m4t__input:focus,
.m4t__textarea:focus {
    outline: none;
    border-bottom-color: var(--m4-dark);
}
.m4t__textarea {
    resize: none;
    line-height: 1.5;
    border-bottom-width: 2px;
}
.m4t__field-help {
    margin: 12px 0 0;
    color: var(--m4-muted);
    font-size: 13px;
}

/* ---- Actions ---- */
.m4t__actions {
    margin-top: 36px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
/* Theme reset: many WP themes apply heavy styles to button/anchor elements
   (gradients, text-shadow, uppercase, min-height, purple colors). We bump
   specificity with `.m4t .m4t__btn` and clear inherited theme effects, so
   the plugin's brand styling wins regardless of the parent theme. */
.m4t .m4t__btn,
.m4t a.m4t__btn,
.m4t button.m4t__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 32px;
    border-radius: 8px;
    border: none;
    margin: 0;
    min-height: 0;
    height: auto;
    width: auto;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.2;
    letter-spacing: 0.2px;
    text-transform: none;
    text-decoration: none;
    text-shadow: none;
    background-image: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.06s ease, opacity 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
}
.m4t .m4t__btn:focus,
.m4t .m4t__btn:focus-visible {
    outline: 2px solid var(--m4-yellow);
    outline-offset: 3px;
}
.m4t .m4t__btn:active {
    transform: scale(0.97);
}
.m4t .m4t__btn[disabled],
.m4t .m4t__btn[aria-disabled="true"] {
    opacity: 0.45;
    cursor: not-allowed;
}
.m4t .m4t__btn--primary,
.m4t a.m4t__btn--primary,
.m4t button.m4t__btn--primary {
    background: var(--m4-dark);
    background-color: var(--m4-dark);
    color: #fff;
    box-shadow: 0 4px 14px rgba(13, 51, 48, 0.25);
}
.m4t .m4t__btn--primary:hover:not([disabled]),
.m4t a.m4t__btn--primary:hover:not([disabled]),
.m4t button.m4t__btn--primary:hover:not([disabled]) {
    background: var(--m4-medium);
    background-color: var(--m4-medium);
    color: #fff;
    box-shadow: 0 6px 20px rgba(13, 51, 48, 0.32);
}
.m4t .m4t__btn--primary:visited,
.m4t a.m4t__btn--primary:visited {
    color: #fff;
}
/* CTA del FLUJO del test (intro "Comenzar", "Siguiente", "Ver mis resultados")
   en amarillo sólido, coherente con las capturas del PDF (pág. 1-6). El botón
   principal del resultado y el de descarga PDF conservan su verde por contraste. */
.m4t .m4t__actions .m4t__btn--primary,
.m4t .m4t__actions button.m4t__btn--primary {
    background: var(--m4-yellow);
    background-color: var(--m4-yellow);
    color: var(--m4-dark);
    box-shadow: 0 4px 14px rgba(212, 198, 94, 0.30);
}
.m4t .m4t__actions .m4t__btn--primary:hover:not([disabled]),
.m4t .m4t__actions button.m4t__btn--primary:hover:not([disabled]) {
    background: var(--m4-yellow-strong);
    background-color: var(--m4-yellow-strong);
    color: var(--m4-dark);
    box-shadow: 0 6px 20px rgba(212, 198, 94, 0.38);
}
.m4t .m4t__actions .m4t__btn--primary:focus,
.m4t .m4t__actions .m4t__btn--primary:focus-visible {
    outline: 2px solid var(--m4-dark);
    outline-offset: 3px;
}
.m4t .m4t__btn--ghost {
    background: transparent;
    background-color: transparent;
    color: var(--m4-medium);
}
.m4t .m4t__btn--ghost:hover:not([disabled]) {
    color: var(--m4-dark);
    background: var(--m4-bg-deep);
    background-color: var(--m4-bg-deep);
}
.m4t .m4t__btn--big {
    padding: 18px 40px;
    font-size: 16px;
}
.m4t .m4t__btn-arrow {
    display: inline-block;
    transition: transform 0.18s ease;
}
.m4t .m4t__btn:hover:not([disabled]) .m4t__btn-arrow {
    transform: translateX(3px);
}

.m4t__hint {
    margin-left: auto;
    color: var(--m4-muted);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.m4t__hint kbd {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 3px;
    background: var(--m4-bg-soft);
    border: 1px solid var(--m4-border);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    color: var(--m4-medium);
}

.m4t__error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 18px;
    color: var(--m4-error);
    font-size: 14px;
    font-weight: 500;
    padding: 12px 16px;
    background: rgba(185, 74, 74, 0.08);
    border: 1px solid rgba(185, 74, 74, 0.22);
    border-radius: 8px;
    max-width: 600px;
}
.m4t__error::before {
    content: '!';
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--m4-error);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    margin-top: 2px;
}

/* ---- Sending screen ---- */
.m4t__sending {
    text-align: center;
    max-width: 520px;
    margin: 0 auto;
}
.m4t__sending h2 {
    margin: 0 0 12px;
    color: var(--m4-dark);
    font-size: 26px;
    letter-spacing: -0.4px;
}
.m4t__sending p {
    color: var(--m4-muted);
    margin: 0 0 28px;
    font-size: 15px;
    line-height: 1.55;
}

/* Dual-ring brand spinner: outer slow dark, inner faster yellow.
   Communicates ongoing work with M4 colors. */
.m4t__spinner {
    display: inline-block;
    position: relative;
    width: 72px;
    height: 72px;
    margin: 0 auto 32px;
}
.m4t__spinner::before,
.m4t__spinner::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid transparent;
    box-sizing: border-box;
}
.m4t__spinner::before {
    border-top-color: var(--m4-dark);
    border-right-color: var(--m4-dark);
    animation: m4t-spin 1.1s cubic-bezier(0.6, 0.1, 0.4, 0.9) infinite;
}
.m4t__spinner::after {
    inset: 12px;
    border-top-color: var(--m4-yellow);
    border-left-color: var(--m4-yellow);
    animation: m4t-spin 0.85s cubic-bezier(0.6, 0.1, 0.4, 0.9) infinite reverse;
}
@keyframes m4t-spin {
    to { transform: rotate(360deg); }
}

/* Sending step list — visually walks the user through the wait. */
.m4t__sending-steps {
    list-style: none;
    margin: 28px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}
.m4t__sending-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(13, 51, 48, 0.04);
    border-radius: 8px;
    color: var(--m4-muted);
    font-size: 14px;
    transition: background 0.3s ease, color 0.3s ease;
}
.m4t__sending-step::before {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--m4-border);
    flex-shrink: 0;
    transition: background 0.3s ease, border-color 0.3s ease;
}
.m4t__sending-step.is-active {
    background: rgba(212, 198, 94, 0.12);
    color: var(--m4-dark);
    font-weight: 600;
}
.m4t__sending-step.is-active::before {
    background: var(--m4-yellow);
    border-color: var(--m4-yellow);
    box-shadow: 0 0 0 4px rgba(212, 198, 94, 0.18);
}
.m4t__sending-step.is-done {
    color: var(--m4-medium);
}
.m4t__sending-step.is-done::before {
    background: var(--m4-medium);
    border-color: var(--m4-medium);
    /* Inline checkmark via background-image to keep markup simple. */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='3 8.5 6.5 12 13 4.5'/></svg>");
    background-size: 12px 12px;
    background-position: center;
    background-repeat: no-repeat;
}

/* ---- Result screen ---- */
.m4t__result {
    max-width: 760px;
}
.m4t__result-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--m4-border);
}
.m4t__result-pre {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--m4-medium);
    font-weight: 600;
    margin: 0 0 12px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.m4t__result-pre::before {
    content: '';
    width: 28px;
    height: 2px;
    background: var(--m4-yellow);
}
.m4t__result-header h2 {
    margin: 0 0 10px;
    color: var(--m4-dark);
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.2;
    letter-spacing: -0.5px;
}
.m4t__result-header p {
    margin: 0;
    color: var(--m4-muted);
    font-size: 15px;
    line-height: 1.6;
}

/* ---- Result hero: global score with animated SVG ring ---- */
.m4t__result-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 36px;
    align-items: center;
    padding: 36px 40px;
    margin: 0 0 32px;
    background: linear-gradient(135deg, var(--m4-dark) 0%, var(--m4-medium) 100%);
    color: #fff;
    border-radius: 18px;
    box-shadow: 0 18px 48px rgba(13, 51, 48, 0.22);
    position: relative;
    overflow: hidden;
}
.m4t__result-hero::before {
    /* Decorative diagonal grid pattern, very subtle */
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(135deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(45deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    pointer-events: none;
    opacity: 0.6;
}
.m4t__result-hero::after {
    /* Yellow halo glow, top-right */
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(212, 198, 94, 0.22) 0%, transparent 65%);
    pointer-events: none;
}
.m4t__score-ring {
    position: relative;
    width: 184px;
    height: 184px;
    flex-shrink: 0;
    z-index: 1;
}
.m4t__score-ring svg {
    width: 100%;
    height: 100%;
    display: block;
    transform: rotate(-90deg);
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.18));
}
.m4t__ring-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.14);
    stroke-width: 9;
}
.m4t__ring-fill {
    fill: none;
    stroke: var(--m4-yellow);
    stroke-width: 9;
    stroke-linecap: round;
    /* dasharray = 2*pi*52 ≈ 326.73 */
    stroke-dasharray: 326.73;
    stroke-dashoffset: 326.73;
    transition: stroke-dashoffset 1.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.m4t__ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.m4t__ring-num {
    font-size: 54px;
    font-weight: 800;
    letter-spacing: -2px;
    color: #fff;
    font-variant-numeric: tabular-nums;
}
.m4t__ring-out-of {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 600;
    letter-spacing: 2px;
    margin-top: 6px;
    text-transform: uppercase;
}
.m4t__hero-meta {
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}
.m4t__hero-level {
    display: inline-block;
    background: rgba(212, 198, 94, 0.22);
    color: var(--m4-yellow);
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0 0 14px;
    border: 1px solid rgba(212, 198, 94, 0.4);
}
.m4t__hero-meta h2 {
    margin: 0 0 10px;
    font-size: clamp(22px, 2.6vw, 32px);
    line-height: 1.15;
    color: #fff;
    font-weight: 700;
    letter-spacing: -0.6px;
}
.m4t__hero-meta p {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    line-height: 1.55;
    max-width: 380px;
}

/* ---- Block cards ----
   Designed to avoid the "AI-stripe" cliché (a thin colored bar on the left
   edge of every card). Level signaling lives inside the layout: the colored
   pill + score number + mini-bar in the score column already encode the level.
   Cards stay clean white; on hover, a level-tinted shadow rises from below.
*/
.m4t__block-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 28px;
    align-items: center;
    margin-bottom: 16px;
    padding: 26px 30px 26px 30px;
    background: #fff;
    border: 1px solid var(--m4-border);
    border-radius: 14px;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s ease, border-color 0.22s ease;
    position: relative;
}
.m4t__block-card:hover {
    transform: translateY(-2px);
    border-color: rgba(13, 51, 48, 0.16);
}
.m4t__block-card[data-level="low"]:hover    { box-shadow: 0 14px 36px rgba(185, 74, 74, 0.16); }
.m4t__block-card[data-level="medium"]:hover { box-shadow: 0 14px 36px rgba(212, 198, 94, 0.22); }
.m4t__block-card[data-level="high"]:hover   { box-shadow: 0 14px 36px rgba(45, 79, 77, 0.18); }
.m4t__block-card-body {
    min-width: 0;
}

.m4t__block-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--m4-muted);
    flex-wrap: wrap;
    font-weight: 600;
}
.m4t__block-card h3 {
    margin: 0 0 8px;
    color: var(--m4-dark);
    font-size: 21px;
    letter-spacing: -0.3px;
    line-height: 1.25;
}
.m4t__block-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--m4-medium);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.m4t__block-card[data-level="low"]    .m4t__block-pill { background: var(--m4-error); }
.m4t__block-card[data-level="medium"] .m4t__block-pill { background: var(--m4-yellow); color: var(--m4-dark); }
.m4t__block-card[data-level="high"]   .m4t__block-pill { background: var(--m4-medium); }
.m4t__block-card p {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--m4-text);
}

/* Score column — large number + animated horizontal mini bar */
.m4t__block-card-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex-shrink: 0;
    min-width: 96px;
}
.m4t__block-card-num {
    font-size: 44px;
    font-weight: 800;
    color: var(--m4-dark);
    line-height: 1;
    letter-spacing: -1.5px;
    font-variant-numeric: tabular-nums;
}
.m4t__block-card[data-level="low"]    .m4t__block-card-num { color: var(--m4-error); }
.m4t__block-card[data-level="medium"] .m4t__block-card-num { color: #b59710; }
.m4t__block-card[data-level="high"]   .m4t__block-card-num { color: var(--m4-medium); }
.m4t__block-card-bar {
    display: block;
    width: 88px;
    height: 6px;
    background: var(--m4-bg-soft);
    border-radius: 999px;
    margin: 12px 0 6px;
    overflow: hidden;
    position: relative;
}
.m4t__block-card-bar-fill {
    display: block;
    height: 100%;
    background: var(--m4-medium);
    border-radius: 999px;
    width: 0;
    transition: width 1.1s cubic-bezier(0.4, 0, 0.2, 1);
}
.m4t__block-card[data-level="low"]    .m4t__block-card-bar-fill { background: var(--m4-error); }
.m4t__block-card[data-level="medium"] .m4t__block-card-bar-fill { background: var(--m4-yellow); }
.m4t__block-card[data-level="high"]   .m4t__block-card-bar-fill { background: var(--m4-medium); }
.m4t__block-card-out {
    font-size: 10px;
    letter-spacing: 1.5px;
    color: var(--m4-muted);
    font-weight: 700;
    text-transform: uppercase;
}
.m4t__tloss {
    margin-top: 28px;
    padding: 22px 26px;
    background: var(--m4-bg-deep);
    border-radius: 8px;
}
.m4t__tloss h4 {
    margin: 0 0 8px;
    color: var(--m4-dark);
    font-size: 16px;
}
.m4t__tloss p {
    margin: 0;
    line-height: 1.6;
    color: var(--m4-text);
}

/* Closing recommendation: soft yellow callout. No left strip — the tinted
   background + a short top accent rule is editorial, not AI cliché. */
.m4t__closing-text {
    position: relative;
    margin: 32px 0 24px;
    font-size: 16px;
    line-height: 1.7;
    color: var(--m4-text);
    padding: 28px 28px 24px;
    background: rgba(212, 198, 94, 0.10);
    border-radius: 12px;
}
.m4t__closing-text::before {
    content: '';
    display: block;
    width: 36px;
    height: 2px;
    background: var(--m4-yellow);
    margin-bottom: 14px;
}

.m4t__cta {
    text-align: center;
    margin: 36px 0 12px;
}
.m4t__cta-help {
    margin: 14px 0 0;
    color: var(--m4-muted);
    font-size: 13px;
}

/* ---- Download PDF CTA (between header and block cards) ----
   Tinted gradient card with a subtle top-edge accent and full 1px border.
   The yellow signal lives in the gradient + the small uppercase tag, not
   on a left stripe. */
.m4t__pdf-cta {
    position: relative;
    margin: 0 0 32px;
    padding: 28px 28px 24px;
    background: linear-gradient(135deg, rgba(212, 198, 94, 0.18) 0%, rgba(212, 198, 94, 0.06) 100%);
    border: 1px solid rgba(212, 198, 94, 0.4);
    border-radius: 12px;
    text-align: left;
    overflow: hidden;
}
.m4t__pdf-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--m4-yellow) 0%, rgba(212, 198, 94, 0) 70%);
}
.m4t__pdf-cta .m4t__btn {
    background: var(--m4-dark);
    color: #fff;
    box-shadow: 0 4px 14px rgba(13, 51, 48, 0.18);
}
.m4t__pdf-cta .m4t__btn:hover {
    background: var(--m4-medium);
    box-shadow: 0 6px 20px rgba(13, 51, 48, 0.28);
}
.m4t__pdf-help {
    margin: 14px 0 0;
    font-size: 13px;
    color: var(--m4-medium);
    line-height: 1.55;
    max-width: 540px;
}

/* ---- Responsive ---- */
@media (max-width: 720px) {
    .m4t {
        margin: 12px;
        border-radius: 10px;
        min-height: 480px;
    }
    .m4t__stage {
        padding: 56px 22px 36px;
        min-height: 480px;
    }
    .m4t.is-immersive .m4t__stage {
        padding: 90px 18px 40px;
    }
    .m4t__qtext {
        font-size: 20px;
    }
    .m4t__intro h2 {
        font-size: 26px;
    }
    .m4t__intro-meta {
        gap: 16px;
    }
    /* Topbar: en móvil solo el título corto en amarillo; el subtítulo estorba. */
    .m4t__brand-sub {
        display: none;
    }
    /* Divisores del hero más compactos en móvil. */
    .m4t.is-intro .m4t__intro-meta {
        gap: 14px;
    }
    .m4t.is-intro .m4t__intro-meta-item {
        padding-right: 14px;
    }
    .m4t__yesno {
        flex-direction: column;
    }
    .m4t__likert-option,
    .m4t__choice-option {
        padding: 14px 18px;
        font-size: 15px;
    }
    .m4t__hint {
        display: none;
    }
    .m4t__result-hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 28px 22px;
        gap: 18px;
    }
    .m4t__score-ring {
        width: 148px;
        height: 148px;
        margin: 0 auto;
    }
    .m4t__ring-num { font-size: 44px; }
    .m4t__hero-meta { text-align: center; }
    .m4t__hero-meta p { margin-left: auto; margin-right: auto; }
    .m4t__block-card {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 22px 22px;
    }
    .m4t__block-card-score {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 14px;
        min-width: 0;
        padding-top: 14px;
        border-top: 1px solid var(--m4-border);
        width: 100%;
    }
    .m4t__block-card-bar {
        margin: 0;
        flex: 1;
        max-width: 200px;
    }
    .m4t__yesno {
        grid-template-columns: 1fr;
    }
}

/* Ultra-small screens (older / budget phones in portrait). */
@media (max-width: 380px) {
    .m4t {
        margin: 6px;
        border-radius: 8px;
    }
    .m4t__stage {
        padding: 48px 14px 28px;
    }
    .m4t.is-immersive .m4t__stage {
        padding: 78px 12px 28px;
    }
    .m4t__qtext {
        font-size: 18px;
    }
    .m4t__intro h2 {
        font-size: 22px;
    }
    .m4t__intro-meta {
        gap: 10px;
    }
    .m4t__intro-meta-item strong {
        font-size: 18px;
    }
    .m4t__likert-option,
    .m4t__choice-option {
        padding: 12px 14px;
        font-size: 14px;
    }
    .m4t__likert-key {
        width: 26px;
        height: 26px;
        font-size: 13px;
    }
    .m4t__btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    .m4t__btn--big {
        padding: 12px 20px;
        font-size: 15px;
    }
    /* Nota: NO poner padding vertical en .m4t__progress — con box-sizing:border-box
       colapsaría el riel (3-5px) a 0px de alto y el relleno de color desaparece. */
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    .m4t,
    .m4t__step,
    .m4t__progress-bar,
    .m4t__likert-option,
    .m4t__choice-option,
    .m4t__btn {
        animation: none !important;
        transition: none !important;
    }
}
