/**
 * CSS Responsive uniforme pour tous les formulaires de contact OMNICOM
 * Compatible avec tous les appareils : Desktop, Tablet, Mobile
 */

/* ===========================================
   STYLES DE BASE POUR FORMULAIRES
   =========================================== */

.contact-form-responsive {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    box-sizing: border-box;
}

.contact-form-responsive .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.contact-form-responsive .form-group {
    margin-bottom: 20px;
}

.contact-form-responsive .form-group.full-width {
    grid-column: 1 / -1;
}

/* ===========================================
   STYLES DES CHAMPS DE FORMULAIRE
   =========================================== */

.contact-form-responsive input[type="text"],
.contact-form-responsive input[type="email"],
.contact-form-responsive input[type="tel"],
.contact-form-responsive select,
.contact-form-responsive textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background: #fff !important;
    color: #333 !important;
}

.contact-form-responsive input:focus,
.contact-form-responsive select:focus,
.contact-form-responsive textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.contact-form-responsive textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

.contact-form-responsive select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='%23667eea' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
    padding-right: 40px;
}

/* ===========================================
   LABELS ET TEXTES
   =========================================== */

.contact-form-responsive label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.contact-form-responsive .required {
    color: #e74c3c;
    font-weight: bold;
    margin-left: 2px;
}

/* Styles pour tous les formulaires (compatibilité) */
.required {
    color: #e74c3c !important;
    font-weight: bold;
    margin-left: 2px;
}

