/* =========================================
   PROYECTO EVALUACIÓN NGM
   Interfaz principal
========================================= */

:root {
    --primary: #2867a8;
    --primary-dark: #1d4f82;
    --primary-light: #edf5fc;

    --green: #4c956c;
    --green-light: #edf7f1;

    --background: #f3f6f8;
    --surface: #ffffff;

    --text: #243746;
    --text-secondary: #657786;
    --border: #e3e9ed;

    --radius: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, Helvetica, Arial, sans-serif;

    background:
        linear-gradient(
            135deg,
            #f7fafc 0%,
            #edf4f8 100%
        );

    color: var(--text);

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 32px 20px;
}

/* =========================
   TARJETA PRINCIPAL
========================= */

.welcome-card {
    width: 100%;
    max-width: 680px;

    background: var(--surface);

    border: 1px solid rgba(227, 233, 237, 0.9);
    border-radius: var(--radius);

    box-shadow:
        0 20px 60px rgba(35, 55, 70, 0.08);

    overflow: hidden;
}

/* =========================
   ENCABEZADO
========================= */

.institution-header {
    display: flex;
    align-items: center;
    gap: 14px;

    padding: 22px 28px;

    border-bottom: 1px solid var(--border);
}

.logo-placeholder {
    width: 48px;
    height: 48px;

    border-radius: 14px;

    background: var(--primary);
    color: white;

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: 800;
    font-size: 0.9rem;

    letter-spacing: 0.5px;
}

