/* SINCRÉO Diagnóstico - Estilos Frontend */
.sincreo-diagnostico-container {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Barra de progreso */
.sincreo-progress-bar {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #004a99, #0066cc);
    width: 33.33%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

/* Header del formulario */
.form-header {
    text-align: center;
    margin-bottom: 40px;
}

.form-header h2 {
    color: #004a99;
    font-size: 2em;
    margin-bottom: 10px;
    font-weight: 300;
}

.form-description {
    color: #666;
    font-size: 1.1em;
}

/* Pasos del formulario */
.form-steps {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.form-step {
    display: none;
    padding: 40px;
    min-height: 500px;
}

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

.form-step h3 {
    color: #004a99;
    font-size: 1.5em;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

/* Grupos de formulario */
.form-group {
    margin-bottom: 25px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #004a99;
    box-shadow: 0 0 0 3px rgba(0, 74, 153, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Escala de rating */
.rating-scale {
    display: flex;
    gap: 15px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.rating-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 100px;
}

.rating-option:hover {
    border-color: #004a99;
    background: #f8f9fa;
}

.rating-option input[type="radio"] {
    display: none;
}

.rating-option input[type="radio"]:checked + .rating-label {
    background: #004a99;
    color: white;
}

.rating-label {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.rating-text {
    font-size: 14px;
    text-align: center;
    color: #666;
}

/* Grupos de checkboxes */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 15px 0;
}

.checkbox-option {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: normal;
}

.checkbox-option:hover {
    border-color: #004a99;
    background: #f8f9fa;
}

.checkbox-option input[type="checkbox"] {
    margin-right: 10px;
    width: auto;
    transform: scale(1.2);
}

.checkbox-option input[type="checkbox"]:checked + span {
    color: #004a99;
    font-weight: 600;
}

.checkbox-option.consent {
    grid-column: 1 / -1;
    background: #f8f9fa;
    border-color: #dee2e6;
}

/* Texto de ayuda */
.help-text {
    display: block;
    margin-top: 5px;
    color: #6c757d;
    font-size: 14px;
}

/* Campos condicionales */
.conditional-field {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.conditional-field.show {
    display: block;
    opacity: 1;
}

/* Mensajes de error */
.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #dc3545;
}

.form-group.error .error-message {
    display: block;
}

/* Navegación del formulario */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.btn-prev,
.btn-next,
.btn-submit {
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-prev {
    background: #6c757d;
    color: white;
}

.btn-prev:hover {
    background: #5a6268;
}

.btn-next,
.btn-submit {
    background: #004a99;
    color: white;
}

.btn-next:hover,
.btn-submit:hover {
    background: #003d7a;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 74, 153, 0.3);
}

.btn-submit {
    background: linear-gradient(135deg, #004a99, #0066cc);
    padding: 15px 40px;
    font-size: 18px;
}

/* Loading */
.form-loading {
    text-align: center;
    padding: 40px;
}

.loader {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #004a99;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Mensajes de éxito y error */
.sincreo-success-message,
.sincreo-error-message {
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    margin: 20px 0;
}

.sincreo-success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.sincreo-error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.sincreo-success-message h3,
.sincreo-error-message h3 {
    margin: 0 0 15px;
    font-size: 1.5em;
}

/* Responsive */
@media (max-width: 768px) {
    .sincreo-diagnostico-container {
        margin: 0 15px;
    }
    
    .form-step {
        padding: 20px;
        min-height: auto;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .rating-scale {
        justify-content: center;
    }
    
    .rating-option {
        min-width: 80px;
        padding: 10px;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .form-navigation {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }
    
    .btn-prev,
    .btn-next,
    .btn-submit {
        width: 100%;
        justify-content: center;
    }
}

/* Tema oscuro */
.sincreo-diagnostico-container[data-theme="dark"] {
    color: #e9ecef;
}

.sincreo-diagnostico-container[data-theme="dark"] .form-steps {
    background: #343a40;
}

.sincreo-diagnostico-container[data-theme="dark"] .form-group input,
.sincreo-diagnostico-container[data-theme="dark"] .form-group select,
.sincreo-diagnostico-container[data-theme="dark"] .form-group textarea {
    background: #495057;
    border-color: #6c757d;
    color: #e9ecef;
}

/* Animaciones */
.form-step {
    animation: slideIn 0.3s ease-in-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* reCAPTCHA styling */
.g-recaptcha {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}