.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.required, .text-danger {
    color: #ef4444;
}

/* Styles pour tous les champs input */
.form-control {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    font-size: 16px;
    background: #fafafa;
    transition: all 0.3s ease;
    outline: none;
    color: #374151;
    font-family: inherit;
}

.form-control::placeholder {
    color: #9ca3af;
}

.form-control:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.form-control:hover:not(:focus) {
    border-color: #d1d5db;
    background: #f9fafb;
}

/* Styles spécifiques pour textarea */
textarea.form-control {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

/* Styles pour les champs email avec validation */


.form-control[type="email"]:invalid:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* Container pour les inputs avec icônes ou éléments additionnels */
.input-container {
    position: relative;
}

.input-container .form-control {
    width: 100%;
}

/* Styles pour le conteneur du téléphone */
.phone-input-container {
    display: flex;
    gap: 2px;
    background: #fafafa;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    transition: all 0.3s ease;
    overflow: hidden;
    height: 54px; /* Hauteur fixe pour correspondre aux autres champs */
}

.phone-input-container:focus-within {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.phone-input-container:hover:not(:focus-within) {
    border-color: #d1d5db;
    background: #f9fafb;
}

.country-selector {
    display: flex;
    align-items: center;
    padding: 10px 11px; /* Padding réduit pour correspondre à la hauteur */
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    cursor: pointer;
    transition: all 0.3s ease;
    border-right: 1px solid #e5e7eb;
    min-width: 90px; /* Largeur réduite */
    gap: 6px; /* Gap réduit */
}

.country-selector:hover {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
}

.flag-container {
    width: 20px; /* Taille réduite */
    height: 15px; /* Taille réduite */
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flag-icon {
    width: 100%;
    height: 100%;
}

.country-code {
    font-weight: 600;
    color: #374151;
    font-size: 13px; /* Taille réduite */
}

.phone-input {
    flex: 1;
    padding: 14px; /* Padding réduit pour correspondre */
    border: none;
    outline: none;
    font-size: 16px;
    background: transparent;
    color: #374151;
}

.phone-input::placeholder {
    color: #9ca3af;
}

/* Styles pour le bouton de soumission */
 .btn-modern-custom {
    width: 100%;
    padding: 18px;
    /* background: linear-gradient(135deg, #667eea, #363c9a); */
    background-color: #058FD4;
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn-primary-::before, .btn-modern-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-primary-:hover::before, .btn-modern-custom:hover::before {
    left: 100%;
}

.btn-primary-:hover, .btn-modern-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-primary-:active, .btn-modern-custom:active {
    transform: translateY(0);
}

/* Styles pour les alertes */
.alert {
    padding: 16px 20px;
    margin-bottom: 24px;
    border-radius: 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
}

.alert-success {
    background: #ecfdf5;
    border-left: 4px solid #10b981;
    color: #059669;
}

.alert-danger {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #dc2626;
}

.alert-dismissible {
    padding-right: 50px;
    position: relative;
}

.btn-close, .btn-close-white {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.btn-close:hover, .btn-close-white:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Styles pour le modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 32px 24px 24px 24px;
    width: 100%;
    max-width: 400px;
    max-height: 70vh;
    overflow: hidden;
    animation: modalSlide 0.3s ease-out;
    position: relative;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1a1a1a;
}

.countries-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.countries-list::-webkit-scrollbar {
    width: 6px;
}

.countries-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.countries-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.country-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.country-option:hover {
    background: #f8fafc;
}

.country-option.selected {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 500;
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #6b7280;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Styles pour les états de validation */
.form-control:invalid:not(:focus):not(:placeholder-shown) {
    border-color: #ef4444;
}

.form-control:valid:not(:focus):not(:placeholder-shown) {
    border-color: #10b981;
}

/* Animation pour les champs requis */
.form-control:required:focus {
    animation: none;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.form-control:invalid:focus {
    animation: shake 0.3s ease-in-out;
}

/* Responsive */
@media (max-width: 768px) {
    .form-control {
        padding: 14px 16px;
        font-size: 16px; /* Empêche le zoom sur iOS */
    }
    
    .phone-input {
        padding: 14px 16px;
    }
    
    .country-selector {
        padding: 14px 16px;
    }
    
     .btn-modern-custom {
        padding: 16px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .phone-input-container {
        flex-direction: row; /* Garde la disposition horizontale */
        gap: 2px;
        height: auto; /* Hauteur automatique pour mobile */
        min-height: 50px; /* Hauteur minimum */
    }
    
    .country-selector {
        border-right: 1px solid #e5e7eb; /* Garde la bordure droite */
        min-width: 80px; /* Largeur réduite pour mobile */
        padding: 12px 8px; /* Padding réduit */
        gap: 4px;
    }
    
    .phone-input {
        flex: 1;
        padding: 12px 14px; /* Padding cohérent */
        min-width: 0; /* Permet la flexibilité */
    }
    
    .flag-container {
        width: 18px;
        height: 13px;
    }
    
    .country-code {
        font-size: 12px;
    }
    
    .modal-content {
        padding: 24px 16px 16px 16px;
        margin: 10px;
    }
    
    .form-control {
        padding: 12px 14px;
    }
}

/* Amélioration pour l'accessibilité */
@media (prefers-reduced-motion: reduce) {
    .form-control {
        transition: none;
    }
    
    .phone-input-container {
        transition: none;
    }
    
     .btn-modern-custom {
        transition: none;
    }
    
    .btn-primary-::before, .btn-modern-custom::before {
        transition: none;
    }
    
    .alert {
        animation: none;
    }
    
    .modal-content {
        animation: none;
    }
}