/* =====================================================
   STYLE CONTACT FORM 7 - ATLAS MANDARIN INSTITUTE
   ===================================================== */

/* 1. Neutraliser les bordures de conteneur d'essai & marges indésirables */
.form-container div[style*="dashed"] { 
    border: none !important; 
    padding: 0 !important; 
    background: transparent !important; 
}
.form-container p, 
.wpcf7-form p { 
    margin: 0 !important; 
    padding: 0 !important; 
}
.wpcf7-form br { 
    display: none !important; 
}
.wpcf7-form-control-wrap { 
    display: block !important; 
    width: 100% !important; 
}

/* CORRECTIF DÉBORDEMENT MOBILE */
.wpcf7-form,
.wpcf7 {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* 2. Disposition en 2 colonnes (et 1 colonne sur mobile) */
.wpcf7-form .form-row { 
    display: grid !important; 
    grid-template-columns: 1fr 1fr !important; 
    gap: 1.5rem !important; 
    margin-bottom: 1.5rem !important; 
}
@media (max-width: 768px) { 
    .wpcf7-form .form-row { 
        grid-template-columns: 1fr !important; 
    } 
}

/* 3. Groupes de champs et Étiquettes */
.wpcf7-form .form-group { 
    margin-bottom: 1.5rem !important; 
    text-align: left !important; 
}
.wpcf7-form .form-group label { 
    display: block !important; 
    font-weight: 600 !important; 
    margin-bottom: 0.5rem !important; 
    color: #023c24 !important; 
    font-size: 0.95rem !important; 
}

/* 4. Champs texte, e-mail, téléphone, select et textarea */
.wpcf7-form input.wpcf7-text,
.wpcf7-form input.wpcf7-email,
.wpcf7-form input.wpcf7-tel,
.wpcf7-form select.wpcf7-select,
.wpcf7-form textarea.wpcf7-textarea {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0.8rem 1rem !important;
    border: 1px solid #E6E7E3 !important;
    border-radius: 8px !important;
    font-family: inherit !important;
    font-size: 1rem !important;
    background-color: #FAF9F5 !important;
    color: #232725 !important;
    box-sizing: border-box !important;
    display: block !important;
    outline: none !important;
    transition: border-color 0.2s ease, background-color 0.2s ease !important;
}

.wpcf7-form textarea.wpcf7-textarea { 
    height: 100px !important; 
    resize: vertical !important; 
}

/* 5. Focus des champs */
.wpcf7-form input.wpcf7-text:focus,
.wpcf7-form input.wpcf7-email:focus,
.wpcf7-form input.wpcf7-tel:focus,
.wpcf7-form select.wpcf7-select:focus,
.wpcf7-form textarea.wpcf7-textarea:focus {
    border-color: #118c3d !important;
    background-color: #FFFFFF !important;
}

/* 6. Case à cocher de consentement */
.wpcf7-form .wpcf7-acceptance label {
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
    font-weight: normal !important;
    font-size: 0.9rem !important;
    color: #5a605c !important;
    cursor: pointer !important;
    text-align: left !important;
}
.wpcf7-form .wpcf7-acceptance input[type="checkbox"] {
    margin-top: 0.25rem !important;
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
}

/* 7. Bouton de soumission */
.wpcf7-form .form-submit {
    margin-top: 2rem !important;
    text-align: center !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.wpcf7-form .wpcf7-submit {
    display: block !important;
    width: 100% !important;
    max-width: 500px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    padding: 1rem 2rem !important;
    font-family: inherit !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: white !important;
    background: linear-gradient(135deg, #118c3d, #023c24) !important;
    border: none !important;
    border-radius: 0 !important;
    cursor: pointer !important;
    box-shadow: 0 4px 15px rgba(17,140,61,0.3) !important;
    transition: all 0.3s ease !important;
    white-space: normal !important; /* ← Permet le retour à la ligne si besoin */
    text-align: center !important;
}

.wpcf7-form .wpcf7-submit:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(17,140,61,0.4) !important;
}

/* Mobile : bouton pleine largeur */
@media (max-width: 768px) {
    .wpcf7-form .wpcf7-submit {
        max-width: 100% !important;
        width: 100% !important;
        font-size: 0.95rem !important;
        padding: 1rem !important;
        white-space: normal !important;
    }
}

/* Envoi via WhatsApp */
.wpcf7-form .form-submit p { display: flex !important; justify-content: center !important; }
.wpcf7-form button.wpcf7-submit {
    display: flex !important; justify-content: center !important; align-items: center !important;
    gap: 0.6rem; margin-left: auto !important; margin-right: auto !important;
}
.wpcf7-form button.wpcf7-submit i { font-size: 1.3em; }
.wpcf7-form .form-note { font-size: 0.85rem; color: var(--text-muted) !important; text-align: center; margin-top: 0.75rem; }
.wpcf7-form .form-status { text-align: center; font-weight: 600; color: var(--primary-dark) !important; margin-top: 1rem; }
.wpcf7-form .form-status:empty { display: none; }
.wpcf7-form [aria-invalid="true"] { border-color: var(--danger) !important; }

/* ── Correctifs de mise en page (section Contact) ── */
/* Espacement régulier : un seul écart de 1.5rem entre tous les champs */
.wpcf7-form .form-row > .form-group { margin-bottom: 0 !important; }
.wpcf7-form .form-check { margin-top: 0.5rem !important; margin-bottom: 0 !important; }
.wpcf7-form .form-submit { margin-top: 2rem !important; overflow: visible !important; }

/* Texte d'introduction : espace avant le formulaire */
.form-container h2 { margin-bottom: 0.75rem !important; }
.form-container p.sub { margin-bottom: 2.5rem !important; text-align: center !important; }

/* Pas de texte justifié dans le formulaire (évite les mots étirés) */
.wpcf7-form p, .wpcf7-form label { text-align: left !important; }
.wpcf7-form .form-submit p { text-align: center !important; }
.wpcf7-form label span[style] { white-space: nowrap; }

/* Note et message sous le bouton */
.wpcf7-form .form-note { margin-top: 1rem !important; }
.wpcf7-form .form-status { margin-top: 1rem !important; }

/* Sélecteurs : même hauteur que les champs texte */
.wpcf7-form select.wpcf7-select { height: auto !important; line-height: 1.5 !important; }

/* Mobile : carte plus compacte */
@media (max-width: 768px) {
    .form-container { padding: 2rem 1.25rem !important; }
    .form-container h2 { font-size: 1.5rem !important; }
    .form-container p.sub { margin-bottom: 2rem !important; }
    .wpcf7-form label span[style] { white-space: normal; }
}
