/* Styles pour la validation des formulaires d'ordre d'intervention */

.required-field {
    position: relative;
}

.required-field .form-label::after {
    content: ' *';
    color: #dc3545;
    font-weight: bold;
}

.field-error {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

.field-valid {
    border-color: #198754 !important;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25) !important;
}

.validation-message {
    font-size: 0.875em;
    margin-top: 0.25rem;
    display: none;
}

.validation-message.error {
    color: #dc3545;
    display: block;
}

.validation-message.success {
    color: #198754;
    display: block;
}

.btn-disabled {
    opacity: 0.6;
    pointer-events: none;
}

.validation-summary {
    position: sticky;
    top: 10px;
    z-index: 1000;
    margin-bottom: 1rem;
}

/* Animation pour les champs qui changent d'état */
.form-control {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Style pour les messages de validation */
.validation-message {
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.validation-message.error {
    animation: shake 0.5s ease-in-out;
}

/* Animation de secousse pour les erreurs */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-2px); }
    20%, 40%, 60%, 80% { transform: translateX(2px); }
}

/* Amélioration visuelle des champs requis */
.required-field .input-group-outline {
    position: relative;
}

/* Indicateur visuel pour les champs manquants dans le résumé */
.validation-summary .alert {
    border-left: 4px solid #ffc107;
}

.validation-summary ul {
    list-style-type: none;
    padding-left: 0;
}

.validation-summary li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.25rem;
}

.validation-summary li::before {
    content: "⚠";
    position: absolute;
    left: 0;
    color: #ffc107;
    font-weight: bold;
}

/* Style pour les boutons désactivés */
.btn.btn-disabled {
    cursor: not-allowed;
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #fff !important;
}

/* Responsive : sur mobile, réduire la taille des messages */
@media (max-width: 768px) {
    .validation-message {
        font-size: 0.75rem;
    }
    
    .validation-summary {
        position: relative;
        top: auto;
    }
}