/* ==========================================================================
   1. CONTENEDOR PRINCIPAL
   ========================================================================== */
.cr-test-container {
    max-width: 100%;
    margin: 0px auto;
    padding: 0px;
    background: transparent;
    border-radius: 0px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    color: #333333;
}


/* ==========================================================================
   2. TIPOGRAFÍA RESPONSIVA Y ENCABEZADOS
   ========================================================================== */
.cr-test-container h1 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    line-height: 1.25;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #222222;
}

.cr-test-container h3 {
    font-size: clamp(1.3rem, 3vw, 1.7rem);
    line-height: 1.3;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.cr-test-container h4 {
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    line-height: 1.4;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #444444;
}

.cr-instructions h5 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 15px 0 8px 0;
}

.cr-question-sub {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    line-height: 1.4;
    color: #555555;
    margin-bottom: 20px;
}


/* ==========================================================================
   3. BARRA DE PROGRESO
   ========================================================================== */
.cr-progress-bar-container {
    margin-bottom: 30px;
}

.cr-progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #666;
}

.cr-progress-track {
    height: 10px;
    background: #eef0f5;
    border-radius: 20px;
    overflow: hidden;
}

.cr-progress-fill {
    height: 100%;
    background: var(--cr-primary, #7344ca);
    transition: width 0.4s ease;
}


/* ==========================================================================
   4. ESTRUCTURA Y NAVEGACIÓN DE PASOS (MULTISTEP)
   ========================================================================== */
.cr-step-page {
    display: none;
}

.cr-step-active {
    display: block;
}


/* ==========================================================================
   5. TARJETAS DE OPCIONES (RADIO BUTTONS)
   ========================================================================== */
.cr-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 25px 0;
}

.cr-option-card {
    position: relative;
    border: 2px solid #eef0f5;
    border-radius: 14px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    height: 100%;
    box-sizing: border-box;
}

.cr-option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Estructura interna flexible para alinear contenido */
.cr-option-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    width: 100%;
}

/* Formato y proporción de imagen */
.cr-option-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.cr-option-label {
    font-size: 0.92rem;
    line-height: 1.35;
    color: #444444;
    word-break: break-word;
}

/* Estado Hover y Seleccionado */
.cr-option-card:hover {
    border-color: var(--cr-primary, #7344ca);
    background: #fdfbff;
    transform: translateY(-2px);
}

.cr-option-card input[type="radio"]:checked + .cr-option-content .cr-option-label {
    color: var(--cr-primary, #7344ca);
    font-weight: 700;
}

.cr-option-card:has(input[type="radio"]:checked) {
    border-color: var(--cr-primary, #7344ca);
    background: #f6f0ff;
    box-shadow: 0 6px 16px rgba(115, 68, 202, 0.18);
}


/* ==========================================================================
   6. BOTONES Y NAVEGACIÓN
   ========================================================================== */
.cr-nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

/* Selector unificado para todos los tipos de botones */
.cr-btn, 
.cr-btn-submit,
.cr-btn-secondary {
    padding: 12px 28px;
    border: none !important;
    outline: none !important;
    border-radius: 30px !important;
    background: #9b6bf4 !important;
    color: #ffffff !important;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Estado Hover para botones principales y de envío */
.cr-btn:hover:not(:disabled), 
.cr-btn-submit:hover:not(:disabled),
.cr-btn-secondary:hover {
    background: #7344ca !important;
    color: #ffb700 !important;
    border: none !important;
    border-radius: 30px !important;
    transform: translateY(-1px);
}

/* Estado Deshabilitado */
.cr-btn:disabled,
.cr-btn-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border: none !important;
    border-radius: 30px !important;
    transform: none !important;
}

/* Botón "Anterior" */
.cr-btn-prev {
    background: #dac9f1 !important;
    color: #b796ed !important;
    border: none !important;
    border-radius: 30px !important;
}

.cr-btn-prev:hover {
    background: #7344ca !important;
    color: #ffb700 !important;
    border: none !important;
    border-radius: 30px !important;
}


/* ==========================================================================
   7. FORMULARIO DE CAPTURA DE LEAD
   ========================================================================== */
.cr-lead-box {
    max-width: 100%;
    margin: 0 auto;
}

.cr-lead-box h3 {
    margin-bottom: 8px;
}

.cr-lead-box p {
    color: #666;
    margin-bottom: 25px;
    font-size: 15px;
}

/* Grid de Fila doble (Nombre y Apellidos) */
.cr-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.cr-form-group {
    margin-bottom: 20px;
}

/* Clase para forzar ancho completo */
.cr-form-group.cr-full-width {
    width: 100%;
    grid-column: 1 / -1;
}

.cr-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #444444;
}

/* Campos de entrada estilizados */
.cr-form-group input {
    width: 100% !important;
    padding: 14px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    color: #333333;
    background-color: #fdfdfd;
    box-sizing: border-box;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.cr-form-group input::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

/* Hover en Inputs */
.cr-form-group input:hover {
    border-color: #cbd5e0;
    background-color: #ffffff;
}

/* Focus Moderno con Ring morado */
.cr-form-group input:focus {
    border-color: #9b6bf4 !important;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(155, 107, 244, 0.15) !important;
}

/* Responsivo para móviles */
@media (max-width: 600px) {
    .cr-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}


/* ==========================================================================
   8. INDICADOR DE CARGA (SPINNER)
   ========================================================================== */
.cr-spinner-wrapper {
    text-align: center;
    padding: 40px 0;
}

.cr-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--cr-primary, #7344ca);
    border-radius: 50%;
    animation: crSpin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes crSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* ==========================================================================
   9. PANTALLA DE RESULTADOS Y RECOMENDACIONES
   ========================================================================== */
.cr-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.cr-result-card {
    background: #f9f8fc;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #ede7f6;
}

.cr-pattern-img {
    max-width: 120px;
    border-radius: 8px;
    margin-top: 10px;
}

.cr-rec-box {
    background: #fff8f6;
    border-left: 4px solid var(--cr-primary, #7344ca);
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 0 8px 8px 0;
}


/* ==========================================================================
   10. DISEÑO RESPONSIVO (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 768px) {
    .cr-options-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .cr-btn, 
    .cr-btn-secondary {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .cr-nav-buttons {
        flex-direction: column-reverse;
    }
}