/* ===================================
   FORMULAIRE DE CONTACT - AUTO DIAGNOSTIC
   Version: 1.1 - Fix floating label background
   =================================== */


/* Header du formulaire */
.contact-header {
  text-align: center;
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 2px solid #e3e8ff;
  position: relative;
}

.contact-text h3 {
  margin: 0 0 16px 0;
  color: #1a1a1a;
  font-size: 28px !important;
  font-weight: 700;
  background: linear-gradient(135deg, #003399, #0066cc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.contact-text p {
  margin: 0 0 24px 0;
  color: #6b7280;
  font-size: 16px;
  line-height: 1.6;
}

/* Avantages du diagnostic */
.contact-benefits {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(0, 51, 153, 0.05);
  border-radius: 12px;
  font-size: 14px;
  color: #374151;
  transition: all 0.3s ease;
}

.benefit-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 51, 153, 0.1);
}

.benefit-icon {
  font-size: 16px;
  flex-shrink: 0;
}

/* Structure des sections */
.form-section {
  margin-bottom: 24px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 600;
  color: #003399;
  padding-bottom: 6px;
  margin-bottom: 60px;
  border-bottom: 1px solid #e3e8ff;
}

.section-icon {
  display: flex;
  align-items: center;
  color: #003399;
}

/* Grilles de formulaire */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

/* Section entreprise */
.form-section[data-section="entreprise"] .form-grid {
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Raison sociale sur ligne complète */
input[name="contact[raison_sociale]"] {
  grid-column: 1 / -1 !important;
}

/* Section adresse */
.form-section[data-section="adresse"] .form-grid {
  grid-template-columns: 1fr;
  gap: 16px;
}

/* Adresse complète sur ligne complète */
input[name="contact[adresse]"] {
  grid-column: 1 / -1 !important;
}

/* Code postal et ville sur la même ligne */
.form-section[data-section="adresse"] .form-grid {
  grid-template-columns: 1fr 1fr;
}

.form-section[data-section="adresse"] .form-group:first-child {
  grid-column: 1 / -1;
}

/* Section contact */
.form-section[data-section="contact"] .form-grid {
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Styles spécifiques pour l'auto-diagnostic */
.contact-section .form-group {
  margin-bottom: 0px;
}

.contact-section .form-group.form-group-half {
  display: inline-block;
  width: calc(50% - 12px);
  margin-right: 24px;
  vertical-align: top;
}

.contact-section .form-group.form-group-half:nth-child(even) {
  margin-right: 0;
}

/* FORCER les styles corrects pour l'auto-diagnostic (surcharger drag-drop-ranking.css) */
.contact-section .form-control,
.contact-section input[type="text"],
.contact-section input[type="email"],
.contact-section input[type="tel"],
.contact-section textarea {
  width: 100% !important;
  padding: 12px !important;
  border: 1px solid #e1e5e9 !important;
  border-radius: 12px !important;
  font-size: 14px !important;
  background-color: #ffffff !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-sizing: border-box !important;
  font-family: inherit !important;
  line-height: 1.5 !important;
}

.contact-section .form-control:focus {
  outline: none !important;
  border-color: #003399 !important;
  box-shadow: 0 0 0 4px rgba(0, 51, 153, 0.1) !important;
  transform: translateY(-1px) !important;
}

/* Email sur ligne complète */
input[name="contact[email]"] {
  grid-column: 1 / -1 !important;
}

/* Groupes de champs */
.form-group {
  position: relative;
}

.form-group-half {
  grid-column: span 1;
}

/* Conteneur des inputs */
.input-wrapper {
  position: relative;
  margin-bottom: 20px;
}

/* Styles des champs de saisie */
.form-control {
  width: 100%;
  padding: 16px 16px 16px 16px;
  border: 2px solid #e1e5e9;
  border-radius: 12px;
  font-size: 16px;
  background-color: #ffffff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  font-family: inherit;
  line-height: 1.5;
}

.form-control:focus {
  outline: none;
  border-color: #003399;
  box-shadow: 0 0 0 4px rgba(0, 51, 153, 0.1);
  transform: translateY(-1px);
}

/* États de validation des inputs */
.form-control.valid,
.form-control[style*="border-color: rgb(16, 185, 129)"] {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.form-control.invalid,
.form-control[style*="border-color: rgb(239, 68, 68)"] {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

/* Labels flottants */
.form-control:focus+.floating-label,
.form-control:not(:placeholder-shown)+.floating-label {
  transform: translateY(-13px) scale(0.85);
  color: #003399;
  background: white;
  padding: 0 6px;
  border-radius: 4px;
}

.floating-label {
  position: absolute;
  left: 1px;
  top: -18px;
  /* Position haute par défaut */
  color: #003399;
  /* Couleur active */
  font-size: 14px;
  /* Taille réduite */
  font-weight: 600;
  /* Poids plus fort */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  transform-origin: left center;
  z-index: 2;
  line-height: 1;
  background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
  padding: 0 6px;
  border-radius: 4px;
  transform: scale(0.85);
  /* Échelle réduite */
}

.required-indicator {
  color: #ef4444;
  font-weight: bold;
  margin-left: 4px;
}

/* Messages de validation */
.validation-message {
  margin-top: 8px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  min-height: 20px;
}

.validation-message.valid {
  color: #10b981;
}

.validation-message.invalid {
  color: #ef4444;
}

/* Animations d'entrée */
.form-group {
  animation: slideInUp 0.6s ease-out;
  animation-fill-mode: both;
}

.form-group:nth-child(1) {
  animation-delay: 0.1s;
}

.form-group:nth-child(2) {
  animation-delay: 0.2s;
}

.form-group:nth-child(3) {
  animation-delay: 0.3s;
}

.form-group:nth-child(4) {
  animation-delay: 0.4s;
}

.form-group:nth-child(5) {
  animation-delay: 0.5s;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Section de consentement */
.consent-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid #e3e8ff;
}

.consent-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.consent-checkbox input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  background-color: #ffffff;
  transition: all 0.3s ease;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
}

.consent-checkbox input[type="checkbox"]:checked+.consent-label .checkbox-custom {
  background-color: #003399;
  border-color: #003399;
  color: white;
}

.consent-checkbox input[type="checkbox"]:checked+.consent-label .checkbox-custom::after {
  content: "✓";
  font-size: 12px;
  font-weight: bold;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  line-height: 1.5;
  color: #374151;
}

.consent-text {
  flex: 1;
}

.consent-text strong {
  color: #1f2937;
  font-weight: 600;
}

.consent-text small {
  color: #6b7280;
  font-size: 13px;
  line-height: 1.4;
}

/* Responsive */
@media (max-width: 768px) {

  .contact-text h3 {
    font-size: 24px;
  }

  .form-section[data-section="adresse"] .form-grid,
  .form-section[data-section="contact"] .form-grid {
    grid-template-columns: 1fr;
  }

  .form-section[data-section="entreprise"] .form-grid {
    grid-template-columns: 1fr;
  }

  .benefit-item {
    flex-direction: column;
    text-align: center;
    padding: 16px 12px;
  }

  .section-title {
    font-size: 16px;
  }
}

@media (max-width: 480px) {

  .form-control {
    padding: 14px 12px;
    font-size: 16px;
    /* Évite le zoom sur iOS */
  }

  .floating-label {
    left: 12px;
    font-size: 14px;
  }

  .contact-benefits {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}