.institution-name {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.institution-name span {
    font-size: 0.95rem;
    font-weight: 650;
    color: var(--text);
}

.institution-name small {
    font-size: 0.7rem;
    font-weight: 700;

    color: var(--text-secondary);

    letter-spacing: 1.2px;
}

/* =========================
   CONTENIDO
========================= */

.welcome-content {
    padding: 52px 52px 38px;
}

.survey-label {
    display: inline-block;

    margin-bottom: 16px;

    font-size: 0.72rem;
    font-weight: 750;

    letter-spacing: 1.5px;

    color: var(--primary);
}

h1 {
    max-width: 520px;

    margin-bottom: 18px;

    font-size: clamp(2rem, 5vw, 2.7rem);
    line-height: 1.08;

    letter-spacing: -1.2px;

    color: var(--text);
}

.welcome-description {
    max-width: 540px;

    margin-bottom: 32px;

    font-size: 1.02rem;
    line-height: 1.7;

    color: var(--text-secondary);
}

/* =========================
   INFORMACIÓN
========================= */

.survey-info {
    display: grid;
    grid-template-columns: 1fr 1fr;

    gap: 12px;

    margin-bottom: 32px;
}

.info-item {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 16px;

    background: #f8fafb;

    border: 1px solid var(--border);
    border-radius: 14px;
}

.info-icon {
    width: 36px;
    height: 36px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: var(--green-light);
    color: var(--green);

    font-weight: 800;
}

.info-item div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-item strong {
    font-size: 0.85rem;
}

.info-item small {
    font-size: 0.72rem;
    line-height: 1.3;

    color: var(--text-secondary);
}

/* =========================
   BOTÓN
========================= */

.primary-button {
    width: 100%;

    display: flex;
    justify-content: center;
    align-items: center;

    gap: 12px;

    border: none;
    border-radius: 13px;

    padding: 17px 24px;

    background: var(--primary);
    color: white;

    font-size: 1rem;
    font-weight: 650;

    cursor: pointer;

    box-shadow:
        0 8px 20px rgba(40, 103, 168, 0.18);

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

.primary-button:hover {
    background: var(--primary-dark);

    transform: translateY(-1px);

    box-shadow:
        0 12px 24px rgba(40, 103, 168, 0.24);
}

.primary-button:active {
    transform: translateY(0);
}

/* =========================
   PRIVACIDAD
========================= */

.privacy-text {
    margin-top: 20px;
    margin-bottom: 0;

    text-align: center;

    font-size: 0.74rem;
    line-height: 1.5;

    color: #8a99a5;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 600px) {

    body {
        padding: 16px;
        align-items: flex-start;
    }

    .welcome-card {
        margin-top: 12px;
        border-radius: 18px;
    }

    .institution-header {
        padding: 18px 20px;
    }

    .logo-placeholder {
        width: 42px;
        height: 42px;

        border-radius: 12px;
    }

    .institution-name span {
        font-size: 0.82rem;
    }

    .welcome-content {
        padding: 38px 24px 28px;
    }

    h1 {
        font-size: 2.05rem;
    }

    .welcome-description {
        font-size: 0.95rem;
    }

    .survey-info {
        grid-template-columns: 1fr;
    }

}
/* =========================================
   PANTALLA DE ENCUESTA
========================================= */

.hidden {
    display: none !important;
}

.survey-card {
    width: 100%;
    max-width: 760px;

    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow:
        0 20px 60px rgba(35, 55, 70, 0.08);

    overflow: hidden;
}

.survey-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 20px 28px;
}

.survey-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.survey-brand > div:last-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.survey-brand strong {
    font-size: 0.9rem;
}

.survey-brand small {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.question-counter {
    font-size: 0.78rem;
    font-weight: 650;
    color: var(--text-secondary);
}

.progress-container {
    height: 5px;
    background: #edf1f4;
}

.progress-bar {
    width: 33.33%;
    height: 100%;

    background: var(--green);

    transition: width 0.35s ease;
}

/* Pregunta */

.question-content {
    padding: 48px 52px 42px;
}

.question-meta {
    display: flex;
    flex-direction: column;
    gap: 7px;

    margin-bottom: 26px;
}

.question-meta span {
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 1.4px;

    color: var(--primary);
}

.question-meta small {
    font-size: 1.06rem;
    color: var(--green);
    font-weight: 650;
}

.question-title {
    max-width: 620px;

    margin-bottom: 12px;

    font-size: 1.65rem;
    line-height: 1.35;

    color: var(--text);
}

.question-help {
    margin-bottom: 28px;

    font-size: 0.88rem;
    color: var(--text-secondary);
}

/* Respuestas */

.answer-options {
    display: grid;
    grid-template-columns: repeat(5, 1fr);

    gap: 10px;

    margin-bottom: 38px;
}

.answer-button {
    min-height: 94px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 8px;

    padding: 12px 8px;

    background: white;
    color: var(--text);

    border: 1.5px solid var(--border);
    border-radius: 14px;

    box-shadow: none;

    font-size: 0.78rem;
    font-weight: 600;

    transition: all 0.18s ease;
}

.answer-button:hover {
    background: var(--primary-light);
    border-color: #9bbfe3;

    box-shadow: none;
    transform: translateY(-2px);
}

.answer-number {
    width: 30px;
    height: 30px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #f1f5f8;

    font-size: 0.8rem;
    font-weight: 750;
}

.answer-button.selected {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.answer-button.selected .answer-number {
    background: var(--primary);
    color: white;
}

/* Navegación */

.question-navigation {
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.secondary-button,
.next-button {
    width: auto;

    padding: 13px 20px;

    border-radius: 11px;

    box-shadow: none;

    font-size: 0.88rem;
}

.secondary-button {
    background: white;
    color: var(--text-secondary);

    border: 1px solid var(--border);
}

.secondary-button:hover {
    background: #f7f9fa;
    color: var(--text);

    transform: none;
    box-shadow: none;
}

.next-button {
    margin-left: auto;

    background: var(--primary);
    color: white;
}

.next-button:disabled {
    background: #cbd5dc;
    cursor: not-allowed;

    transform: none;
    box-shadow: none;
}

/* Celular */

@media (max-width: 600px) {

    .survey-card {
        border-radius: 18px;
    }

    .survey-header {
        padding: 16px 18px;
    }

    .question-content {
        padding: 34px 22px 26px;
    }

    .question-title {
        font-size: 1.4rem;
    }

    .answer-options {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .answer-button {
        min-height: 54px;

        flex-direction: row;
        justify-content: flex-start;

        padding: 10px 14px;

        font-size: 0.9rem;
    }

}
/* =========================================
   TRANSICIÓN ENTRE SECCIONES
========================================= */

.transition-card {
    width: 100%;
    max-width: 600px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow:
        0 20px 60px rgba(35, 55, 70, 0.08);

    overflow: hidden;
}

.transition-content {
    padding: 58px 52px 48px;
    text-align: center;
}

.success-icon {
    width: 64px;
    height: 64px;

    margin: 0 auto 22px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: var(--green-light);
    color: var(--green);

    font-size: 1.8rem;
    font-weight: 800;
}

.transition-label {
    display: block;

    margin-bottom: 10px;

    color: var(--green);

    font-size: 0.7rem;
    font-weight: 800;

    letter-spacing: 1.5px;
}

.transition-content h2 {
    margin-bottom: 14px;

    color: var(--text);

    font-size: 1.8rem;
}

.transition-content > p {
    max-width: 440px;

    margin: 0 auto 30px;

    color: var(--text-secondary);

    font-size: 0.95rem;
    line-height: 1.6;
}

.next-section-box {
    margin-bottom: 28px;
    padding: 20px;

    display: flex;
    flex-direction: column;

    gap: 5px;

    text-align: left;

    background: #f8fafb;

    border: 1px solid var(--border);
    border-radius: 14px;
}

.next-section-box small {
    color: var(--primary);

    font-size: 0.65rem;
    font-weight: 800;

    letter-spacing: 1.2px;
}

.next-section-box strong {
    color: var(--text);

    font-size: 1.05rem;
}

.next-section-box span {
    color: var(--text-secondary);

    font-size: 0.78rem;
}


/* CELULAR */

@media (max-width: 600px) {

    .transition-content {
        padding: 44px 24px 32px;
    }

    .transition-content h2 {
        font-size: 1.55rem;
    }

}
/* =========================================
   PANTALLA FINAL
========================================= */

.finish-card {
    width: 100%;
    max-width: 620px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    box-shadow:
        0 20px 60px rgba(35, 55, 70, 0.08);

    overflow: hidden;
}

.finish-content {
    padding: 58px 52px 42px;
    text-align: center;
}

.finish-icon {
    width: 72px;
    height: 72px;

    font-size: 2rem;
}

.finish-content h2 {
    margin-bottom: 16px;

    color: var(--text);

    font-size: 2rem;
}

.finish-message {
    max-width: 500px;

    margin: 0 auto 34px;

    color: var(--text-secondary);

    font-size: 0.95rem;
    line-height: 1.7;
}


/* Resumen */

.finish-summary {
    display: flex;
    align-items: center;
    justify-content: space-around;

    margin-bottom: 28px;
    padding: 22px 16px;

    background: #f8fafb;

    border: 1px solid var(--border);
    border-radius: 14px;
}

.summary-item {
    flex: 1;

    display: flex;
    flex-direction: column;

    gap: 5px;
}

.summary-item strong {
    color: var(--primary);

    font-size: 1.35rem;
}

.summary-item span {
    color: var(--text-secondary);

    font-size: 0.72rem;
}

.summary-divider {
    width: 1px;
    height: 36px;

    background: var(--border);
}


/* Confirmación */

.privacy-confirmation {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 9px;

    padding: 14px 18px;

    background: var(--green-light);

    border-radius: 12px;
}

.privacy-confirmation > span {
    color: var(--green);
    font-weight: 800;
}

.privacy-confirmation p {
    margin: 0;

    color: #49745c;

    font-size: 0.8rem;
}

.finish-footer {
    margin: 22px 0 0;

    color: #9aa7b1;

    font-size: 0.72rem;
}


/* CELULAR */

@media (max-width: 600px) {

    .finish-content {
        padding: 44px 24px 30px;
    }

    .finish-content h2 {
        font-size: 1.65rem;
    }

    .finish-summary {
        padding: 18px 8px;
    }

    .summary-item strong {
        font-size: 1.15rem;
    }
    .section-progress {
    padding: 0 18px 9px;
    }

}
.section-progress {
    padding: 0 28px 10px;

    color: var(--text-secondary);

    font-size: 0.68rem;
    font-weight: 600;

    text-align: right;
}

/* ==========================================================
   IDENTIDAD NGM
   ========================================================== */

/* Mantiene todas las pantallas centradas */
.survey-card,
.transition-card,
.infrastructure-card,
.finish-card {
    margin-left: auto;
    margin-right: auto;
}

/* ---------- Portada integrada ---------- */

.welcome-shell {
    width: 100%;
    max-width: 760px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.welcome-shell .welcome-card {
    position: relative;
    isolation: isolate;
    width: 100%;
    max-width: none;
    min-height: min(900px, calc(100vh - 92px));
    overflow: hidden;
    background: #eef5f9;
}

.welcome-background {
    position: absolute;
    inset: 0;
    z-index: -2;
    background: url("../img/colegio-grijalva.jpeg") center bottom / cover no-repeat;
    transform: scale(1.015);
}

.welcome-overlay {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(
        180deg,
        rgba(248,252,255,.98) 0%,
        rgba(248,252,255,.95) 23%,
        rgba(248,252,255,.89) 47%,
        rgba(248,252,255,.62) 69%,
        rgba(248,252,255,.20) 100%
    );
}

.welcome-layout {
    min-height: inherit;
    display: flex;
    flex-direction: column;
    padding: 28px 38px 34px;
}

.welcome-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.welcome-logo {
    display: block;
    width: min(440px, 78%);
    height: auto;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.welcome-shell .welcome-content {
    padding: 8px 0 0;
    text-align: center;
}

.welcome-shell .survey-label {
    margin-bottom: 10px;
}

.welcome-shell h1 {
    max-width: none;
    margin: 0 auto 12px;
    color: #17334e;
    font-size: clamp(2.5rem, 7vw, 4.15rem);
    line-height: .98;
    letter-spacing: -2px;
}

.welcome-tagline {
    margin: 0 0 12px;
    color: #17334e;
    font-size: clamp(1.25rem, 3.5vw, 1.75rem);
    line-height: 1.2;
}

.welcome-shell .welcome-description {
    max-width: 590px;
    margin: 0 auto;
    color: #36516a;
    font-size: 1rem;
    line-height: 1.5;
}

.welcome-shell .survey-info {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    width: min(360px, 100%);
    margin: 28px auto 24px;
}

.welcome-shell .info-item {
    min-height: 108px;
    padding: 17px 14px;
    justify-content: center;
    background: rgba(255,255,255,.84);
    border: 1px solid rgba(213,226,235,.95);
    border-radius: 16px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.welcome-shell .info-icon {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--green-light);
    color: var(--green);
}

.welcome-shell .info-icon svg {
    display: block;
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    shape-rendering: geometricPrecision;
}

.welcome-shell .info-item strong {
    font-size: .9rem;
}

.welcome-shell .info-item small {
    font-size: .72rem;
    line-height: 1.35;
}

.welcome-start {
    width: min(560px, 100%);
    margin: 0 auto;
    box-shadow: 0 12px 30px rgba(29,79,130,.20);
}

.welcome-shell .privacy-text {
    max-width: 620px;
    margin: 18px auto 0;
    color: rgba(48,72,92,.74);
    text-shadow: 0 1px 5px rgba(255,255,255,.8);
}

.web-credit {
    padding: 12px 8px 0;
    text-align: center;
    color: #a6b1ba;
    font-size: .64rem;
    font-weight: 500;
    letter-spacing: .2px;
    user-select: none;
}


/* ---------- Encabezado de encuesta ---------- */

/*
   Valores deliberadamente grandes:
   el logo debe tener presencia similar al título de la pregunta.
*/
.survey-header {
    min-height: 168px;
    padding: 30px 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.survey-brand {
    display: flex;
    align-items: center;
    gap: 34px;
    min-width: 0;
}

.survey-logo {
    display: block;
    width: 330px;
    max-width: 48vw;
    height: 108px;
    flex: 0 0 auto;
    object-fit: contain;
    object-position: left center;
}

.survey-brand > div {
    display: flex;
    align-items: center;
}

.survey-brand strong {
    color: var(--text);
    font-size: 1.48rem;
    line-height: 1.15;
    font-weight: 750;
    white-space: nowrap;
}

.survey-brand small {
    display: none;
}

.question-counter {
    flex: 0 0 auto;
    color: var(--text-secondary);
    font-size: 1.14rem;
    font-weight: 750;
}

.section-progress {
    padding: 0 42px 18px;
    text-align: right;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 750;
}


/* ---------- Infraestructura ---------- */

.infrastructure-card {
    width: 100%;
    max-width: 760px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(35,55,70,.08);
    overflow: hidden;
}

.infrastructure-progress {
    width: 100%;
}

.infrastructure-content {
    padding: 44px 52px 38px;
}

.infrastructure-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 26px 0 14px;
}

.infrastructure-option {
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 16px;
    text-align: left;
    background: #fff;
    color: var(--text);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    font: inherit;
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.35;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease,
                transform .18s ease, opacity .18s ease;
}

.infrastructure-option:hover:not(:disabled) {
    background: var(--primary-light);
    border-color: #9bbfe3;
    transform: translateY(-1px);
}

.option-check {
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f1f5f8;
    color: transparent;
    font-size: .78rem;
    font-weight: 800;
}

.infrastructure-option.selected {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.infrastructure-option.selected .option-check {
    background: var(--primary);
    color: #fff;
}

.infrastructure-option.none-option.selected {
    background: var(--green-light);
    border-color: var(--green);
    color: #356c4d;
}

.infrastructure-option.none-option.selected .option-check {
    background: var(--green);
}

.infrastructure-option:disabled:not(.selected) {
    opacity: .42;
    cursor: not-allowed;
}

.selection-status {
    min-height: 24px;
    margin-bottom: 28px;
    color: var(--text-secondary);
    font-size: .78rem;
}

.infrastructure-navigation {
    margin-top: 8px;
}


/* ---------- Responsive ---------- */

@media (max-width: 600px) {
    body {
        padding: 14px 12px 18px;
    }

    .welcome-shell .welcome-card {
        min-height: calc(100vh - 60px);
        border-radius: 18px;
    }

    .welcome-layout {
        padding: 22px 18px 26px;
    }

    .welcome-logo {
        width: min(360px, 92%);
    }

    .welcome-shell h1 {
        margin-bottom: 10px;
        font-size: clamp(2.25rem, 12vw, 3.25rem);
    }

    .welcome-tagline {
        font-size: 1.18rem;
    }

    .welcome-shell .welcome-description {
        font-size: .9rem;
        line-height: 1.45;
    }

    .welcome-shell .survey-info {
        grid-template-columns: 1fr;
        gap: 8px;
        margin: 22px 0 18px;
    }

    .welcome-shell .info-item {
        min-height: 70px;
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr);
        align-items: center;
        justify-content: initial;
        column-gap: 12px;
        padding: 12px 14px;
    }

    .welcome-shell .info-item > div {
        min-width: 0;
        width: 100%;
        text-align: left;
        align-items: flex-start;
    }

    .welcome-shell .privacy-text {
        margin-top: 14px;
        font-size: .7rem;
    }

    .web-credit {
        padding-top: 9px;
        font-size: .6rem;
    }

    .survey-header {
        min-height: 112px;
        padding: 18px 18px;
        gap: 10px;
    }

    .survey-brand {
        gap: 12px;
    }

    .survey-logo {
        width: 178px;
        max-width: 48vw;
        height: 66px;
    }

    .survey-brand strong {
        font-size: .94rem;
        white-space: normal;
    }

    .question-counter {
        font-size: .82rem;
    }

    .section-progress {
        padding: 0 18px 12px;
        font-size: .8rem;
    }

    .infrastructure-card {
        border-radius: 18px;
    }

    .infrastructure-content {
        padding: 34px 22px 26px;
    }

    .infrastructure-options {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .infrastructure-option {
        min-height: 58px;
        padding: 12px 14px;
        font-size: .86rem;
    }

    .infrastructure-navigation {
        flex-direction: column-reverse;
    }

    .infrastructure-navigation .secondary-button,
    .infrastructure-navigation .next-button {
        width: 100%;
        margin-left: 0;
    }
}


/* ==========================================================
   ENCABEZADO DE ENCUESTA — 3 FILAS
   ========================================================== */
.survey-header.survey-header-stacked {
    min-height: 0;
    padding: 30px 42px 20px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
}

.survey-header-stacked .survey-logo-row {
    display: flex;
    justify-content: center;
    align-items: center;
}

.survey-header-stacked .survey-logo {
    display: block;
    width: 380px;
    max-width: 82%;
    height: 118px;
    object-fit: contain;
    object-position: center;
}

.survey-header-stacked .survey-title-row {
    margin-top: 7px;
    text-align: center;
}

.survey-header-stacked .survey-title-row strong {
    color: var(--text);
    font-size: 1.58rem;
    line-height: 1.2;
    font-weight: 750;
}

.survey-header-stacked .survey-meta-row {
    width: 100%;
    margin-top: 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.survey-header-stacked .question-counter,
.survey-header-stacked .section-progress {
    position: static;
    transform: none;
    padding: 0;
    margin: 0;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.2;
    font-weight: 750;
    white-space: nowrap;
}

.survey-header-stacked .section-progress {
    text-align: right;
}

@media (max-width: 600px) {
    .survey-header.survey-header-stacked {
        padding: 20px 18px 15px;
    }

    .survey-header-stacked .survey-logo {
        width: 270px;
        max-width: 88%;
        height: 86px;
    }

    .survey-header-stacked .survey-title-row {
        margin-top: 4px;
    }

    .survey-header-stacked .survey-title-row strong {
        font-size: 1.18rem;
    }

    .survey-header-stacked .survey-meta-row {
        margin-top: 20px;
        gap: 12px;
    }

    .survey-header-stacked .question-counter,
    .survey-header-stacked .section-progress {
        font-size: .82rem;
    }
}


/* ==========================================================
   PREGUNTAS — PRESENTACIÓN VISUAL
   Progreso por sección + fondo institucional + escala visual
   ========================================================== */

/* La portada conserva su diseño. El fondo fotográfico se activa
   únicamente mientras se muestran las pantallas de la evaluación. */
body:has(#surveyScreen:not(.hidden)),
body:has(#transitionScreen:not(.hidden)),
body:has(#infrastructureScreen:not(.hidden)),
body:has(#finishScreen:not(.hidden)) {
    background:
        linear-gradient(rgba(244, 249, 253, .84), rgba(237, 246, 251, .88)),
        url("../img/colegio-grijalva.jpeg") center / cover fixed no-repeat;
}

/* Tarjeta de preguntas con efecto ligeramente translúcido */
.survey-card {
    background: rgba(255, 255, 255, .94);
    border-color: rgba(255, 255, 255, .82);
    box-shadow: 0 24px 70px rgba(24, 61, 94, .16);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Encabezado: contador de la sección + sección + porcentaje */
.survey-header-stacked .survey-meta-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
}

.survey-header-stacked .progress-percent {
    min-width: 52px;
    text-align: right;
    color: var(--primary-dark);
    font-size: 1rem;
    line-height: 1.2;
    font-weight: 800;
}

/* Barra como el mockup: más visible y azul */
.progress-container {
    height: 9px;
    margin: 0 42px 4px;
    overflow: hidden;
    background: rgba(40, 103, 168, .12);
    border-radius: 999px;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-dark), var(--primary));
    border-radius: inherit;
}

/* Contenido visualmente separado del encabezado */
.question-content {
    margin: 22px 28px 28px;
    padding: 38px 36px 32px;
    background: rgba(255, 255, 255, .78);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 20px;
    box-shadow: 0 12px 34px rgba(35, 72, 105, .08);
}

.question-meta {
    width: fit-content;
    padding: 9px 13px;
    margin-bottom: 24px;
    background: rgba(40, 103, 168, .09);
    border-radius: 12px;
}

.question-meta span {
    color: var(--primary-dark);
}

.question-meta small {
    color: var(--green);
}

/* Escala 1–5 con caritas lineales */
.answer-options {
    gap: 10px;
}

.answer-button {
    min-height: 132px;
    gap: 5px;
    padding: 12px 7px 10px;
    background: rgba(255,255,255,.82);
    border-color: rgba(190, 204, 215, .8);
    border-radius: 15px;
}

.answer-face {
    width: 46px;
    height: 46px;
    display: block;
    margin-bottom: 2px;
}

.answer-face svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.answer-face .face-fill {
    fill: currentColor;
    stroke: none;
}

.answer-label {
    font-size: .76rem;
    font-weight: 700;
    white-space: nowrap;
}

.answer-number {
    width: auto;
    height: auto;
    margin-top: 1px;
    background: transparent;
    font-size: .78rem;
    color: var(--text-secondary);
}

/* Colores semánticos discretos, como en el mockup */
.face-sad   { color: #d6535b; }
.face-low   { color: #e98b24; }
.face-neutral { color: #e0ad20; }
.face-good  { color: #58a67a; }
.face-great { color: #188044; }

.answer-button:hover {
    background: rgba(237,245,252,.96);
}

.answer-button.selected {
    background: var(--primary-light);
    border-color: var(--primary);
    color: inherit;
    box-shadow: 0 8px 20px rgba(40,103,168,.12);
}

.answer-button.selected .answer-number {
    background: transparent;
    color: var(--primary-dark);
}

.answer-button.selected .answer-face {
    transform: scale(1.08);
}

/* Transiciones e infraestructura también reciben el fondo institucional */
.transition-card,
.infrastructure-card,
.finish-card {
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Móvil: conserva las cinco respuestas visibles y táctiles */
@media (max-width: 600px) {
    body:has(#surveyScreen:not(.hidden)),
    body:has(#transitionScreen:not(.hidden)),
    body:has(#infrastructureScreen:not(.hidden)),
    body:has(#finishScreen:not(.hidden)) {
        background-attachment: scroll;
        background-position: center top;
    }

    .survey-header-stacked .survey-meta-row {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "counter percent"
            "section section";
        row-gap: 8px;
    }

    .survey-header-stacked .question-counter { grid-area: counter; }
    .survey-header-stacked .section-progress { grid-area: section; text-align: left; }
    .survey-header-stacked .progress-percent {
        grid-area: percent;
        font-size: .86rem;
    }

    .progress-container {
        height: 8px;
        margin: 0 18px 2px;
    }

    .question-content {
        margin: 14px 10px 18px;
        padding: 25px 14px 20px;
        border-radius: 17px;
    }

    .question-meta {
        margin-bottom: 18px;
        padding: 8px 10px;
    }

    .answer-options {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 5px;
        margin-bottom: 28px;
    }

    .answer-button {
        min-width: 0;
        min-height: 108px;
        flex-direction: column;
        justify-content: center;
        padding: 8px 2px;
        gap: 4px;
    }

    .answer-face {
        width: 34px;
        height: 34px;
    }

    .answer-label {
        font-size: .61rem;
        line-height: 1.1;
        white-space: normal;
        text-align: center;
    }

    .answer-number {
        font-size: .68rem;
    }
}

@media (max-width: 380px) {
    .answer-face {
        width: 30px;
        height: 30px;
    }

    .answer-label {
        font-size: .56rem;
    }
}


.home-button {
    position: absolute;
    top: 18px;
    left: 22px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 11px;
    border: 1px solid rgba(40, 103, 168, .16);
    border-radius: 999px;
    background: rgba(255,255,255,.78);
    color: var(--primary-dark);
    font: inherit;
    font-size: .73rem;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.home-button:hover {
    background: #fff;
    border-color: rgba(40,103,168,.34);
    transform: translateY(-1px);
}

.home-icon {
    font-size: 1rem;
    line-height: 1;
}

.survey-header-stacked,
.infrastructure-header,
.transition-content {
    position: relative;
}


.transition-content > .home-button {
    top: 18px;
    left: 20px;
}


.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(20, 42, 60, .42);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.confirm-dialog {
    width: min(100%, 430px);
    padding: 30px 28px 26px;
    text-align: center;
    background: rgba(255,255,255,.98);
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(22,49,72,.22);
}

.confirm-home-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 800;
}

.confirm-dialog h2 {
    margin-bottom: 9px;
    color: var(--text);
    font-size: 1.35rem;
}

.confirm-dialog p {
    max-width: 340px;
    margin: 0 auto 23px;
    color: var(--text-secondary);
    font-size: .9rem;
    line-height: 1.55;
}

.confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1.25fr;
    gap: 10px;
}

.danger-soft-button {
    border: 0;
    border-radius: 13px;
    padding: 14px 16px;
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-size: .86rem;
    font-weight: 700;
    cursor: pointer;
}

.danger-soft-button:hover {
    background: var(--primary-dark);
}

@media (max-width: 600px) {
    .home-button {
        top: 12px;
        left: 12px;
        padding: 7px 9px;
        font-size: .66rem;
    }

    .home-icon {
        font-size: .9rem;
    }

    .confirm-dialog {
        padding: 25px 18px 20px;
        border-radius: 18px;
    }

    .confirm-actions {
        grid-template-columns: 1fr;
    }

    .confirm-actions .secondary-button,
    .confirm-actions .danger-soft-button {
        width: 100%;
    }
}


.welcome-card .privacy-text {
    color: rgba(255, 255, 255, .96);
    text-shadow: 0 1px 4px rgba(14, 39, 59, .58);
    font-weight: 500;
}


.global-web-credit {
    position: fixed;
    left: 50%;
    bottom: 9px;
    z-index: 40;
    transform: translateX(-50%);
    width: max-content;
    max-width: calc(100% - 32px);
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .58);
    color: rgba(68, 83, 94, .76);
    font-size: .67rem;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: .12px;
    text-align: center;
    pointer-events: none;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}


body {
    padding-bottom: 48px;
}

@media (max-width: 600px) {
    .welcome-card .privacy-text {
        color: #fff;
    }

    .global-web-credit {
        bottom: 6px;
        font-size: .62rem;
        background: rgba(255, 255, 255, .68);
    }

    body {
        padding-bottom: 42px;
    }
}


.global-web-credit {
    position: static;
    left: auto;
    bottom: auto;
    transform: none;
    width: fit-content;
    max-width: calc(100% - 32px);
    margin: 14px auto 0;
    flex: 0 0 auto;
}

body {
    min-height: 100vh;
    padding-bottom: 20px;
    flex-direction: column;
}

@media (max-width: 600px) {
    .global-web-credit {
        position: static;
        margin-top: 12px;
        margin-bottom: 2px;
    }

    body {
        padding-bottom: 14px;
    }
}


.teacher-card {
    width: min(760px, calc(100% - 32px));
    margin: 28px auto 0;
    border-radius: 24px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 18px 55px rgba(25, 55, 78, .16);
    overflow: hidden;
}

.teacher-content {
    position: relative;
    padding: 34px 38px 38px;
    text-align: center;
}

.teacher-logo {
    display: block;
    width: min(290px, 72%);
    height: auto;
    margin: 4px auto 24px;
}

.teacher-label {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--primary);
}

.teacher-content h2 {
    margin: 0 0 10px;
    color: #173b5e;
    font-size: clamp(1.55rem, 3vw, 2rem);
}

.teacher-help {
    max-width: 610px;
    margin: 0 auto 24px;
    color: #667785;
    line-height: 1.55;
}

.teacher-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
    margin: 0 auto 24px;
}

.teacher-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 64px;
    padding: 13px 17px;
    border: 1.5px solid #d8e3eb;
    border-radius: 15px;
    background: #fff;
    color: #29485f;
    font: inherit;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.teacher-option:hover {
    border-color: #8db6d7;
    transform: translateY(-1px);
}

.teacher-option strong {
    font-size: 1.04rem;
    color: #173b5e;
}

.teacher-option span {
    font-size: 1rem;
    font-weight: 750;
    letter-spacing: .055em;
    text-transform: uppercase;
    color: #536f83;
}

.teacher-option.selected {
    border-color: var(--primary);
    background: #eef6fc;
    box-shadow: 0 0 0 3px rgba(40, 103, 168, .09);
}

.teacher-continue {
    width: min(360px, 100%);
    margin: 0 auto;
}

@media (max-width: 600px) {
    .teacher-card {
        width: calc(100% - 20px);
        margin-top: 10px;
        border-radius: 20px;
    }

    .teacher-content {
        padding: 58px 18px 25px;
    }

    .teacher-logo {
        width: min(250px, 78%);
        margin-bottom: 20px;
    }

    .teacher-options {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .teacher-option {
        min-height: 59px;
        padding: 11px 12px;
    }
}


.teacher-context {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    margin: -10px 0 20px;
    padding: 7px 12px;
    border: 1px solid #d9e7f1;
    border-radius: 999px;
    background: #f3f8fc;
    color: #46657b;
    font-size: .88rem;
    line-height: 1.2;
}

.teacher-context-label {
    font-weight: 600;
}

.teacher-context strong {
    color: #173b5e;
    font-weight: 800;
}

@media (max-width: 560px) {
    .teacher-option span {
        font-size: .91rem;
    }

    .teacher-context {
        margin-top: -8px;
        font-size: .82rem;
    }
}

.teacher-progress-header {
    margin: 0 auto 24px;
}

.teacher-progress-header .teacher-logo {
    margin-bottom: 16px;
}

.teacher-title-row {
    margin-bottom: 12px;
    color: #173b5e;
    font-size: 1.05rem;
}

.teacher-meta-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    margin-bottom: 9px;
    color: #5f7280;
    font-size: .9rem;
    font-weight: 700;
}

.teacher-meta-row span:first-child { text-align: left; }
.teacher-meta-row span:nth-child(2) { text-align: center; }
.teacher-meta-row span:last-child { text-align: right; }

.teacher-progress-track {
    width: 100%;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: #e5edf3;
}

.teacher-progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
}

@media (max-width: 600px) {
    .teacher-progress-header { margin-bottom: 20px; }
    .teacher-title-row { font-size: 1rem; }
    .teacher-meta-row { font-size: .82rem; }
}


.transition-teacher-context {
    margin: 0 auto 18px;
}


/* Tipografía de reactivos */
.question-title {
    font-size: 1.85rem;
    line-height: 1.28;
}

/* Encabezado de la pregunta complementaria */
.infrastructure-header .infrastructure-meta-row {
    grid-template-columns: 1fr auto auto;
}

.infrastructure-header .section-progress {
    padding: 0;
    margin: 0;
}

@media (max-width: 600px) {
    .question-title {
        font-size: 1.55rem;
        line-height: 1.3;
    }

    .infrastructure-header .infrastructure-meta-row {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "counter percent"
            "section section";
        row-gap: 8px;
    }

    .infrastructure-header .question-counter { grid-area: counter; }
    .infrastructure-header .section-progress {
        grid-area: section;
        text-align: left;
    }
    .infrastructure-header .progress-percent { grid-area: percent; }
}
