/* ═══════════════════════════════════════════════════════════════════════════
   ENCUESTA.CSS — Vista Pública Mobile-First de Estudiantes (TCMOS)
   Fiel al 100% al Sistema de Diseño de MODERNIZADO
   Paleta Institucional: Vino #6B1C1C | Negro #0f0f0f | Gris #f5f5f5 | Blanco #ffffff
   Tipografía: 'Inter', sans-serif
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --c-negro: #0f0f0f;
    --c-negro-suave: #1a1a1a;
    --c-vino: #6B1C1C;
    --c-vino-hover: #4a1212;
    --c-vino-suave: rgba(107, 28, 28, 0.06);
    --c-vino-borde: rgba(107, 28, 28, 0.28);
    --c-blanco: #ffffff;
    --c-gris: #f5f5f5;
    --c-gris-medio: #e0e0e0;
    --c-gris-texto: #767676;
    --c-texto: #1a1a1a;
    --c-texto-suave: #555555;

    --fuente: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --sombra-sm: 0 2px 10px rgba(0, 0, 0, 0.05);
    --sombra-md: 0 6px 24px rgba(0, 0, 0, 0.08);
    --sombra-lg: 0 10px 40px rgba(107, 28, 28, 0.16);
    --radio: 14px;
    --radio-sm: 10px;
    --t: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--fuente);
    background-color: var(--c-gris);
    background-image: radial-gradient(circle at 50% 0%, rgba(107, 28, 28, 0.08) 0%, transparent 55%);
    color: var(--c-texto);
    margin: 0;
    padding: 0 0 4rem 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ─── 1. BARRA DE PROGRESO SUPERIOR FIJA (STICKY) ───────────── */
.sticky-progress-wrapper {
    position: sticky;
    top: 0;
    z-index: 1040;
    background: rgba(15, 15, 15, 0.96);
    backdrop-filter: blur(10px);
    color: var(--c-blanco);
    padding: 0.65rem 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.progress-inner {
    max-width: 760px;
    margin: 0 auto;
}

/* Indicador de 3 Pasos del Wizard */
.wizard-steps-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 0.55rem;
}

.wizard-step-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.74rem;
    font-weight: 600;
    transition: var(--t);
    white-space: nowrap;
}

.wizard-step-pill .step-num {
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
}

.wizard-step-pill.active {
    background: var(--c-vino);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(107, 28, 28, 0.55);
}

.wizard-step-pill.active .step-num {
    background: #ffffff;
    color: var(--c-vino);
}

.wizard-step-pill.completed {
    background: rgba(34, 197, 94, 0.18);
    color: #4ade80;
}

.wizard-step-pill.completed .step-num {
    background: #22c55e;
    color: #ffffff;
}

.wizard-step-line {
    flex: 1;
    height: 2px;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 2px;
    transition: var(--t);
}

.wizard-step-line.completed {
    background: #22c55e;
}

.progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: rgba(255, 255, 255, 0.88);
}

.progress-track {
    width: 100%;
    height: 7px;
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #9b2c2c 0%, #ef4444 100%);
    border-radius: 999px;
    transition: width 0.35s ease;
}

/* ─── 2. CONTENEDOR PRINCIPAL MOBILE-FIRST ──────────────────── */
.encuesta-container {
    max-width: 760px;
    margin: 1.25rem auto 0;
    padding: 0 1rem;
}

/* ─── 3. ENCABEZADO HERO INSTITUCIONAL ──────────────────────── */
.hero-institucional {
    background: var(--c-blanco);
    border-radius: var(--radio);
    box-shadow: var(--sombra-md);
    overflow: hidden;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.hero-top-banner {
    background: linear-gradient(135deg, var(--c-negro) 0%, var(--c-vino) 100%);
    color: var(--c-blanco);
    padding: 1.75rem 1.5rem;
    text-align: center;
    position: relative;
}

.hero-escudo {
    width: 82px;
    height: 82px;
    object-fit: contain;
    background: var(--c-blanco);
    border-radius: 50%;
    padding: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
    margin-bottom: 0.85rem;
}

.hero-colegio-nombre {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0 0 0.25rem 0;
    color: var(--c-blanco);
}

.hero-lema {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.28rem 0.85rem;
    border-radius: 999px;
    margin-top: 0.25rem;
}

.hero-body {
    padding: 1.35rem 1.5rem;
}

.hero-encuesta-titulo {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--c-negro);
    margin: 0 0 0.4rem 0;
}

