/* ============================================================
 * 09. CONTACT FORM 7 (CF7) — formulaires accessibles
 *     Hauteurs réduites : input ≈44px, textarea 96px, label compact
 * ============================================================ */
.wpcf7-form {
  font-family: var(--ff-body);
  color: var(--color-text);
  background: #fcfdfd;
  padding: 20px 24px; /* DIVERGENCE custom.css L354 = 30px 40px */
  border-radius: var(--radius-card);
  border: 1px solid var(--color-border-light);
  box-shadow: 0 5px 25px rgba(0,0,0,.07);
  margin-top: 20px;
  line-height: 1.3; /* DIVERGENCE custom.css = absent */
}
/* DIVERGENCE custom.css : 01-base.css impose `p { font-size: 20px }` global → cascaderait
 * dans .wpcf7-form (RGPD, hints, privacy) si non override. On ramène à 16px pour aligner
 * avec inputs/labels (cohérence visuelle + densité form). white-space: normal annule
 * `break-spaces` hérité de 01-base.css qui désactive le wrap propre des longs paragraphes. */
.wpcf7-form p {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.5;
  white-space: normal;
  font-family: var(--ff-light);
} /* RGPD long para = WCAG 1.4.12 */
.wpcf7-form .cf7-field { margin: 0 0 10px; } /* mutualise <p>/<div.cf7-field>, hauteur ~70-80px */
.wpcf7-form .cf7-field > p { margin: 0; } /* neutralise <p> interne au cf7-field si présent */
.wpcf7-form .cf7-field--file .cf7-field-help,
.wpcf7-form .cf7-field-help {
  font-size: 14px;
  color: var(--color-text-muted, #595959);
  margin: 4px 0 0;
  line-height: 1.4;
}
.wpcf7-form h3 {
  font-family: var(--ff-body) !important;
  color: var(--color-primary) !important;
  font-size: 24px; font-weight: 600;
  margin: 30px 0 25px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e8eeee;
  width: 100%;
}
.wpcf7-form h3:first-of-type { margin-top: 0; }
.wpcf7-form label {
  font-weight: 500;
  font-size: 16px;
  color: #1a1a1a !important; /* RGAA contraste */
  display: block;
  margin-bottom: 4px; /* compact, gain hauteur */
  line-height: 1.3;
}
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form input[type="number"],
.wpcf7-form input[type="url"],
.wpcf7-form textarea,
.wpcf7-form select {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-button);
  padding: 10px 14px; /* DIVERGENCE custom.css L398 = 14px 18px */
  min-height: var(--tap-target); /* RGAA 2.5.5 — custom.css = absent */
  line-height: 1.4; /* DIVERGENCE custom.css = absent */
  font-size: 16px;
  color: var(--color-text);
  width: 100%;
  box-shadow: var(--shadow-input);
  transition: border-color .3s ease, box-shadow .3s ease;
}
.wpcf7-form textarea {
  min-height: 96px; /* DIVERGENCE custom.css L407 = 150px */
  resize: vertical;
}
.wpcf7-form input:focus,
.wpcf7-form textarea:focus,
.wpcf7-form select:focus {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-color: var(--color-primary-hover);
  box-shadow: 0 0 0 3px rgba(0,107,113,.15);
}
.wpcf7-form-control-wrap[data-name="axe-intervention"] { position: relative; }
.wpcf7-form-control-wrap[data-name="axe-intervention"]::after {
  content: '\25BC';
  position: absolute;
  top: 50%; right: 18px;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--color-primary);
  font-size: 14px;
}
.wpcf7-form select { -webkit-appearance: none; -moz-appearance: none; appearance: none; }

