/* ==========================================================================
   1. VARIABLES GLOBALES Y RESET
   ========================================================================== */
:root {
    --turquesa: #049ea5;
    --naranja: #f47621;
    --rosa: #dc4498;
    --verde: #5fae46;
    --blanco: #ffffff;
    --negro: #000000;
    --grisOscuro: #333333;
    --grisMedio: #dddddd;
}

.text-turquesa { color: var(--turquesa) !important; }
.text-verde    { color: var(--verde) !important; }
.text-naranja  { color: var(--naranja) !important; }
.text-rosa     { color: var(--rosa) !important; }

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    box-shadow: none !important;
    text-shadow: none !important;
}

body {
    background-color: var(--blanco);
    font-family: 'Helvetica Neue', Arial, sans-serif;
    color: var(--grisOscuro);
    line-height: 1.6;
    position: relative;
    min-height: 100vh;
    padding: 60px 20px;
    overflow-x: hidden;
}

/* ==========================================================================
   2. QUIZ INTERACTIVO Y FEEDBACK (VARIABLES CENTRALIZADAS)
   ========================================================================== */
.body-blanco {
    background-color: var(--blanco) !important;
}

.texto-pregunta-activa {
    font-size: 1.6rem;
    font-weight: bold;
    line-height: 1.3;
    margin-bottom: 25px;
    color: var(--turquesa);
}