.hero-encuesta-desc {
    font-size: 0.9rem;
    color: var(--c-texto-suave);
    margin: 0;
    line-height: 1.5;
}

/* ─── 4. SEPARADORES DE SECCIÓN (PRIMARIA / BACHILLERATO / GENERAL) ─ */
.seccion-banner {
    background: linear-gradient(135deg, var(--c-vino) 0%, #4a1212 100%);
    color: var(--c-blanco);
    border-radius: var(--radio);
    padding: 1.15rem 1.4rem;
    margin: 1.5rem 0 1rem;
    box-shadow: var(--sombra-sm);
    display: flex;
    align-items: center;
    gap: 12px;
}

.seccion-banner i {
    font-size: 1.5rem;
    opacity: 0.9;
}

.seccion-banner-titulo {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin: 0;
}

.seccion-banner-sub {
    font-size: 0.8rem;
    opacity: 0.85;
    margin: 0;
}

/* ─── 5. TARJETAS DE PREGUNTA (CARDS MOBILE-FIRST) ──────────── */
.pregunta-card {
    background: var(--c-blanco);
    border-radius: var(--radio);
    padding: 1.35rem 1.35rem;
    margin-bottom: 1rem;
    border: 1.5px solid rgba(0, 0, 0, 0.06);
    border-left: 5px solid transparent;
    box-shadow: var(--sombra-sm);
    transition: var(--t);
}

.pregunta-card:focus-within {
    border-left-color: var(--c-vino);
    box-shadow: var(--sombra-md);
}

.pregunta-card.respondida {
    border-left-color: #15803d;
}

.pregunta-card.incompleta {
    border-color: #dc2626;
    border-left-width: 6px;
    border-left-color: #dc2626;
    background: #fffafa;
    animation: shakeCard 0.4s ease;
}

@keyframes shakeCard {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.pregunta-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 0.9rem;
}

.pregunta-numero {
    background: var(--c-vino-suave);
    color: var(--c-vino);
    font-weight: 800;
    font-size: 0.78rem;
    padding: 0.22rem 0.6rem;
    border-radius: 6px;
    flex-shrink: 0;
    margin-top: 2px;
}

.pregunta-titulo {
    font-size: 1rem;
    font-weight: 700;
    color: var(--c-negro);
    line-height: 1.4;
    margin: 0;
    flex: 1;
    white-space: pre-line;
}

.asterisco-req {
    color: #dc2626;
    font-weight: 800;
    margin-left: 3px;
}

.pregunta-descripcion {
    font-size: 0.83rem;
    color: var(--c-texto-suave);
    margin: -0.4rem 0 0.85rem 0;
}

.mensaje-error-pregunta {
    display: none;
    color: #dc2626;
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: 0.65rem;
    align-items: center;
    gap: 6px;
}

.pregunta-card.incompleta .mensaje-error-pregunta {
    display: flex;
}

/* ─── 6. CONTROLES TÁCTILES (RADIOS, CHECKBOXES, SELECTS) ──── */
.opciones-grid {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.opciones-grid.grid-grados {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
}

@media (min-width: 576px) {
    .opciones-grid.grid-grados {
        grid-template-columns: repeat(3, 1fr);
    }
}

.opcion-touch-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1rem;
    min-height: 50px;
    border: 1.5px solid var(--c-gris-medio);
    border-radius: var(--radio-sm);
    background: #fafafa;
    cursor: pointer;
    transition: var(--t);
    user-select: none;
    margin: 0;
}

.opcion-touch-card:hover {
    border-color: var(--c-vino-borde);
    background: var(--c-blanco);
}

.opcion-touch-card input[type="radio"],
.opcion-touch-card input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--c-vino);
    flex-shrink: 0;
    margin: 0;
    cursor: pointer;
}

