/* =========================
   CONTACT — CHARTE TORTIELLO
   ========================= */

/* === FORMULAIRE === */
.contact-form-section {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #fafafa 100%);
}

.contact-form {
    max-width: 800px;
    margin: 0 auto;
    background: var(--secondary-color);
    border-radius: var(--radius-xl);
    padding: 50px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--light-gray);
}

/* === FIELDSETS ET LÉGENDES === */
.form-fieldset {
    border: none;
    padding: 0;
}

.fieldset-legend {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 25px;
    padding: 0;
    border-bottom: 2px solid var(--light-gray);
    padding-bottom: 10px;
    width: 100%;
}

/* === GRID DE FORMULAIRE === */
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 10px;
}

/* === LABELS === */
.form-label {
    display: block;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.95rem;
    margin-bottom: 4px;
    line-height: 1.4;
}

.required-indicator {
    color: #ef4444;
    font-weight: 700;
    margin-left: 4px;
}

/* === CHAMPS DE SAISIE === */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #d1d5db;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--secondary-color);
    color: var(--primary-color);
    box-sizing: border-box;
    line-height: 1.5;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: #9ca3af;
    opacity: 1;
}

.form-textarea {
    resize: vertical;
    min-height: 140px;
    font-family: var(--font-primary);
}

/* === CHECKBOX PERSONNALISÉE === */
.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 8px;
    position: relative;
    cursor: pointer;
}

.form-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
    z-index: 1;
}

.checkmark {
    height: 20px;
    width: 20px;
    background-color: #ffffff;
    border: 2px solid #6b7280;
    border-radius: 4px;
    display: inline-block;
    position: relative;
    flex-shrink: 0;
    transition: all 0.3s ease;
    cursor: pointer;
    pointer-events: auto;
}

.checkbox-container:hover .checkmark {
    border-color: var(--primary-color);
    background-color: #f9fafb;
    transform: scale(1.05);
}

.form-checkbox:focus + .checkmark {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
}

.form-checkbox:checked + .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-checkbox:checked + .checkmark:after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--dark-gray);
    line-height: 1.5;
    position: relative;
    width: 100%;
    margin-left: 0;
    pointer-events: auto;
}

.checkbox-text {
    flex: 1;
    line-height: 1.5;
    cursor: pointer;
    pointer-events: auto;
}

/* Rendre toute la zone cliquable */
.checkbox-container:hover {
    cursor: pointer;
}

.checkbox-container * {
    pointer-events: auto;
}

/* === MESSAGE D'ERREUR CHECKBOX === */
.checkbox-error {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 12px;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    color: #dc2626;
    font-size: 0.9rem;
    font-weight: 500;
    animation: fadeIn 0.3s ease;
}

.checkbox-error i {
    width: 16px;
    height: 16px;
    color: #dc2626;
    flex-shrink: 0;
}

.checkbox-error span {
    line-height: 1.4;
}

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

/* === BOUTON D'ENVOI === */
.form-submit {
    background: var(--gold-gradient);
    color: var(--secondary-color);
    border: none;
    padding: 20px 40px;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    width: 100%;
    cursor: pointer;
    box-shadow: var(--gold-shadow);
    margin-bottom: 8px;
}

.form-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(249, 163, 18, 0.3);
}

.form-submit:active {
    transform: translateY(-1px);
}

.form-submit i {
    width: 20px;
    height: 20px;
}

/* === ÉTATS DE VALIDATION === */
.form-input.valid,
.form-select.valid,
.form-textarea.valid {
    border-color: #10b981;
    background-color: #f0fdf4;
}

.form-input.error,
.form-select.error,
.form-textarea.error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

/* === STYLES POUR INTL-TEL-INPUT === */
.iti {
    width: 100%;
}

.iti__flag-container {
    background: var(--secondary-color);
    border-right: 1px solid #d1d5db;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.iti__selected-flag {
    background: var(--secondary-color) !important;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    padding: 0 12px;
}

.iti__selected-flag:hover {
    background: #f9fafb !important;
}

.iti__country-list {
    background: var(--secondary-color);
    border: 1px solid #d1d5db;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 200px;
    overflow-y: auto;
}

.iti__country {
    padding: 8px 12px;
    transition: background-color 0.2s ease;
}

.iti__country:hover {
    background-color: #f9fafb;
}

.iti__country.iti__active {
    background-color: var(--primary-color);
    color: var(--secondary-color);
}

.iti__dial-code {
    color: var(--dark-gray);
    font-weight: 500;
}

.iti__flag {
    margin-right: 8px;
}

