/**
 * Styles pour Contact Form 7
 * Compatible avec le thème DoliSmart
 *
 * @package DoliSmart
 */

/* ========================================
   STYLES GÉNÉRAUX CONTACT FORM 7
   ======================================== */

.wpcf7-form {
  max-width: 100%;
  margin: 0;
  padding: 0;
}

.wpcf7-form p {
  margin-bottom: 10px;
}

/* SUPPRESSION TOTALE DE L'ESPACEMENT POUR LES CHECKBOXES */
.wpcf7-form p:has(input[type="checkbox"]),
.wpcf7-form p:has(input[type="radio"]) {
  margin: 0 !important;
  padding: 0 !important;
}

/* Suppression de l'espacement pour les paragraphes contenant des checkboxes */
.wpcf7-form p:has(.wpcf7-checkbox),
.wpcf7-form p:has(.wpcf7-radio) {
  margin: 0 !important;
  padding: 0 !important;
}

.wpcf7-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #333;
  font-size: 12px;
}

.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 textarea,
.wpcf7-form select {
  width: 100%;
  padding: 6px 10px;
  border: 2px solid #e1e5e9;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.4;
  color: #333;
  background-color: #fff;
  transition: all 0.3s ease;
  box-sizing: border-box;
}

.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 textarea:focus,
.wpcf7-form select:focus {
  outline: none;
  border-color: #0073aa;
  box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.wpcf7-form textarea {
  min-height: 60px !important;
  height: 60px !important;
  resize: vertical;
}

.wpcf7-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;
  appearance: none;
}

/* ========================================
   BOUTON D'ENVOI - STYLE COHÉRENT
   ======================================== */

.wpcf7-form input[type="submit"],
.wpcf7-form .wpcf7-submit {
  background: #0073aa;
  color: #fff;
  padding: 6px 10px;
  border: 2px solid #0073aa;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: none;
  letter-spacing: 0.5px;
  width: 100%;
  display: block;
  text-align: center;
  line-height: 1.4;
  margin-top: 20px !important;
  margin-bottom: 0 !important;
}

.wpcf7-form input[type="submit"]:hover,
.wpcf7-form .wpcf7-submit:hover {
  background: #005a87;
  border-color: #005a87;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.wpcf7-form input[type="submit"]:active,
.wpcf7-form .wpcf7-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 115, 170, 0.3);
}

/* ========================================
   CHECKBOXES ET RADIOS - SUPPRESSION TOTALE D'ESPACEMENT
   ======================================== */

.wpcf7-form input[type="checkbox"],
.wpcf7-form input[type="radio"] {
  margin: 0 !important;
  padding: 0 !important;
  width: 18px;
  height: 18px;
  accent-color: #0073aa;
}

.wpcf7-form input[type="checkbox"] + label,
.wpcf7-form input[type="radio"] + label {
  display: inline-block;
  font-weight: 500;
  margin: 0 !important;
  padding: 0 !important;
  cursor: pointer;
}

/* SUPPRESSION TOTALE DE L'ESPACEMENT POUR TOUS LES ÉLÉMENTS DE CHECKBOXES */
.wpcf7-form .wpcf7-list-item {
  margin: 0 !important;
  padding: 0 !important;
}

.wpcf7-form .wpcf7-list-item:last-child {
  margin: 0 !important;
  padding: 0 !important;
}

.wpcf7-form .wpcf7-checkbox,
.wpcf7-form .wpcf7-radio {
  margin: 0 !important;
  padding: 0 !important;
}

/* Suppression de l'espacement pour les paragraphes contenant des checkboxes */
.wpcf7-form p:has(.wpcf7-checkbox),
.wpcf7-form p:has(.wpcf7-radio) {
  margin: 0 !important;
  padding: 0 !important;
}

.wpcf7-form p:has(input[type="checkbox"]),
.wpcf7-form p:has(input[type="radio"]) {
  margin: 0 !important;
  padding: 0 !important;
}

.wpcf7-form label {
  margin: 0 !important;
  padding: 0 !important;
}

/* ========================================
   MESSAGES D'ERREUR ET SUCCÈS
   ======================================== */

.wpcf7-response-output {
  margin: 20px 0;
  padding: 15px 20px;
  border-radius: 6px;
  font-weight: 500;
  border: none;
}

.wpcf7-mail-sent-ok {
  background-color: #d4edda;
  color: #155724;
  border-left: 4px solid #28a745;
}

.wpcf7-validation-errors {
  background-color: #f8d7da;
  color: #721c24;
  border-left: 4px solid #dc3545;
}

.wpcf7-spam-blocked {
  background-color: #fff3cd;
  color: #856404;
  border-left: 4px solid #ffc107;
}

.wpcf7-not-valid-tip {
  color: #dc3545;
  font-size: 13px;
  margin-top: 5px;
  display: block;
}

.wpcf7-not-valid {
  border-color: #dc3545 !important;
}

.wpcf7-not-valid:focus {
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

/* ========================================
   LOADER/SPINNER
   ======================================== */

.wpcf7-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #0073aa;
  border-radius: 50%;
  animation: wpcf7-spin 1s linear infinite;
  margin-left: 10px;
  vertical-align: middle;
}

@keyframes wpcf7-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ========================================
   LAYOUT RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
  .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 textarea,
  .wpcf7-form select {
    font-size: 16px;
  }

  .wpcf7-form input[type="submit"],
  .wpcf7-form .wpcf7-submit {
    width: 100%;
    padding: 16px 20px;
  }
}

/* ========================================
   STYLES SPÉCIFIQUES AU TEMPLATE CONTACT
   ======================================== */

/* Suppression du conteneur avec padding du formulaire */
.contact-form .wpcf7-form {
  background: none;
  padding: 0;
  border: none;
  border-radius: 0;
  width: 100%;
  max-width: none;
  margin: 0;
}

.contact-form .wpcf7-form p {
  margin-bottom: 10px;
}

.contact-form .wpcf7-form p:last-of-type {
  margin-bottom: 0;
}

/* Style cohérent pour les deux sections */
.contact-form,
.contact-info {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  height: fit-content;
}

/* Amélioration de la largeur pour les colonnes */
.contact-content .wp-block-columns {
  gap: 20px;
  align-items: stretch;
}

.contact-content .wp-block-column {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.contact-content .wp-block-column > * {
  height: 100%;
}

/* Responsive pour les colonnes */
@media (max-width: 768px) {
  .contact-content .wp-block-columns {
    flex-direction: column;
    gap: 30px;
  }

  .contact-content .wp-block-column {
    flex: none;
    width: 100%;
  }
}

/* ========================================
   STYLES POUR LES INFORMATIONS DE CONTACT
   ======================================== */

/* Espacement réduit entre les éléments */
.contact-info .contact-item {
  margin-bottom: 12px;
  gap: 8px;
}

.contact-info .contact-item:last-child {
  margin-bottom: 0;
}

/* ========================================
   ANIMATIONS ET TRANSITIONS
   ======================================== */

.wpcf7-form input,
.wpcf7-form textarea,
.wpcf7-form select {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.wpcf7-form input[type="submit"],
.wpcf7-form .wpcf7-submit {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   ACCESSIBILITÉ
   ======================================== */

.wpcf7-form input:focus,
.wpcf7-form textarea:focus,
.wpcf7-form select:focus {
  outline: 2px solid #0073aa;
  outline-offset: 2px;
}

.wpcf7-form input[type="submit"]:focus,
.wpcf7-form .wpcf7-submit:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ========================================
   STYLES POUR LES CHAMPS REQUIS
   ======================================== */

.wpcf7-form .wpcf7-form-control-wrap {
  position: relative;
  display: block;
}

.wpcf7-form .wpcf7-form-control-wrap::after {
  content: " *";
  color: #dc3545;
  font-weight: bold;
}

.wpcf7-form .wpcf7-form-control-wrap:not(.wpcf7-validates-as-required)::after {
  display: none;
}

/* ========================================
   STYLES POUR LES MESSAGES DE VALIDATION
   ======================================== */

.wpcf7-form .wpcf7-response-output {
  margin-top: 20px;
  margin-bottom: 0;
}

.wpcf7-form .wpcf7-not-valid-tip {
  margin-top: 5px;
  font-size: 13px;
  color: #dc3545;
}

/* ========================================
   STYLES POUR LES CHECKBOXES AVEC LABEL
   ======================================== */

.wpcf7-form .wpcf7-checkbox,
.wpcf7-form .wpcf7-radio {
  margin-bottom: 0 !important;
}

.wpcf7-form .wpcf7-checkbox .wpcf7-list-item,
.wpcf7-form .wpcf7-radio .wpcf7-list-item {
  margin-bottom: 0 !important;
}

.wpcf7-form .wpcf7-checkbox .wpcf7-list-item label,
.wpcf7-form .wpcf7-radio .wpcf7-list-item label {
  display: flex;
  align-items: center;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 0 !important;
}

.wpcf7-form .wpcf7-checkbox .wpcf7-list-item input,
.wpcf7-form .wpcf7-radio .wpcf7-list-item input {
  margin-right: 10px;
  margin-bottom: 0 !important;
}

/* ========================================
   STYLES POUR LES MESSAGES DE SUCCÈS
   ======================================== */

.wpcf7-form .wpcf7-mail-sent-ok {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  color: #155724;
  border-left: 4px solid #28a745;
  padding: 15px 20px;
  border-radius: 6px;
  margin: 20px 0;
}

.wpcf7-form .wpcf7-mail-sent-ok::before {
  content: "✓ ";
  font-weight: bold;
  color: #28a745;
}

/* ========================================
   STYLES POUR LES MESSAGES D'ERREUR
   ======================================== */

.wpcf7-form .wpcf7-validation-errors {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  color: #721c24;
  border-left: 4px solid #dc3545;
  padding: 15px 20px;
  border-radius: 6px;
  margin: 20px 0;
}

.wpcf7-form .wpcf7-validation-errors::before {
  content: "⚠ ";
  font-weight: bold;
  color: #dc3545;
}
