/**
 * Styles pour Contact Form 7
 * Formulaire Rigoles Métalliques
 */

/* ============================================================
   STRUCTURE GÉNÉRALE DU FORMULAIRE
   ============================================================ */

.wpcf7 {
    font-family: var(--font-primary);
}

.wpcf7 p {
    margin-bottom: 1.5rem;
}

/* Titre et texte important */
.wpcf7 p strong {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-secondary);
    margin-bottom: 0.5rem;
}

.wpcf7 p strong[style*="color:red"],
.wpcf7 p strong[style*="color: red"] {
    color: #dc2626 !important;
    font-size: 1rem;
    padding: 1rem;
    background: #fee2e2;
    border-left: 4px solid #dc2626;
    margin-bottom: 1.5rem;
    border-radius: 4px;
}

/* ============================================================
   LABELS
   ============================================================ */

.wpcf7 label {
    display: block;
    font-weight: 600;
    color: var(--color-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* ============================================================
   CHAMPS DE TEXTE ET SELECT
   ============================================================ */

.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 input[type="number"],
.wpcf7 textarea,
.wpcf7 select {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: var(--font-primary);
    color: var(--color-text);
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 4px;
    transition: all 0.3s ease;
    outline: none;
}

.wpcf7 input[type="text"]:focus,
.wpcf7 input[type="email"]:focus,
.wpcf7 input[type="tel"]:focus,
.wpcf7 input[type="url"]:focus,
.wpcf7 input[type="number"]:focus,
.wpcf7 textarea:focus,
.wpcf7 select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(15, 106, 190, 0.1);
}

/* Textarea spécifique */
.wpcf7 textarea {
    min-height: 120px;
    resize: vertical;
}

/* Select */
.wpcf7 select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23111827' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* ============================================================
   RADIO BUTTONS
   ============================================================ */

.wpcf7 .wpcf7-radio {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.wpcf7 .wpcf7-list-item {
    margin: 0;
    display: inline-flex;
    align-items: center;
}

.wpcf7 input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    margin-right: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.wpcf7 input[type="radio"]:checked {
    border-color: var(--color-primary);
    background-color: white;
}

.wpcf7 input[type="radio"]:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--color-primary);
    border-radius: 50%;
}

.wpcf7 input[type="radio"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(15, 106, 190, 0.1);
}

.wpcf7 .wpcf7-list-item-label {
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
    font-size: 0.95rem;
}

/* ============================================================
   BOUTON SUBMIT
   ============================================================ */

.wpcf7 input[type="submit"],
.wpcf7 button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    background: var(--color-primary);
    border: 2px solid var(--color-primary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 1rem;
}

.wpcf7 input[type="submit"]:hover,
.wpcf7 button[type="submit"]:hover {
    background: var(--color-secondary);
    border-color: var(--color-secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(15, 106, 190, 0.3);
}

.wpcf7 input[type="submit"]:active,
.wpcf7 button[type="submit"]:active {
    transform: translateY(0);
}

/* État de chargement */
.wpcf7 form.submitting input[type="submit"],
.wpcf7 form.submitting button[type="submit"] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================================
   MESSAGES DE VALIDATION
   ============================================================ */

/* Message de succès */
.wpcf7-mail-sent-ok {
    background: #d1fae5;
    border: 2px solid #059669;
    border-left: 4px solid #059669;
    color: #065f46;
    padding: 1rem 1.25rem;
    border-radius: 4px;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Message d'erreur général */
.wpcf7-validation-errors,
.wpcf7-mail-sent-ng {
    background: #fee2e2;
    border: 2px solid #dc2626;
    border-left: 4px solid #dc2626;
    color: #991b1b;
    padding: 1rem 1.25rem;
    border-radius: 4px;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Erreur sur un champ spécifique */
.wpcf7-not-valid-tip {
    color: #dc2626;
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.5rem;
    display: block;
}

.wpcf7-not-valid {
    border-color: #dc2626 !important;
}

.wpcf7-not-valid:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

/* Spinner de chargement */
.wpcf7-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(15, 106, 190, 0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: wpcf7-spin 0.8s linear infinite;
    margin-left: 1rem;
    vertical-align: middle;
}

@keyframes wpcf7-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .wpcf7 p strong {
        font-size: 1.125rem;
    }

    .wpcf7 input[type="submit"],
    .wpcf7 button[type="submit"] {
        padding: 0.875rem 2rem;
        font-size: 0.9375rem;
    }

    .wpcf7 .wpcf7-radio {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* ============================================================
   ACCESSIBILITÉ
   ============================================================ */

.wpcf7 .screen-reader-response {
    position: absolute;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
}

/* Focus visible pour l'accessibilité */
.wpcf7 input:focus-visible,
.wpcf7 textarea:focus-visible,
.wpcf7 select:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}