.grupo-opciones {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.tarjeta-opcion {
    display: flex;
    align-items: flex-start;
    background: var(--blanco);
    border: 2px solid var(--grisMedio);
    border-radius: 8px;
    padding: 18px 20px;
    cursor: pointer;
    color: var(--grisOscuro);
    transition: all 0.25s ease;
}

.tarjeta-opcion:hover {
    border-color: var(--turquesa);
}

.tarjeta-opcion input[type="radio"] {
    display: none;
}

/* Bullets circulares cromáticos */
.bullet-circular {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 15px;
    flex-shrink: 0;
    margin-top: 5px;
}

.bullet-turquesa { background-color: var(--turquesa); }
.bullet-verde    { background-color: var(--verde); }
.bullet-naranja  { background-color: var(--naranja); }
.bullet-rosa     { background-color: var(--rosa); }

.texto-opcion-label {
    font-size: 1.05rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
}

/* Contenedor de SVG superior */
.contenedor-svg-animado {
    width: 110px;
    height: 110px;
    margin: 50px auto 30px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contenedor-svg-animado svg {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    display: block;
    transform: none !important;
}

.icono-dinamico {
    width: 100%;
    height: 100%;
    transition: fill 0.3s ease;
}

/* AVATARES DE PERSONAJES (CAPÍTULO 2) */
.avatar-imagen-container {
    width: 75px;
    height: 100px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.img-personaje-traslucida {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 1;
    display: block;
}

.header-personaje {
    align-items: flex-start;
}

/* Control cromático dinámico por opción seleccionada */
.dinamico-turquesa .contenedor-svg-animado svg,
.dinamico-turquesa .contenedor-svg-animado svg path { fill: var(--turquesa) !important; }
.dinamico-turquesa .opcion-retro-seleccionada,
.dinamico-turquesa .texto-retro-explicacion { color: var(--turquesa) !important; }

.dinamico-verde .contenedor-svg-animado svg,
.dinamico-verde .contenedor-svg-animado svg path { fill: var(--verde) !important; }
.dinamico-verde .opcion-retro-seleccionada,
.dinamico-verde .texto-retro-explicacion { color: var(--verde) !important; }

.dinamico-naranja .contenedor-svg-animado svg,
.dinamico-naranja .contenedor-svg-animado svg path { fill: var(--naranja) !important; }
.dinamico-naranja .opcion-retro-seleccionada,
.dinamico-naranja .texto-retro-explicacion { color: var(--naranja) !important; }

.dinamico-rosa .contenedor-svg-animado svg,
.dinamico-rosa .contenedor-svg-animado svg path { fill: var(--rosa) !important; }
.dinamico-rosa .opcion-retro-seleccionada,
.dinamico-rosa .texto-retro-explicacion { color: var(--rosa) !important; }

/* Formateo de textos de retroalimentación */
.opcion-retro-seleccionada {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 25px;
    line-height: 1.4;
    text-align: center;
}

.texto-retro-explicacion {
    font-size: 1.2rem;
    line-height: 1.6;
    font-weight: 500;
    margin-bottom: 35px;
    text-align: center;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.texto-retro-general {
    font-size: 1.05rem;
    line-height: 1.6;
    font-weight: 500;
    margin-top: 25px;
    margin-bottom: 35px;
    text-align: center;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.marca-error-x {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 10px;
    text-align: center;
}

/* Botones de navegación */
.btn-siguiente-quiz, .btn-regresar-home {
    display: inline-block;
    background-color: var(--turquesa);
    color: var(--blanco);
    text-decoration: none;
    padding: 14px 45px;
    font-weight: bold;
    font-size: 1.1rem;
    border-radius: 4px;
    letter-spacing: 1px;
    transition: opacity 0.2s ease;
}

.btn-siguiente-quiz:hover, .btn-regresar-home:hover {
    opacity: 0.85;
}

/* Estructura de Escenarios en el Quiz */
.contenedor-pregunta-escenario {
    text-align: left;
    margin-bottom: 30px;
}

.header-titulo-escenario {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.texto-titulo-escenario {
    font-size: 1.35rem;
    font-weight: bold;
    color: var(--grisOscuro);
}

.texto-escenario-cuerpo {
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.texto-escenario-cuerpo strong {
    font-weight: bold;
}

.texto-escenario-cierre {
    font-size: 1.05rem;
    color: var(--grisOscuro);
    margin-bottom: 25px;
}

/* Pantalla final de evaluación */
.score-titulo {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--turquesa);
    margin: 10px 0 0 0;
    line-height: 1;
}

.score-subtitulo {
    font-size: 1.2rem;
    color: var(--turquesa);
    font-weight: bold;
    margin-bottom: 35px;
    text-transform: uppercase;
}

.titulo-evaluacion-final {
    font-size: 1.6rem;
    font-weight: bold;
    margin-bottom: 20px;
}

.texto-evaluacion-final {
    font-size: 1.15rem;
    line-height: 1.6;
    color: var(--grisOscuro);
    max-width: 550px;
    margin: 0 auto;
}

.contenedor-flechas-cierre img {
    max-width: 100px;
    height: auto;
    margin: 0 auto;
}

/* ==========================================================================
   3. COMPONENTES DE HISTORIAS NARRATIVAS (CAPÍTULO 2)
   ========================================================================== */
.tarjeta-historia {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    text-align: left;
    margin-bottom: 25px;
}

.header-personaje {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--turquesa);
    padding-bottom: 15px;
}

.avatar-silueta {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--turquesa);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: bold;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.info-personaje h2 {
    font-size: 1.3rem;
    color: var(--turquesa);
    margin: 0;
    line-height: 1.2;
}

.info-personaje p {
    font-size: 0.85rem;
    color: var(--grisOscuro);
    margin: 3px 0 0 0;
    font-weight: 500;
}

.tag-incidente {
    display: inline-block;
    background-color: #f8f9fa;
    border-left: 4px solid var(--naranja);
    padding: 6px 10px;
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--naranja);
    margin-top: 6px;
    border-radius: 0 4px 4px 0;
}

.relato-texto {
    font-size: 0.98rem;
    line-height: 1.6;
    color: var(--grisOscuro);
    margin-bottom: 18px;
    text-align: justify;
}

.cita-destacada {
    font-style: italic;
    font-weight: 600;
    color: var(--negro) !important;
    background: #f4f4f4;
    border-left: 4px solid var(--grisMedio);
    padding: 12px 15px;
    margin-bottom: 18px;
    border-radius: 0 6px 6px 0;
    font-size: 0.95rem;
}

.conclusion-impacto {
    font-size: 0.98rem;
    line-height: 1.6;
    font-weight: bold;
    color: var(--turquesa);
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed var(--grisMedio);
}

.conclusion-impacto strong {
    color: var(--negro) !important;
}

/* Animaciones */
.animated { animation-duration: 0.4s; animation-fill-mode: both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.fadeIn { animation-name: fadeIn; }

.btn-siguiente-imagen img {
    max-width: 180px;
    height: auto;
    display: block;
    margin: 0 auto;
    animation: reboteDerecha 1.5s ease-in-out infinite;
}

.btn-siguiente-imagen:active img {
    animation: none;
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

@keyframes reboteDerecha {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(12px); }
}

/* ==========================================================================
   4. COMPONENTES DE ACCESO / LOGIN
   ========================================================================== */
.body-login {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px !important;
}

.contenedor-login {
    width: 100%;
    max-width: 420px;
    background-color: var(--blanco);
    border: 2px solid var(--grisMedio);
    padding: 40px 30px;
    text-align: center;
}

.logo-principal {
    max-width: 220px;
    height: auto;
    margin-bottom: 25px;
    display: inline-block;
}

.fecha-hoy {
    font-size: 0.9rem;
    color: var(--turquesa);
    font-weight: bold;
    margin-bottom: 25px;
    text-transform: capitalize;
}

.alerta-anonimato {
    border: 2px solid var(--naranja);
    background-color: var(--blanco);
    color: var(--naranja);
    padding: 15px;
    font-size: 0.85rem;
    font-weight: bold;
    line-height: 1.4;
    margin-bottom: 30px;
    text-align: left;
}

.grupo-campo {
    margin-bottom: 20px;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--grisOscuro);
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--grisMedio);
    background-color: var(--blanco);
    color: var(--grisOscuro);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="password"]:focus {
    border-color: var(--turquesa);
}

#zona-mensajes {
    margin-top: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    min-height: 20px;
}

.msg-error { color: var(--rosa); }
.msg-success { color: var(--verde); }

/* ==========================================================================
   5. ESTRUCTURA BASE Y ELEMENTOS COMUNES
   ========================================================================== */
.main-container {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    text-align: center;
}

.decoracion-puntos {
    position: absolute;
    width: 80px;
    height: auto;
    pointer-events: none;
    z-index: 1;
}

.puntos-top {
    top: 20px;
    left: 20px;
}

.puntos-bottom {
    bottom: 20px;
    right: 20px;
    transform: rotate(180deg);
}

.logo-dashboard {
    max-width: 220px;
    width: 100%;
    height: auto;
    margin: 0 auto 30px auto;
    display: block;
}

.bienvenidos-titulo {
    max-width: 240px;
    width: 100%;
    height: auto;
    margin: 40px auto 30px auto;
}

.texto-informativo {
    text-align: justify;
    font-size: 1.1rem;
    color: var(--grisOscuro);
    margin-bottom: 25px;
    line-height: 1.7;
}

.contenedor-boton {
    margin-top: 30px;
}

.btn-imagen {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-block;
    outline: none;
}

.btn-imagen img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   6. REJILLA DE CAPÍTULOS (HOME / INDEX)
   ========================================================================== */
.grid-capitulos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 20px;
    padding: 10px;
}

.bloque-capitulo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.bloque-capitulo img {
    max-width: 100px;
    width: 100%;
    height: auto;
    transition: transform 0.2s ease;
}

.capitulo-bloqueado {
    opacity: 0.25;
    cursor: not-allowed;
}

.capitulo-activo:hover img {
    transform: scale(1.05);
}

/* ==========================================================================
   7. PANTALLA INTRODUCCIÓN AL CAPÍTULO (HISTORIA.PHP)
   ========================================================================== */
.header-capitulo {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 40px;
}

.logo-capitulo-derecha {
    max-width: 300px;
    width: 100%;
    height: auto;
    align-self: flex-end;
    margin-bottom: 20px;
}

.badge-capitulo {
    max-width: 190px;
    width: 100%;
    height: auto;
    align-self: flex-start;
}

.titulo-capitulo {
    font-size: 1.8rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 25px;
    line-height: 1.3;
    padding: 0 10px;
    color: var(--turquesa);
}

.subtexto-turquesa {
    font-size: 0.95rem;
    font-weight: normal;
    margin-bottom: 45px;
    color: var(--turquesa);
    opacity: 0.9;
}

.pregunta-listx-turquesa {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--turquesa);
}

