/**
 * Glow Up Quiz - Estilos V3.5 MEJORADO
 * ✅ Scroll funcional en todas las pantallas
 * ✅ Contenido completo visible
 * ✅ Sin elementos rotos
 * ✅ Márgenes respetados en PC y móvil
 */

/* ============================================ */
/* VARIABLES */
/* ============================================ */
:root {
    --color-primary: #667eea;
    --color-secondary: #764ba2;
    --color-text: #1a1a1a;
    --color-text-light: #666;
    --color-white: #ffffff;
    --border-radius: 18px;
    --transition: all 0.3s ease;
}

/* ============================================ */
/* RESET Y BASE - PERMITIR SCROLL */
/* ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
    width: 100%;
}

body {
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 100vh;
    width: 100%;
}

/* ============================================ */
/* WRAPPER PRINCIPAL - SCROLL HABILITADO */
/* ============================================ */
.glow-quiz-wrapper {
    min-height: 100vh;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 15px 0;
}

/* ============================================ */
/* PANTALLAS - CON SCROLL */
/* ============================================ */
.quiz-screen {
    display: none;
    min-height: 100vh;
    width: 100%;
    padding: 20px 15px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
    overflow-y: auto;
    overflow-x: hidden;
}

.quiz-screen.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    animation: fadeIn 0.3s ease-in-out;
}

.quiz-screen::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 800"><defs><linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" style="stop-color:%23667eea;stop-opacity:0.08"/><stop offset="100%" style="stop-color:%23764ba2;stop-opacity:0.08"/></linearGradient></defs><rect width="1200" height="800" fill="url(%23grad1)"/></svg>');
    background-size: cover;
    background-position: center;
    filter: blur(60px);
    opacity: 0.2;
    z-index: 0;
    pointer-events: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

/* ============================================ */
/* CONTENEDOR - CON ALTURA AUTOMÁTICA */
/* ============================================ */
.quiz-card {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15);
    width: 100%;
    max-width: 480px;
    min-height: 500px;
    max-height: none;
    margin: 20px auto;
    overflow: visible;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================ */
/* HEADER - ALTURA FIJA */
/* ============================================ */
.quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    min-height: 60px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.08);
    flex-shrink: 0;
}

.quiz-back-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(102, 126, 234, 0.08);
    color: var(--color-primary);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.quiz-back-btn:hover {
    background: rgba(102, 126, 234, 0.15);
}

.quiz-back-btn:active {
    transform: scale(0.95);
}

.quiz-logo {
    font-size: clamp(1em, 2.5vw, 1.1em);
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    flex: 1;
}

.quiz-counter {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85em;
    flex-shrink: 0;
}

/* ============================================ */
/* CONTENIDO - CON SCROLL Y PADDING ADECUADO */
/* ============================================ */
.quiz-question-container {
    padding: 25px 20px 30px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

/* Scrollbar estilizado */
.quiz-question-container::-webkit-scrollbar {
    width: 4px;
}

.quiz-question-container::-webkit-scrollbar-track {
    background: rgba(102, 126, 234, 0.05);
    border-radius: 4px;
}

.quiz-question-container::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 4px;
}

.quiz-question-container::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

.quiz-question-title {
    font-size: clamp(1.2em, 3.5vw, 1.4em);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 15px;
    color: var(--color-text);
    text-align: center;
}

/* ============================================ */
/* IMAGEN - TAMAÑO RESPONSIVO */
/* ============================================ */
.quiz-question-image {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    display: block;
}

/* ============================================ */
/* OPCIONES - ESPACIADO MEJORADO */
/* ============================================ */
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.quiz-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 20px;
    min-height: 52px;
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 3px 12px rgba(255, 154, 86, 0.25);
    overflow: hidden;
}

.quiz-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.quiz-option span {
    font-size: clamp(0.9em, 2.2vw, 1em);
    font-weight: 600;
    color: white;
    text-align: center;
    line-height: 1.4;
    position: relative;
    z-index: 1;
}

.quiz-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(255, 154, 86, 0.35);
}

.quiz-option:active {
    transform: scale(0.98);
}

.quiz-option.selected {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    box-shadow: 0 5px 18px rgba(102, 126, 234, 0.4);
}

/* ============================================ */
/* PANTALLAS ESPECIALES - SCROLL HABILITADO */
/* ============================================ */
.quiz-content-center {
    position: relative;
    z-index: 1;
    width: 90%;
    max-width: 500px;
    margin: 20px auto;
    padding: 30px 25px;
    text-align: center;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.15);
}

.quiz-main-title {
    font-size: clamp(1.8em, 5vw, 2.4em);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 15px;
    color: var(--color-text);
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.quiz-subtitle {
    font-size: clamp(1.1em, 3vw, 1.3em);
    line-height: 1.4;
    margin-bottom: 12px;
    color: var(--color-text);
}

.quiz-description {
    font-size: clamp(0.95em, 2.5vw, 1.05em);
    line-height: 1.6;
    color: var(--color-text-light);
    margin-bottom: 25px;
}

/* ============================================ */
/* BOTONES - RESPONSIVE */
/* ============================================ */
.quiz-btn {
    padding: 14px 32px;
    font-size: clamp(0.95em, 2.5vw, 1.05em);
    font-weight: 700;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

.quiz-btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    box-shadow: 0 5px 18px rgba(102, 126, 234, 0.3);
}

.quiz-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 22px rgba(102, 126, 234, 0.4);
}

.quiz-btn-primary:active {
    transform: scale(0.98);
}

