/**
 * Styles personnalisés pour le formulaire de contact
 * et les notifications Bootstrap
 */

/* ====================================
   CONTENEUR D'ALERTES
   ==================================== */
#contact-alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    left: 20px;
    z-index: 9999;
    max-width: 600px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    #contact-alert-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
}

/* ====================================
   ALERTES PERSONNALISÉES
   ==================================== */
.alert {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: none;
    animation: slideInDown 0.3s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-danger {
    background-color: #fff5f5;
    border-left: 4px solid #e53e3e;
    color: #742a2a;
}

.alert-danger .alert-heading {
    color: #c53030;
    font-weight: 600;
}

.alert ul {
    padding-left: 20px;
    margin-bottom: 0;
}

.alert ul li {
    margin-bottom: 5px;
}

.alert ul li:last-child {
    margin-bottom: 0;
}

/* ====================================
   VALIDATION DES CHAMPS
   ==================================== */
.wpcf7-form-control.is-valid {
    border-color: #48bb78 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2348bb78' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
    padding-right: 40px;
}

.wpcf7-form-control.is-invalid {
    border-color: #f56565 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23f56565'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23f56565' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
    padding-right: 40px;
}

.invalid-feedback {
    display: block;
    margin-top: 5px;
    font-size: 0.875rem;
    color: #e53e3e;
}

/* ====================================
   AMÉLIORATION DU FORMULAIRE
   ==================================== */
.dt-sc-custom-contact-form input[type="text"],
.dt-sc-custom-contact-form input[type="email"],
.dt-sc-custom-contact-form input[type="tel"],
.dt-sc-custom-contact-form textarea {
    transition: all 0.3s ease;
    border: 2px solid #e2e8f0;
}

.dt-sc-custom-contact-form input[type="text"]:focus,
.dt-sc-custom-contact-form input[type="email"]:focus,
.dt-sc-custom-contact-form input[type="tel"]:focus,
.dt-sc-custom-contact-form textarea:focus {
    border-color: #395835;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

/* ====================================
   SPINNER
   ==================================== */
.wpcf7-spinner {
    display: none;
    margin-left: 10px;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ====================================
   RESPONSIVE
   ==================================== */
@media (max-width: 768px) {
    .alert {
        font-size: 14px;
    }
    
    .alert-heading {
        font-size: 16px !important;
    }
    
    .dt-sc-custom-contact-form input,
    .dt-sc-custom-contact-form textarea {
        font-size: 16px; /* Évite le zoom sur iOS */
    }
}

/* ====================================
   ANIMATIONS SUPPLÉMENTAIRES
   ==================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

.slide-up {
    animation: slideUp 0.4s ease-out;
}

/* ====================================
   ÉTATS DE CHARGEMENT
   ==================================== */
.form-loading {
    position: relative;
    pointer-events: none;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
}