.opcion-touch-card.seleccionada {
    border-color: var(--c-vino);
    background: var(--c-vino-suave);
    box-shadow: 0 2px 8px rgba(107, 28, 28, 0.1);
}

.opcion-touch-card.seleccionada .opcion-texto {
    color: var(--c-vino);
    font-weight: 700;
}

.opcion-texto {
    font-size: 0.93rem;
    font-weight: 500;
    color: var(--c-texto);
    line-height: 1.3;
}

/* Select Desplegable Táctil */
.select-tcmos {
    width: 100%;
    min-height: 52px;
    padding: 0.75rem 1rem;
    font-size: 0.96rem;
    font-family: var(--fuente);
    font-weight: 500;
    color: var(--c-texto);
    background-color: #fafafa;
    border: 1.5px solid var(--c-gris-medio);
    border-radius: var(--radio-sm);
    transition: var(--t);
    cursor: pointer;
}

.select-tcmos:focus {
    outline: none;
    border-color: var(--c-vino);
    background-color: var(--c-blanco);
    box-shadow: 0 0 0 3px rgba(107, 28, 28, 0.12);
}

/* Input de Texto Táctil */
.input-tcmos {
    width: 100%;
    min-height: 50px;
    padding: 0.75rem 1rem;
    font-size: 0.96rem;
    font-family: var(--fuente);
    color: var(--c-texto);
    background-color: #fafafa;
    border: 1.5px solid var(--c-gris-medio);
    border-radius: var(--radio-sm);
    transition: var(--t);
}

.input-tcmos:focus {
    outline: none;
    border-color: var(--c-vino);
    background-color: var(--c-blanco);
    box-shadow: 0 0 0 3px rgba(107, 28, 28, 0.12);
}

/* ─── 7. BARRA DE NAVEGACIÓN DEL WIZARD Y BOTÓN DE ENVÍO ──── */
.wizard-nav-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-wizard-next {
    min-height: 56px;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--c-vino) 0%, #4a1212 100%);
    color: var(--c-blanco);
    border: none;
    border-radius: var(--radio);
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: var(--sombra-lg);
    transition: var(--t);
}

.btn-wizard-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(107, 28, 28, 0.35);
}

.btn-wizard-prev {
    min-height: 56px;
    padding: 0.75rem 1.35rem;
    background: var(--c-blanco);
    color: var(--c-texto);
    border: 1.5px solid var(--c-gris-medio);
    border-radius: var(--radio);
    font-size: 0.96rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: var(--sombra-sm);
    transition: var(--t);
    flex-shrink: 0;
}

.btn-wizard-prev:hover {
    border-color: var(--c-vino);
    color: var(--c-vino);
    background: var(--c-vino-suave);
}

.btn-enviar-encuesta {
    width: 100%;
    min-height: 58px;
    background: linear-gradient(135deg, var(--c-vino) 0%, #4a1212 100%);
    color: var(--c-blanco);
    border: none;
    border-radius: var(--radio);
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    box-shadow: var(--sombra-lg);
    transition: var(--t);
}

.btn-enviar-encuesta:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(107, 28, 28, 0.35);
}

.btn-enviar-encuesta:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.estado-card-institucional {
    background: var(--c-blanco);
    border-radius: var(--radio);
    border-top: 6px solid var(--c-vino);
    box-shadow: var(--sombra-lg);
    padding: 2.5rem 1.75rem;
    text-align: center;
    margin-top: 2.5rem;
}

.rector-quote-box {
    background: var(--c-vino-suave);
    border-left: 4px solid var(--c-vino);
    border-radius: var(--radio-sm);
    padding: 1.35rem 1.5rem;
    text-align: left;
    margin: 1.5rem 0;
}

.transicion-suave {
    animation: fadeInBlock 0.35s ease;
}

@keyframes fadeInBlock {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