/* Ajustement du padding pour le champ téléphone avec drapeau */
.form-group input[type="tel"] {
    padding-left: 80px;
}

/* === RESPONSIVE MOBILE === */
@media (max-width: 768px) {
    .contact-form-section {
        padding: 15px 0;
        background: var(--secondary-color);
    }
    
    .contact-form {
        padding: 25px 20px;
        margin: 0 10px;
        border-radius: var(--radius-lg);
        box-shadow: none;
        border: none;
        background: transparent;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 25px;
        margin-bottom: 30px;
    }
    
    .form-fieldset {
        margin-bottom: 35px;
        padding: 0;
    }
    
    .fieldset-legend {
        font-size: 1.2rem;
        margin-bottom: 25px;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--light-gray);
    }
    
    .form-group {
        margin-bottom: 30px;
    }
    
    .form-label {
        font-size: 1rem;
        margin-bottom: 10px;
        font-weight: 700;
        color: var(--primary-color);
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 18px 20px;
        font-size: 16px; /* Évite le zoom sur iOS */
        border-radius: var(--radius-md);
        border: 2px solid #e5e7eb;
        background: var(--secondary-color);
        min-height: 56px; /* Zone de clic optimale pour mobile */
        box-sizing: border-box;
    }
    
    .form-textarea {
        min-height: 120px;
        padding: 20px;
        line-height: 1.6;
    }
    
    .form-submit {
        padding: 20px 30px;
        font-size: 1.1rem;
        font-weight: 700;
        min-height: 60px;
        border-radius: var(--radius-md);
        margin-top: 10px;
    }
    
    /* Optimisation checkbox mobile */
    .checkbox-container {
        margin-bottom: 15px;
    }
    
    .checkbox-label {
        font-size: 1rem;
        line-height: 1.5;
        gap: 15px;
    }
    
    .checkmark {
        height: 24px;
        width: 24px;
        flex-shrink: 0;
    }
    
    .checkbox-text {
        line-height: 1.6;
    }
    
    /* Message d'erreur mobile */
    .checkbox-error {
        margin-top: 12px;
        padding: 12px 16px;
        font-size: 0.9rem;
        border-radius: var(--radius-md);
    }
    
    /* Optimisation intl-tel-input mobile */
    .iti {
        width: 100%;
    }
    
    .iti__flag-container {
        min-height: 56px;
        display: flex;
        align-items: center;
    }
    
    .iti__selected-flag {
        min-height: 56px;
        padding: 0 15px;
    }
    
    .form-group input[type="tel"] {
        padding-left: 90px;
    }
}

@media (max-width: 480px) {
    .contact-form-section {
        padding: 10px 0;
    }
    
    .contact-form {
        padding: 20px 15px;
        margin: 0 8px;
    }
    
    .form-fieldset {
        margin-bottom: 30px;
    }
    
    .fieldset-legend {
        font-size: 1.1rem;
        margin-bottom: 20px;
    }
    
    .form-group {
        margin-bottom: 25px;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 16px 18px;
        min-height: 52px;
        font-size: 16px;
    }
    
    .form-textarea {
        min-height: 100px;
        padding: 18px;
    }
    
    .form-submit {
        padding: 18px 25px;
        font-size: 1rem;
        min-height: 56px;
    }
    
    .form-row {
        gap: 20px;
        margin-bottom: 25px;
    }
    
    .checkmark {
        height: 22px;
        width: 22px;
    }
    
    .checkbox-label {
        gap: 12px;
    }
}

/* === OPTIMISATIONS TACTILES === */
@media (hover: none) and (pointer: coarse) {
    .form-input:hover,
    .form-select:hover,
    .form-textarea:hover {
        border-color: #e5e7eb;
        transform: none;
    }
    
    .form-input:focus,
    .form-select:focus,
    .form-textarea:focus {
        transform: none;
        box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
    }
    
    .form-submit:hover {
        transform: none;
        box-shadow: var(--gold-shadow);
    }
    
    .form-submit:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* === ACCESSIBILITÉ MOBILE === */
@media (max-width: 768px) {
    .form-input:focus,
    .form-select:focus,
    .form-textarea:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 4px rgba(0,0,0,0.15);
    }
    
    .form-label {
        cursor: pointer;
        user-select: none;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        -webkit-appearance: none;
        appearance: none;
        border-radius: var(--radius-md);
    }
    
    .form-select {
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
        background-position: right 12px center;
        background-repeat: no-repeat;
        background-size: 16px;
        padding-right: 40px;
    }
}  