/* Labels harmonisés - FORCE L'AFFICHAGE */
.contact-form label,
.contact-form-responsive label,
.form-group label,
label {
    display: block !important;
    margin-bottom: 8px !important;
    font-weight: 600 !important;
    color: #333 !important;
    font-size: 16px !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Force l'affichage des labels dans tous les contextes */
.contact-form .form-group label,
.contact-form-responsive .form-group label,
form label,
.col label {
    display: block !important;
    margin-bottom: 8px !important;
    font-weight: 600 !important;
    color: #333 !important;
    font-size: 16px !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.contact-form-responsive ::placeholder {
    color: #999 !important;
    opacity: 1 !important;
    font-style: italic;
}

/* ===========================================
   FORCE VISIBILITÉ DU TEXTE (CORRECTION URGENTE)
   =========================================== */

/* Forcer la visibilité du texte dans TOUS les cas */
.contact-form-responsive input,
.contact-form-responsive textarea,
.contact-form-responsive select,
form.contact-form-responsive input,
form.contact-form-responsive textarea,
form.contact-form-responsive select {
    color: #333 !important;
    background: #fff !important;
}

/* ===========================================
   BOUTON DE SOUMISSION
   =========================================== */

.contact-form-responsive .btn-submit {
    width: 100%;
    padding: 18px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0.5px;
}

.contact-form-responsive .btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.contact-form-responsive .btn-submit:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.contact-form-responsive .btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ===========================================
   MESSAGES DE FEEDBACK
   =========================================== */

.contact-form-responsive .success-message {
    background: #d4edda;
    color: #155724;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #c3e6cb;
    font-size: 16px;
    display: flex;
    align-items: center;
    min-height: 60px;
}

.contact-form-responsive .error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #f5c6cb;
    font-size: 16px;
    display: flex;
    align-items: center;
    min-height: 60px;
}

.contact-form-responsive .success-message::before {
    content: "✅";
    margin-right: 10px;
    font-size: 20px;
}

.contact-form-responsive .error-message::before {
    content: "❌";
    margin-right: 10px;
    font-size: 20px;
}

/* ===========================================
   ANIMATIONS ET INTERACTIONS
   =========================================== */

.contact-form-responsive .form-group {
    opacity: 0;
    animation: slideInUp 0.6s ease forwards;
}

.contact-form-responsive .form-group:nth-child(1) { animation-delay: 0.1s; }
.contact-form-responsive .form-group:nth-child(2) { animation-delay: 0.2s; }
.contact-form-responsive .form-group:nth-child(3) { animation-delay: 0.3s; }
.contact-form-responsive .form-group:nth-child(4) { animation-delay: 0.4s; }
.contact-form-responsive .form-group:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Validation visuelle en temps réel */
.contact-form-responsive .field-valid {
    border-color: #28a745 !important;
    background: linear-gradient(90deg, #f8fff9 0%, #ffffff 100%);
}

.contact-form-responsive .field-invalid {
    border-color: #dc3545 !important;
    background: linear-gradient(90deg, #fff8f8 0%, #ffffff 100%);
}

/* ===========================================
   RESPONSIVE DESIGN - TABLETS (768px et moins)
   =========================================== */

@media screen and (max-width: 768px) {
    .contact-form-responsive {
        padding: 25px 20px;
        margin: 10px;
        border-radius: 12px;
    }
    
    .contact-form-responsive .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .contact-form-responsive input[type="text"],
    .contact-form-responsive input[type="email"],
    .contact-form-responsive input[type="tel"],
    .contact-form-responsive select,
    .contact-form-responsive textarea {
        padding: 12px;
        font-size: 16px; /* Important: empêche le zoom automatique sur iOS */
    }
    
    .contact-form-responsive .btn-submit {
        padding: 16px 25px;
        font-size: 16px;
    }
    
    .contact-form-responsive label {
        font-size: 15px;
    }
}

/* ===========================================
   RESPONSIVE DESIGN - MOBILES (480px et moins)
   =========================================== */

@media screen and (max-width: 480px) {
    .contact-form-responsive {
        padding: 20px 15px;
        margin: 5px;
        border-radius: 10px;
    }
    
    .contact-form-responsive .form-group {
        margin-bottom: 15px;
    }
    
    .contact-form-responsive input[type="text"],
    .contact-form-responsive input[type="email"],
    .contact-form-responsive input[type="tel"],
    .contact-form-responsive select,
    .contact-form-responsive textarea {
        padding: 12px;
        font-size: 16px;
    }
    
    .contact-form-responsive .btn-submit {
        padding: 15px 20px;
        font-size: 16px;
    }
    
    .contact-form-responsive textarea {
        min-height: 100px;
    }
    
    .contact-form-responsive .success-message,
    .contact-form-responsive .error-message {
        padding: 15px;
        font-size: 14px;
    }
}

/* ===========================================
   RESPONSIVE DESIGN - TRÈS PETITS ÉCRANS (320px)
   =========================================== */

@media screen and (max-width: 320px) {
    .contact-form-responsive {
        padding: 15px 10px;
        margin: 2px;
    }
    
    .contact-form-responsive input[type="text"],
    .contact-form-responsive input[type="email"],
    .contact-form-responsive input[type="tel"],
    .contact-form-responsive select,
    .contact-form-responsive textarea {
        padding: 10px;
    }
    
    .contact-form-responsive .btn-submit {
        padding: 14px 15px;
        font-size: 15px;
    }
}

/* ===========================================
   MODES SOMBRES ET ACCESSIBILITÉ
   =========================================== */

@media (prefers-color-scheme: dark) {
    .contact-form-responsive {
        background: #2d2d2d;
        color: #ffffff;
    }
    
    .contact-form-responsive input[type="text"],
    .contact-form-responsive input[type="email"],
    .contact-form-responsive input[type="tel"],
    .contact-form-responsive select,
    .contact-form-responsive textarea {
        background: #3d3d3d;
        border-color: #555;
        color: #ffffff;
    }
    
    .contact-form-responsive label {
        color: #ffffff;
    }
    
    .contact-form-responsive ::placeholder {
        color: #aaa;
    }
}

/* ===========================================
   IMPRESSION
   =========================================== */

@media print {
    .contact-form-responsive {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .contact-form-responsive .btn-submit {
        display: none;
    }
}

/* ===========================================
   FOCUS VISIBLE POUR L'ACCESSIBILITÉ
   =========================================== */

.contact-form-responsive input:focus-visible,
.contact-form-responsive select:focus-visible,
.contact-form-responsive textarea:focus-visible,
.contact-form-responsive .btn-submit:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* ===========================================
   COMPATIBILITÉ AVEC LES ANCIENS STYLES
   =========================================== */

/* Pour maintenir la compatibilité avec les formulaires existants */
.contact-form {
    /* Les styles existants seront préservés mais le responsive sera ajouté */
}

/* Classe utilitaire pour forcer la responsivité */
.force-responsive .form-row,
.force-responsive .row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
}

@media screen and (max-width: 768px) {
    .force-responsive .form-row,
    .force-responsive .row {
        grid-template-columns: 1fr !important;
    }
    
    .force-responsive .col {
        width: 100% !important;
        margin-bottom: 15px !important;
    }
}