.quiz-btn-secondary {
    background: white;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.quiz-btn-secondary:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* ============================================ */
/* BARRA DE PROGRESO */
/* ============================================ */
.quiz-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(102, 126, 234, 0.12);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    transition: width 0.5s ease;
}

/* ============================================ */
/* INTRO COMPACTA CON SCROLL */
/* ============================================ */
.quiz-intro-text {
    text-align: left;
    margin: 20px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 5px 12px rgba(102, 126, 234, 0.08);
}

.quiz-intro-text p {
    font-size: clamp(0.9em, 2.2vw, 1em);
    line-height: 1.7;
    margin-bottom: 12px;
    color: var(--color-text);
}

.quiz-intro-text p:last-child {
    margin-bottom: 0;
}

.quiz-highlight {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.12), rgba(255, 152, 0, 0.12));
    padding: 15px 18px;
    border-left: 3px solid #ffa726;
    border-radius: 8px;
    font-weight: 600;
    color: #e65100;
    margin-top: 15px;
    font-size: clamp(0.85em, 2vw, 0.95em);
    line-height: 1.5;
}

/* ============================================ */
/* EMAIL INPUT */
/* ============================================ */
.quiz-email-input {
    margin: 20px 0;
}

.quiz-email-input input[type="email"] {
    width: 100%;
    padding: 14px 18px;
    font-size: clamp(0.95em, 2.5vw, 1.05em);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    transition: var(--transition);
    background: white;
    text-align: center;
}

.quiz-email-input input[type="email"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ============================================ */
/* LOADING - COMPACTO */
/* ============================================ */
.quiz-loading-steps {
    margin: 30px 0;
}

.loading-step {
    margin: 25px 0;
    opacity: 0.2;
    transition: opacity 0.3s ease;
}

.loading-step.active {
    opacity: 1;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

.loading-icon {
    font-size: clamp(2.5em, 7vw, 3em);
    margin-bottom: 10px;
}

.loading-step p {
    font-size: clamp(1em, 3vw, 1.1em);
    color: var(--color-text-light);
    font-weight: 600;
}

.quiz-progress-loader {
    width: 100%;
    height: 6px;
    background: rgba(102, 126, 234, 0.12);
    border-radius: 12px;
    overflow: hidden;
    margin: 25px auto 0;
}

.quiz-progress-loader-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    animation: loadingProgress 3s ease-in-out forwards;
}

@keyframes loadingProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* ============================================ */
/* NAVEGACIÓN */
/* ============================================ */
.quiz-nav-buttons {
    display: flex;
    gap: 12px;
    margin-top: 25px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================ */
/* SECTION LABEL */
/* ============================================ */
.quiz-section-label {
    display: inline-block;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.08));
    color: var(--color-primary);
    padding: 8px 18px;
    border-radius: 18px;
    font-size: clamp(0.75em, 2vw, 0.85em);
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    border: 2px solid rgba(102, 126, 234, 0.15);
}

/* ============================================ */
/* ANIMACIÓN OPCIONES */
/* ============================================ */
.quiz-option {
    animation: slideInOption 0.25s ease-out backwards;
}

.quiz-option:nth-child(1) { animation-delay: 0.05s; }
.quiz-option:nth-child(2) { animation-delay: 0.1s; }
.quiz-option:nth-child(3) { animation-delay: 0.15s; }
.quiz-option:nth-child(4) { animation-delay: 0.2s; }

@keyframes slideInOption {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ============================================ */
/* RESPONSIVE - MÓVIL PEQUEÑO */
/* ============================================ */
@media (max-width: 360px) {
    .glow-quiz-wrapper {
        padding: 10px 0;
    }
    
    .quiz-screen {
        padding: 15px 10px;
    }
    
    .quiz-card {
        margin: 10px auto;
    }
    
    .quiz-header {
        padding: 12px 15px;
    }
    
    .quiz-question-container {
        padding: 20px 15px 25px;
    }
    
    .quiz-question-title {
        font-size: 1.1em;
    }
    
    .quiz-question-image {
        max-height: 160px;
    }
    
    .quiz-option {
        min-height: 48px;
        padding: 14px 16px;
    }
    
    .quiz-content-center {
        padding: 25px 20px;
    }
}

/* ============================================ */
/* RESPONSIVE - TABLET */
/* ============================================ */
@media (min-width: 768px) {
    .glow-quiz-wrapper {
        padding: 25px 0;
    }
    
    .quiz-screen {
        padding: 30px 20px;
    }
    
    .quiz-card {
        max-width: 520px;
        margin: 30px auto;
    }
    
    .quiz-header {
        padding: 18px 25px;
    }
    
    .quiz-question-container {
        padding: 30px 25px 35px;
    }
    
    .quiz-question-image {
        max-height: 220px;
    }
    
    .quiz-option {
        min-height: 56px;
    }
    
    .quiz-content-center {
        max-width: 550px;
        padding: 40px 35px;
    }
}

/* ============================================ */
/* RESPONSIVE - DESKTOP */
/* ============================================ */
@media (min-width: 1024px) {
    .glow-quiz-wrapper {
        padding: 30px 0;
    }
    
    .quiz-screen {
        padding: 40px 25px;
    }
    
    .quiz-card {
        max-width: 560px;
        margin: 40px auto;
    }
    
    .quiz-header {
        padding: 20px 30px;
    }
    
    .quiz-question-container {
        padding: 35px 30px 40px;
    }
    
    .quiz-question-image {
        max-height: 240px;
    }
    
    .quiz-option {
        min-height: 58px;
    }
    
    .quiz-content-center {
        max-width: 600px;
        padding: 50px 40px;
    }
}

/* ============================================ */
/* UTILIDADES */
/* ============================================ */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }