/*
 * alicog-cf7.css — CF7 stylé ALICOG
 * Chargé sur pages contact uniquement via functions.php
 * NovaSiteWeb · 2026
 */

/* ── Reset base CF7 ───────────────────────────────────────── */
.wpcf7 { margin: 0; }
.wpcf7 form { display: flex; flex-direction: column; gap: 14px; }

/* ── Labels ───────────────────────────────────────────────── */
.wpcf7 label,
.wpcf7 .wpcf7-form-control-wrap {
  display: block;
  width: 100%;
}
.wpcf7 label > span:first-child,
.wpcf7 .alicog-label {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--c-text-soft);
  margin-bottom: 6px;
}

/* ── Inputs, selects, textareas ───────────────────────────── */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="url"],
.wpcf7 input[type="number"],
.wpcf7 select,
.wpcf7 textarea {
  width: 100%;
  font-family: 'Montserrat', sans-serif;
  font-size: .88rem;
  color: var(--c-text);
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 3px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .2s, background .2s, box-shadow .2s;
  -webkit-appearance: none;
  appearance: none;
  line-height: 1.5;
}

.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 select:focus,
.wpcf7 textarea:focus {
  border-color: #1B72BE;
  background: var(--c-bg-soft);
  box-shadow: 0 0 0 3px rgba(27, 114, 190, .12);
}

.wpcf7 input::placeholder,
.wpcf7 textarea::placeholder {
  color: var(--c-text-soft);
  font-weight: 300;
}

/* ── Textarea ─────────────────────────────────────────────── */
.wpcf7 textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.65;
}

/* ── Select ───────────────────────────────────────────────── */
.wpcf7 select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A8070' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ── Grille 2 colonnes sur tablette ──────────────────────── */
.wpcf7 .alicog-row-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 640px) {
  .wpcf7 .alicog-row-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Bouton submit ────────────────────────────────────────── */
.wpcf7 input[type="submit"],
.wpcf7 .wpcf7-submit {
  width: 100%;
  font-family: 'Montserrat', sans-serif;
  font-size: .9rem;
  font-weight: 700;
  color: var(--c-text-inv);
  background: #1B72BE;
  border: none;
  border-radius: 3px;
  padding: 14px 24px;
  cursor: pointer;
  transition: all .2s;
  letter-spacing: .02em;
  margin-top: 4px;
}

.wpcf7 input[type="submit"]:hover,
.wpcf7 .wpcf7-submit:hover {
  background: #0D4A8A;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(27, 114, 190, .25);
}

.wpcf7 input[type="submit"]:active {
  transform: translateY(0);
}

/* ── État loading (AJAX) ──────────────────────────────────── */
.wpcf7 .wpcf7-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: #1B72BE;
  border-radius: 50%;
  animation: cf7-spin .7s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}

@keyframes cf7-spin {
  to { transform: rotate(360deg); }
}

/* ── Messages de validation ───────────────────────────────── */

/* Erreur champ */
.wpcf7 span.wpcf7-not-valid-tip {
  display: block;
  font-family: 'Montserrat', sans-serif;
  font-size: .72rem;
  font-weight: 500;
  color: #E74C3C;
  margin-top: 5px;
  padding-left: 2px;
}

/* Champ en erreur */
.wpcf7 .wpcf7-not-valid input,
.wpcf7 .wpcf7-not-valid textarea,
.wpcf7 .wpcf7-not-valid select {
  border-color: #E74C3C;
  background: #FFF8F7;
}

/* Message succès global */
.wpcf7 .wpcf7-response-output {
  border: none;
  border-radius: 4px;
  padding: 14px 16px;
  font-family: 'Montserrat', sans-serif;
  font-size: .84rem;
  font-weight: 500;
  margin-top: 8px;
  line-height: 1.5;
}

.wpcf7 .wpcf7-mail-sent-ok {
  background: rgba(27, 114, 190, .08);
  border-left: 3px solid #1B72BE;
  color: #1A6A50;
}

.wpcf7 .wpcf7-mail-sent-ok::before {
  content: '✓ ';
  font-weight: 700;
  color: #1B72BE;
}

/* Message erreur global */
.wpcf7 .wpcf7-validation-errors,
.wpcf7 .wpcf7-acceptance-missing {
  background: rgba(231, 76, 60, .06);
  border-left: 3px solid #E74C3C;
  color: #C0392B;
}

/* Message spam */
.wpcf7 .wpcf7-spam-blocked {
  background: rgba(27, 114, 190, .08);
  border-left: 3px solid #1B72BE;
  color: #8A5E10;
}

/* ── Checkbox / Radio ─────────────────────────────────────── */
.wpcf7 input[type="checkbox"],
.wpcf7 input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: #1B72BE;
  cursor: pointer;
  flex-shrink: 0;
}

.wpcf7 .wpcf7-list-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-family: 'Montserrat', sans-serif;
  font-size: .85rem;
  color: var(--c-text-muted);
  cursor: pointer;
}

.wpcf7 .wpcf7-list-item label {
  cursor: pointer;
  font-size: .85rem;
  color: var(--c-text-muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 0;
}

/* ── Acceptance (RGPD) ────────────────────────────────────── */
.wpcf7 .wpcf7-acceptance {
  background: rgba(27, 114, 190, .04);
  border: 1px solid rgba(27, 114, 190, .15);
  border-radius: 3px;
  padding: 12px 14px;
}

.wpcf7 .wpcf7-acceptance .wpcf7-list-item {
  margin: 0;
}

.wpcf7 .wpcf7-acceptance .wpcf7-list-item label {
  font-size: .78rem;
  line-height: 1.55;
  color: var(--c-text-soft);
}

.wpcf7 .wpcf7-acceptance .wpcf7-list-item label a {
  color: #1B72BE;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── File upload ──────────────────────────────────────────── */
.wpcf7 input[type="file"] {
  font-family: 'Montserrat', sans-serif;
  font-size: .82rem;
  color: var(--c-text-muted);
  border: 1px dashed var(--c-border-soft);
  border-radius: 3px;
  padding: 12px;
  width: 100%;
  cursor: pointer;
  background: var(--c-bg-soft);
  transition: border-color .2s;
}

.wpcf7 input[type="file"]:hover {
  border-color: #1B72BE;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (min-width: 640px) {
  .wpcf7 input[type="submit"],
  .wpcf7 .wpcf7-submit {
    width: auto;
    min-width: 220px;
  }
}

/* ── Champs cachés CF7 — toujours invisibles ── */
.wpcf7 input[type="hidden"],
.wpcf7 .wpcf7-hidden,
.wpcf7 span[style*="display:none"],
.wpcf7 p:empty,
.wpcf7 .wpcf7-form-control-wrap[style*="display:none"] {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}
/* Masquer les paragraphes vides générés par CF7 */
.wpcf7 p:has(> input[type="hidden"]) {
  display: none !important;
}

/* ── Masquer TOUT champ caché CF7 — version renforcée ── */
.cnt-form-card .wpcf7-form > p:first-child:has(input[type="text"][style]),
.cnt-form-card .wpcf7-form > p:first-child:empty,
.cnt-form-card .wpcf7 p:has(> .wpcf7-form-control-wrap > input[tabindex="-1"]),
.cnt-form-card .wpcf7 .wpcf7-form-control[tabindex="-1"],
.cnt-form-card .wpcf7 input[tabindex="-1"],
.cnt-form-card .wpcf7 input[aria-hidden="true"],
.wpcf7 .wpcf7-quiz-label,
.wpcf7 input.wpcf7-quiz,
/* Premier champ si pas de label visible au-dessus */
.cnt-form-card .wpcf7-form > p:first-of-type:not(:has(label)) {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