.wpcf7-form input[type="file"] {
  font-family: var(--ff-body);
  width: 100%;
  color: #555;
  border: 2px dashed var(--color-border);
  background: var(--color-bg-light);
  border-radius: var(--radius-button);
  padding: 10px;
  transition: border-color .3s ease, background-color .3s ease;
}
.wpcf7-form input[type="file"]:hover {
  border-color: var(--color-primary);
  background: #fff;
}
.wpcf7-form input[type="file"]::file-selector-button {
  font-family: var(--ff-body);
  font-weight: 500;
  font-size: 15px;
  color: #fff;
  background: var(--gradient-primary);
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-right: 15px;
  transition: filter .25s ease;
}
.wpcf7-form input[type="file"]::file-selector-button:hover { filter: brightness(1.15); }

.wpcf7-form .wpcf7-list-item { margin: 0 0 10px; display: block; }
.wpcf7-form .wpcf7-list-item-label {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.wpcf7-form input[type="checkbox"],
.wpcf7-form input[type="radio"] { opacity: 0; position: absolute; }
.wpcf7-form input[type="checkbox"] + .wpcf7-list-item-label::before,
.wpcf7-form input[type="radio"] + .wpcf7-list-item-label::before {
  content: '';
  width: 20px; height: 20px;
  border: 2px solid var(--color-border);
  border-radius: 4px;
  background: #fff;
  margin-right: 12px;
  transition: all .2s ease;
}
.wpcf7-form input[type="radio"] + .wpcf7-list-item-label::before { border-radius: 50%; }
.wpcf7-form input[type="checkbox"]:checked + .wpcf7-list-item-label::before {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23fff' d='M6.564.75l-3.59 3.6-1.5-1.5-.707.707 2.207 2.207 4.293-4.293z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: center;
}
.wpcf7-form input[type="radio"]:checked + .wpcf7-list-item-label::before {
  background: #fff;
  border-color: var(--color-primary);
  box-shadow: inset 0 0 0 4px var(--color-primary);
}

.wpcf7-form .wpcf7-submit {
  display: inline-block;
  width: auto;
  font-family: var(--ff-body);
  font-size: 18px; font-weight: 600;
  text-transform: uppercase;
  color: #fff !important;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-button);
  padding: 15px 35px;
  cursor: pointer;
  transition: all .3s cubic-bezier(.25,.8,.25,1);
  box-shadow: 0 4px 15px rgba(0,115,122,.2);
}
.wpcf7-form .wpcf7-submit:hover,
.wpcf7-form .wpcf7-submit:focus-visible {
  filter: brightness(1.15);
  box-shadow: 0 8px 20px rgba(0,115,122,.3);
}
.wpcf7-form .wpcf7-submit:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,115,122,.2);
}

.wpcf7-form p, .wpcf7-form small {
  font-size: 17px;
  color: #505050;
  line-height: 1.45; /* WCAG 1.4.12 — bloc RGPD long lisible */
}
.wpcf7-form .cf7-privacy {
  font-size: 14px;
  line-height: 1.5;
  color: #505050;
  margin: 12px 0 16px;
  padding: 10px 14px;
  background: #f7f9f9;
  border-left: 3px solid var(--color-primary);
  border-radius: 4px;
}
.wpcf7-form p a {
  color: var(--color-primary-hover);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .2s;
}
.wpcf7-form p a:hover { color: var(--color-primary-dark); }
.wpcf7-form .wpcf7-captchac {
  border-radius: var(--radius-button);
  margin-right: 10px;
  vertical-align: middle;
  width: 80px;
}
.wpcf7-form input[name="captcha-1"] { width: auto; vertical-align: middle; }

/* custom.css L990-992 */
.wpcf7-form input::placeholder,
.wpcf7-form textarea::placeholder,
.forminator-input::placeholder { color: var(--color-text-muted) !important; }

/* === CF7 erreurs / succès === */
.wpcf7-form .wpcf7-not-valid-tip {
  color: #cf2e2e;
  font-weight: 500;
  margin-top: 5px;
}
.wpcf7-not-valid-tip {
  font-family: var(--ff-body);
  font-size: 15px; font-weight: 500;
  color: #dc3545;
  background: #fff5f5;
  border: 1px solid #fecaca;
  border-radius: 6px;
  padding: 8px 12px;
  margin-top: 6px;
  display: block;
  position: relative;
  box-shadow: 0 2px 4px rgba(220,53,69,.1);
  transition: all .3s ease;
}
.wpcf7-not-valid-tip:before {
  content: "⚠";
  margin-right: 6px;
  font-weight: bold;
}
.wpcf7-form .wpcf7-response-output {
  margin: 20px 0 0;
  padding: 15px 20px;
  border-radius: var(--radius-button);
  font-size: 15px;
}
.wpcf7-response-output {
  font-family: var(--ff-body);
  font-size: 16px; font-weight: 600;
  color: #dc3545;
  background: linear-gradient(135deg, #fff5f5 0%, #fef2f2 100%);
  border: 2px solid #dc3545;
  border-radius: var(--radius-card);
  padding: 16px 20px;
  margin: 20px 0;
  position: relative;
  box-shadow: 0 4px 12px rgba(220,53,69,.15);
  animation: shake .5s ease-in-out;
}
.wpcf7-mail-sent-ok {
  font-family: var(--ff-body);
  font-size: 16px; font-weight: 600;
  color: #28a745;
  background: linear-gradient(135deg, #f0f9f4 0%, #f7fef9 100%);
  border: 2px solid #28a745;
  border-radius: var(--radius-card);
  padding: 16px 20px;
  margin: 20px 0;
  box-shadow: 0 4px 12px rgba(40,167,69,.15);
}
.wpcf7-mail-sent-ok:before {
  content: "✅";
  margin-right: 8px;
  font-size: 18px;
}
.wpcf7-form-control.wpcf7-not-valid {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 3px rgba(220,53,69,.1) !important;
  background-color: #fff8f8;
}
.wpcf7-form-control.wpcf7-not-valid:focus {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 4px rgba(220,53,69,.2) !important;
  outline: 3px solid #b00020 !important;
  outline-offset: 2px !important;
}
.wpcf7 .screen-reader-response {
  position: absolute; left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}
.wpcf7-form.invalid .wpcf7-response-output,
div.wpcf7-validation-errors { border: 2px solid #ffb900; }
.wpcf7-form.sent .wpcf7-response-output,
div.wpcf7-mail-sent-ok { border: 2px solid #00d084; }
.wpcf7-checkbox.wpcf7-not-valid,
.wpcf7-radio.wpcf7-not-valid {
  padding: 8px;
  border: 1px solid #dc3545;
  border-radius: 6px;
  background: #fff8f8;
}
.wpcf7-file.wpcf7-not-valid {
  border: 2px dashed #dc3545 !important;
  background: #fff8f8;
}
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.payment-required .wpcf7-response-output { border-color: #fecaca; }
.wpcf7 form.sent .wpcf7-response-output {
  border-color: #46b450;
  background: #00d0841a;
  color: #505050;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* === A11y messages CF7 (ex-inline alone_child_a11y_cf7_css) === */
.cf7-accessible .wpcf7-not-valid-tip { color: #b00020 !important; font-weight: 600; display: block; margin-top: 4px; }
.cf7-accessible .wpcf7-not-valid { border: 2px solid #b00020 !important; }
.cf7-accessible .wpcf7-response-output { padding: 12px 16px; border-width: 2px !important; border-style: solid; }
.cf7-accessible .wpcf7-response-output.wpcf7-mail-sent-ok { border-color: #0a6e2e; background-color: #e8f5ec; color: #0a6e2e; }
.cf7-accessible .wpcf7-response-output.wpcf7-validation-errors,
.cf7-accessible .wpcf7-response-output.wpcf7-mail-sent-ng { border-color: #b00020; background-color: #fbeaec; color: #b00020; }
.cf7-captcha-wrapper { margin: 16px 0; padding: 12px; border: 1px solid #ccc; border-radius: 4px; background: #f7f9f9; }
.cf7-captcha-help { font-size: 0.875em; color: #595959; margin: 4px 0 8px; }
.cf7-captcha-img { display: block; margin: 8px 0; }
.cf7-captcha-input { max-width: 160px; }

/* === Honeypot defense in depth ===
   Si un bot remplit malgré le CSS inline, le wrapper aria-hidden+style
   fait partie du DOM. Les leurres ne doivent jamais être visibles ni focusables. */
.wpcf7-form [aria-hidden="true"][tabindex="-1"] { display: none !important; }

/* ============================================================
 * Formulaire dépôt de projet — sections fieldset + conditionnels
 * ============================================================ */

/* Notice champs obligatoires (RGAA 11.7) */
.wpcf7-form .cf7-required-notice {
  font-size: 14px;
  color: #505050;
  margin: 0 0 20px;
  text-align: right;
  font-style: italic;
}
.wpcf7-form .cf7-required-notice .required {
  color: #b00020;
  font-weight: 700;
  font-style: normal;
}

/* Hint inline dans label (RGAA 11.9) */
.wpcf7-form .cf7-hint-inline {
  font-weight: 400;
  font-size: 14px;
  color: #595959;
  font-style: italic;
}

/* Asterisk visible required */
.wpcf7-form label .required,
.wpcf7-form legend .required {
  color: #b00020;
  font-weight: 700;
  margin: 0 2px;
}

/* Sections fieldset */
.wpcf7-form .cf7-section {
  border: none;
  padding: 0;
  margin: 0 0 32px;
}
.wpcf7-form .cf7-section-title {
  display: block;
  font-family: var(--ff-body);
  font-size: 20px;
  font-weight: 600;
  color: var(--color-primary);
  width: 100%;
  padding-bottom: 10px;
  border-bottom: 2px solid #e8eeee;
  margin-bottom: 20px;
}

/* Fieldset radio/checkbox (RGAA 11.5) — reset navigateur, legend comme label */
.wpcf7-form fieldset.cf7-field {
  border: none;
  padding: 0;
  margin: 0 0 10px;
  min-width: 0; /* fix Chrome fieldset overflow */
}
.wpcf7-form .cf7-legend {
  display: block;
  font-weight: 500;
  font-size: 16px;
  color: #1a1a1a;
  margin-bottom: 8px;
  line-height: 1.3;
  width: 100%;
  padding: 0;
}

/* Label de groupe fallback (si pas fieldset) */
.wpcf7-form .cf7-group-label {
  display: block;
  font-weight: 500;
  font-size: 16px;
  color: #1a1a1a;
  margin-bottom: 8px;
  line-height: 1.3;
}

/* Hint sous label ou au-dessus du champ */
.wpcf7-form .cf7-field-hint {
  font-size: 14px;
  color: var(--color-text-muted, #595959);
  margin: 0 0 6px;
  line-height: 1.4;
}
.wpcf7-form .cf7-files-hint {
  background: #f0f7f7;
  border-left: 3px solid var(--color-primary);
  padding: 8px 12px;
  border-radius: 4px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.45;
  color: #404040;
}

/* Champs conditionnels — cachés par défaut, révélés par JS */
.wpcf7-form .cf7-field--conditional {
  display: none;
  overflow: hidden;
}
.wpcf7-form .cf7-field--conditional.cf7-visible {
  display: block;
  animation: cf7FadeIn .2s ease;
}
@keyframes cf7FadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Radio / checkbox groupés */
.wpcf7-form .cf7-field--radio .wpcf7-list-item,
.wpcf7-form .cf7-field--checkbox .wpcf7-list-item {
  margin: 0 0 6px;
}

/* Responsive — fieldset stacked mobile */
@media (max-width: 600px) {
  .wpcf7-form .cf7-section { margin-bottom: 24px; }
  .wpcf7-form input[type="number"],
  .wpcf7-form input[type="tel"] { max-width: 100%; }
}