.instruccion-test-turquesa {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 40px;
    color: var(--turquesa);
}

.btn-flechas-turquesa img {
    max-width: 120px;
    width: 100%;
    margin: 0 auto;
    display: block;
    animation: reboteSutil 1.6s infinite ease-in-out;
}

/* Botón verde para finalización de actividad */
.btn-finalizar-verde {
    background-color: var(--verde) !important;
    color: var(--blanco) !important;
}

.btn-finalizar-verde:hover {
    opacity: 0.9;
}

@keyframes reboteSutil {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(12px); }
}

/* ==========================================================================
   8. RESPONSIVIDAD GLOBAL (OPTIMIZADO PARA MÓVILES)
   ========================================================================== */
@media (max-width: 600px) {
    body {
        padding: 75px 35px;
    }

    .texto-informativo {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 20px;
    }

    .decoracion-puntos {
        width: 30px; 
    }

    .puntos-top {
        top: 15px;
        left: 15px;
    }

    .puntos-bottom {
        bottom: 15px;
        right: 15px;
    }

    .logo-dashboard {
        max-width: 165px;
        margin-top: 10px;
        margin-bottom: 25px;
    }

    .grid-capitulos {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .header-capitulo {
        display: flex;
        flex-direction: column; 
        gap: 12px;
        margin-bottom: 30px;
    }

    .logo-capitulo-derecha {
        max-width: 165px;
        align-self: flex-end;
        margin-bottom: 0;
    }

    .badge-capitulo {
        max-width: 110px;
        align-self: flex-start;
    }

    .tarjeta-historia {
        padding: 0;
    }

    .header-personaje {
        gap: 10px;
    }

    .avatar-silueta {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .info-personaje h2 {
        font-size: 1.15rem;
    }
}