/**
 * LEB Forms — Styles de base pour les champs CF7
 * Fichier séparé pour faciliter l'override via le thème enfant
 */

/* =============================================
   Reset & base
   ============================================= */

.wpcf7-form {
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    color: #1f2937;
}

.wpcf7-form * {
    box-sizing: border-box;
}

/* =============================================
   Labels
   ============================================= */

.wpcf7-form label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.wpcf7-form label .wpcf7-form-control-wrap {
    display: block;
    margin-top: 16px;
}

/* =============================================
   Champs texte, email, tel, url, number, date
   ============================================= */

.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form input[type="url"],
.wpcf7-form input[type="number"],
.wpcf7-form input[type="date"],
.wpcf7-form .wpcf7-text,
.wpcf7-form .wpcf7-email,
.wpcf7-form .wpcf7-tel,
.wpcf7-form .wpcf7-url,
.wpcf7-form .wpcf7-number,
.wpcf7-form .wpcf7-date {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    font-family: inherit;
    color: #1f2937;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
    -webkit-appearance: none;
}

.wpcf7-form input[type="text"]:focus,
.wpcf7-form input[type="email"]:focus,
.wpcf7-form input[type="tel"]:focus,
.wpcf7-form input[type="url"]:focus,
.wpcf7-form input[type="number"]:focus,
.wpcf7-form input[type="date"]:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.wpcf7-form input::placeholder {
    color: #9ca3af;
}

/* =============================================
   Textarea
   ============================================= */

.wpcf7-form textarea,
.wpcf7-form .wpcf7-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    font-family: inherit;
    color: #1f2937;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    min-height: 120px;
    resize: vertical;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.wpcf7-form textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.wpcf7-form textarea::placeholder {
    color: #9ca3af;
}

/* =============================================
   Select
   ============================================= */

.wpcf7-form select,
.wpcf7-form .wpcf7-select {
    width: 100%;
    padding: 10px 38px 10px 14px;
    font-size: 15px;
    font-family: inherit;
    color: #1f2937;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 14px center;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.wpcf7-form select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* =============================================
   Checkbox & Radio
   ============================================= */

.wpcf7-form .wpcf7-checkbox,
.wpcf7-form .wpcf7-radio {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wpcf7-form .wpcf7-checkbox .wpcf7-list-item,
.wpcf7-form .wpcf7-radio .wpcf7-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.wpcf7-form .wpcf7-checkbox .wpcf7-list-item label,
.wpcf7-form .wpcf7-radio .wpcf7-list-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    font-size: 15px;
    color: #1f2937;
    cursor: pointer;
    margin-bottom: 0;
}

.wpcf7-form input[type="checkbox"],
.wpcf7-form input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
    accent-color: #2563eb;
    cursor: pointer;
}

/* =============================================
   File upload
   ============================================= */

.wpcf7-form input[type="file"],
.wpcf7-form .wpcf7-file {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    color: #6b7280;
    background: #f9fafb;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s;
}

.wpcf7-form input[type="file"]:hover {
    border-color: #2563eb;
}

/* =============================================
   Acceptance (consentement)
   ============================================= */

.wpcf7-form .wpcf7-acceptance {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.wpcf7-form .wpcf7-acceptance .wpcf7-list-item label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.4;
    cursor: pointer;
    margin-bottom: 0;
}

.wpcf7-form .wpcf7-acceptance input[type="checkbox"] {
    margin-top: 2px;
}

/* =============================================
   Submit
   ============================================= */

.wpcf7-form input[type="submit"],
.wpcf7-form .wpcf7-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: #2563eb;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.wpcf7-form input[type="submit"]:hover {
    background: #1d4ed8;
}

.wpcf7-form input[type="submit"]:active {
    transform: scale(0.98);
}

/* =============================================
   Submit alignment
   ============================================= */

.leb-submit-center {
    text-align: center;
}

.leb-submit-right {
    padding-top: 8px;
}

.leb-submit-right > p {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-direction: row-reverse;
}

.leb-submit-full {
    display: flex;
}

.leb-submit-full .wpcf7-submit,
.leb-submit-full input[type="submit"] {
    width: 100%;
}

/* =============================================
   Success message (remplacement du form)
   ============================================= */

.leb-forms-success-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px 20px;
    text-align: center;
    animation: lebFadeIn 0.4s ease;
}

.leb-forms-success-icon {
    line-height: 0;
}

.leb-forms-success-text {
    font-size: 16px;
    font-weight: 500;
    color: #1f2937;
    line-height: 1.6;
    max-width: 480px;
}

@keyframes lebFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   Validation & messages
   ============================================= */

.wpcf7-form .wpcf7-not-valid {
    border-color: #ef4444;
}

.wpcf7-form .wpcf7-not-valid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.wpcf7-form .wpcf7-not-valid-tip {
    display: block;
    font-size: 13px;
    color: #ef4444;
    margin-top: 4px;
}

/* Base — reset CF7 + style erreur par défaut */
div.wpcf7 form .wpcf7-response-output {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 0;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    border: none;
    border-radius: 0;
    margin: 20px 0 0;
    background: none;
    box-shadow: none;
    color: #dc2626;
}

div.wpcf7 form .wpcf7-response-output::before {
    content: "";
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='15' y1='9' x2='9' y2='15'/%3E%3Cline x1='9' y1='9' x2='15' y2='15'/%3E%3C/svg%3E");
}

/* Succès */
div.wpcf7 form.sent .wpcf7-response-output {
    color: #059669;
}

div.wpcf7 form.sent .wpcf7-response-output::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E");
}

/* Validation / Warning */
div.wpcf7 form.invalid .wpcf7-response-output,
div.wpcf7 form.unaccepted .wpcf7-response-output,
div.wpcf7 form.payment-required .wpcf7-response-output {
    color: #d97706;
}

div.wpcf7 form.invalid .wpcf7-response-output::before,
div.wpcf7 form.unaccepted .wpcf7-response-output::before,
div.wpcf7 form.payment-required .wpcf7-response-output::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23d97706' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z'/%3E%3Cline x1='12' y1='9' x2='12' y2='13'/%3E%3Cline x1='12' y1='17' x2='12.01' y2='17'/%3E%3C/svg%3E");
}

/* Erreur */
div.wpcf7 form.failed .wpcf7-response-output,
div.wpcf7 form.aborted .wpcf7-response-output {
    color: #dc2626;
}

div.wpcf7 form.failed .wpcf7-response-output::before,
div.wpcf7 form.aborted .wpcf7-response-output::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='15' y1='9' x2='9' y2='15'/%3E%3Cline x1='9' y1='9' x2='15' y2='15'/%3E%3C/svg%3E");
}

/* Spam — même style que erreur, le client n'a pas à savoir la raison technique */
div.wpcf7 form.spam .wpcf7-response-output {
    color: #dc2626;
}

div.wpcf7 form.spam .wpcf7-response-output::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='15' y1='9' x2='9' y2='15'/%3E%3Cline x1='9' y1='9' x2='15' y2='15'/%3E%3C/svg%3E");
}

/* =============================================
   Spinner CF7
   ============================================= */

.wpcf7-form .wpcf7-spinner {
    margin-left: 12px;
}
