/* Definición de variables con valores por defecto */
:root {
    --primary-color: #3b82f6;
    --text-color: #ffffff;
    --primary-color-dark-10: #2563eb;
    --primary-color-dark-15: #1d4ed8;
    --primary-color-rgb: 59, 130, 246;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f8f9fa;
    color: #2d3748;
    line-height: 1.6;
}

.form-container {
    min-height: 100vh;
    padding: 2rem 0;
}

.main-card {
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: 12px;
}

/* --- Secciones del Header --- */
.header-section.no-banner {
    background-color: var(--primary-color);
    color: var(--text-color);
    border-radius: 12px 12px 0 0;
    padding: 3rem 2rem;
}

.header-section.no-banner h1,
.header-section.no-banner p {
    color: var(--text-color);
}

.header-section.with-banner {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 300px;
    border-radius: 12px 12px 0 0;
    padding: 0;
    display: block;
}

.title-section-alt {
    background: white;
    padding: 2rem;
    border-bottom: 1px solid #e2e8f0;
    text-align: center;
}

.title-section-alt h1 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 1.75rem;
}

.title-section-alt p {
    color: #2d3748;
    font-size: 1.1rem;
    margin-bottom: 0;
}

/* --- Selector de Categoría --- */
.category-selector {
    padding: 2rem;
    background-color: white;
}

.section-description {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 2rem;
}

.category-option {
    background-color: var(--primary-color);
    color: var(--text-color);
    border: none;
    border-radius: 12px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.category-option:hover {
    background-color: var(--primary-color-dark-10);
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.category-option.selected {
    background-color: var(--primary-color-dark-15);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.category-option i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
    color: var(--text-color);
}

.category-option div {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-color);
}

/* --- Sección del Formulario --- */
.form-section {
    background: white;
    padding: 2rem;
}

.selected-category-badge {
    background-color: var(--primary-color);
    color: var(--text-color);
    padding: 1rem 1.5rem;
    border-radius: 50px;
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.selected-category-badge i {
    font-size: 1.2rem;
    margin-right: 0.5rem;
    color: var(--text-color);
}

.question-group {
    border-bottom: 1px solid #f1f5f9;
    padding: 1.5rem 0;
}

.question-group:last-child {
    border-bottom: none;
}

.question-label {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.8rem;
    display: block;
    font-size: 1rem;
}

.required-indicator {
    color: #e53e3e;
    margin-left: 4px;
}

/* --- Inputs y Form Controls --- */
.form-control,
.form-select {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background-color: #fafafa;
}

.form-control:hover,
.form-select:hover {
    border-color: #cbd5e0;
    background-color: white;
}

/* ESTO ERA LO QUE FALTABA - BORDES CON COLOR PRINCIPAL */
.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.15) !important;
    background-color: white !important;
}

/* --- Botones --- */
.btn-primary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: var(--text-color) !important;
    font-weight: 600 !important;
    padding: 1rem 3rem !important;
    border-radius: 10px !important;
    transition: all 0.3s ease !important;
    font-size: 1.1rem !important;
}

.btn-primary:hover {
    background-color: var(--primary-color-dark-10) !important;
    border-color: var(--primary-color-dark-10) !important;
    color: var(--text-color) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15) !important;
}

.btn-primary:disabled,
.btn-primary[disabled] {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: var(--text-color) !important;
    opacity: 0.8;
    cursor: not-allowed;
}

.btn-primary:disabled:hover,
.btn-primary[disabled]:hover {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    transform: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ESTO TAMBIÉN FALTABA - BOTÓN CAMBIAR CATEGORÍA */
.btn-outline-secondary {
    border-color: #e2e8f0;
    color: #4a5568;
    background-color: transparent;
}

.btn-outline-secondary:hover {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: var(--text-color) !important;
}

/* --- Barra de Progreso --- */
.progress-bar-custom {
    height: 2px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.5s ease;
    border-radius: 4px;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-helper {
    font-size: 0.875rem;
    color: #718096;
    margin-top: 0.5rem;
}

/* --- Alertas --- */
.alert {
    border: none;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    font-weight: 500;
}

.alert-danger {
    background-color: #fef2f2;
    color: #dc2626;
    border-left: 4px solid #dc2626;
}

.alert-success {
    background-color: #f0fdf4;
    color: #16a34a;
    border-left: 4px solid #16a34a;
}

/* --- Mensaje de Éxito --- */
#success-message {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* ESTOS ESTILOS FALTABAN PARA EL MENSAJE DE ÉXITO */
#success-message .fas.fa-check-circle {
    color: var(--primary-color);
}

#success-message h2 {
    color: var(--primary-color);
}

/* --- Preguntas Dinámicas --- */
.dynamic-question-container {
    border-left: 3px solid var(--primary-color);
    background-color: #f8f9fa;
    border-radius: 0 8px 8px 0;
    margin-left: 0px;
    margin-top: 0px !important;
    padding: 0.2rem !important;
}

.dynamic-question-container .question-group {
    border-bottom: none;
    padding: 1rem 0 0 0;
}

.dynamic-question-container .question-label {
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .form-container {
        padding: 1rem 0;
    }
    .main-card {
        margin: 0 1rem;
    }
    .header-section.with-banner {
        min-height: 200px;
    }
    .title-section-alt {
        padding: 1.5rem;
    }
    .title-section-alt h1 {
        font-size: 1.5rem;
    }
    .category-option i {
        font-size: 2rem;
    }
    .section-description {
        font-size: 1.2rem;
    }
}

.captcha-container {
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    padding: 1rem;
    background-color: #fafafa;
    text-align: center;
}

@media (max-width: 991px) {
    .container.form-container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: 100% !important;
    }
    
    .main-card {
        margin: 0 !important;
        border-left: none !important;
        border-right: none !important;
        border-radius: 0 !important;
    }
    
    .header-section.no-banner {
        border-radius: 0 !important;
    }
    
    .header-section.with-banner {
        border-radius: 0 !important;
    }
}

@media (max-width: 768px) {
    .form-container {
        padding: 0 !important;
    }
    
    .main-card {
        box-shadow: none !important;
        border: none !important;
    }
}
