/* === CORRECTIONS MOBILE FORMULAIRE ESTIMATION === */

/* Correction des problèmes de padding et de couleur sur mobile */
@media (max-width: 768px) {
  
  /* === CONTAINER PRINCIPAL === */
  .page-estimer .estimation-form-container {
    padding: 20px 16px;
    margin-top: 1rem;
    /* Suppression de l'aspect carte */
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    /* Amélioration du scroll */
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
  }
  
  /* === GROUPES DE FORMULAIRES === */
  .page-estimer .form-group {
    margin-bottom: 20px;
  }
  
  .page-estimer .form-group label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    display: block;
  }
  
  /* === CHAMPS DE SAISIE === */
  .page-estimer .form-group input,
  .page-estimer .form-group select,
  .page-estimer .form-group textarea {
    width: 100%;
    font-size: 16px; /* Évite le zoom automatique iOS */
    padding: 14px 16px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    background-color: #ffffff;
    color: #333;
    box-sizing: border-box;
    transition: all 0.3s ease;
    /* Suppression de l'aspect carte */
    box-shadow: none;
  }
  
  /* === CORRECTION DES SELECTS === */
  .page-estimer .form-group select {
    /* Supprimer la couleur bleue par défaut */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 48px;
  }
  
  /* === CORRECTION DES TEXTAREAS === */
  .page-estimer .form-group textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
  }
  
  /* === ÉTATS DE FOCUS === */
  .page-estimer .form-group input:focus,
  .page-estimer .form-group select:focus,
  .page-estimer .form-group textarea:focus {
    outline: none;
    border-color: #F9A312;
    box-shadow: 0 0 0 3px rgba(249, 163, 18, 0.1);
    transform: translateY(-1px);
  }
  
  /* === ÉTATS DE HOVER === */
  .page-estimer .form-group input:hover,
  .page-estimer .form-group select:hover,
  .page-estimer .form-group textarea:hover {
    border-color: #9ca3af;
  }
  
  /* === PLACEHOLDERS === */
  .page-estimer .form-group input::placeholder,
  .page-estimer .form-group textarea::placeholder {
    color: #9ca3af;
    opacity: 1;
  }
  
  /* === GESTION DES ERREURS === */
  .page-estimer .form-group input.error,
  .page-estimer .form-group select.error,
  .page-estimer .form-group textarea.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
  }
  
  .page-estimer .field-error {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 6px;
    display: block;
  }
  
  /* === RANGÉES DE FORMULAIRES === */
  .page-estimer .form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
  }
  
  /* === TITRES D'ÉTAPES === */
  .page-estimer .form-step h4 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: #333;
    text-align: center;
  }
  
  /* === PROGRESSION === */
  .page-estimer .form-progress {
    margin: 1.5rem 0;
    padding: 1rem 0;
  }
  
  /* === NAVIGATION === */
  .page-estimer .form-navigation {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 1rem 16px;
    margin-top: 2rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  }
  
  .page-estimer .form-navigation .btn {
    flex: 1;
    justify-content: center;
    padding: 14px 20px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
  }
  
  .page-estimer .form-navigation .btn.btn-primary {
    background: #F9A312;
    color: white;
  }
  
  .page-estimer .form-navigation .btn.btn-secondary {
    background: #6b7280;
    color: white;
  }
  
  .page-estimer .form-navigation .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }
  
  /* === ESPACEMENT GÉNÉRAL === */
  .page-estimer .form-step {
    padding: 0;
    margin-bottom: 2rem;
  }
  
  /* === RESPONSIVE SUPPLÉMENTAIRE === */
  @media (max-width: 480px) {
    .page-estimer .estimation-form-container {
      padding: 16px 12px;
    }
    
    .page-estimer .form-group input,
    .page-estimer .form-group select,
    .page-estimer .form-group textarea {
      padding: 12px 14px;
      font-size: 16px;
    }
    
    .page-estimer .form-navigation {
      padding: 1rem 12px;
    }
    
    .page-estimer .form-navigation .btn {
      padding: 12px 16px;
      font-size: 0.95rem;
    }
  }
}

/* === CORRECTIONS SPÉCIFIQUES POUR LES SELECTS === */
.page-estimer .form-group select option {
  background-color: #ffffff;
  color: #333;
  padding: 8px 12px;
}

/* === CORRECTIONS POUR LES CHECKBOXES ET RADIOS === */
.page-estimer .form-group input[type="checkbox"],
.page-estimer .form-group input[type="radio"] {
  width: auto;
  margin-right: 8px;
}

.page-estimer .form-group input[type="checkbox"] + label,
.page-estimer .form-group input[type="radio"] + label {
  display: inline;
  margin-left: 8px;
}

/* === CORRECTIONS POUR LES FIELDSETS === */
.page-estimer .form-group fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

.page-estimer .form-group legend {
  font-size: 0.95rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 12px;
  padding: 0;
}

/* === SUPPRESSION GÉNÉRALE DE L'ASPECT CARTE === */
.page-estimer .estimation-form-container {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.page-estimer .form-step {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

.page-estimer .form-group {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* === STYLE ÉPURÉ POUR LES CHAMPS === */
.page-estimer .form-group input,
.page-estimer .form-group select,
.page-estimer .form-group textarea {
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: none;
  transition: all 0.3s ease;
}

.page-estimer .form-group input:focus,
.page-estimer .form-group select:focus,
.page-estimer .form-group textarea:focus {
  border-color: #F9A312;
  box-shadow: 0 0 0 3px rgba(249, 163, 18, 0.1);
  transform: translateY(-1px);
}

/* === SUPPRESSION DES OMBRES SUR LES BOUTONS === */
.page-estimer .form-navigation .btn {
  box-shadow: none;
  border: 2px solid transparent;
}

.page-estimer .form-navigation .btn:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* === SUPPRESSION DES EFFETS DE CARTE SUR LA PROGRESSION === */
.page-estimer .form-progress {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

/* === AMÉLIORATIONS DU SCROLL ET DU CENTRAGE === */
.page-estimer .estimation-form-container {
  scroll-behavior: smooth;
  scroll-padding-top: 120px; /* Espace pour le header */
}

.page-estimer .form-step {
  scroll-margin-top: 120px; /* Marge de scroll pour centrer */
  scroll-margin-bottom: 100px; /* Marge pour la navigation sticky */
}

/* === ANIMATIONS DE TRANSITION ENTRE ÉTAPES === */
.page-estimer .form-step {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.page-estimer .form-step.active {
  opacity: 1;
  transform: translateY(0);
}

.page-estimer .form-step:not(.active) {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

/* === INDICATEUR VISUEL POUR LE CENTRAGE === */
.page-estimer .form-step.active::before {
  content: '';
  display: block;
  height: 120px; /* Espace pour le header */
  margin-top: -120px;
  visibility: hidden;
}

/* === OPTIMISATIONS MOBILE SUPPLÉMENTAIRES === */
@media (max-width: 768px) {
  .page-estimer .estimation-form-container {
    scroll-padding-top: 100px;
  }
  
  .page-estimer .form-step {
    scroll-margin-top: 100px;
    scroll-margin-bottom: 80px;
  }
  
  .page-estimer .form-step.active::before {
    height: 100px;
    margin-top: -100px;
  }
  
  /* === SCROLL AUTOMATIQUE LORS DU CHANGEMENT D'ÉTAPE === */
  .page-estimer .form-step.active {
    animation: stepFocus 0.5s ease-out;
  }
  
  @keyframes stepFocus {
    0% {
      opacity: 0;
      transform: translateY(20px);
    }
    100% {
      opacity: 1;
      transform: translateY(0);
    }
  }
}

/* === TRÈS PETIT MOBILE === */
@media (max-width: 480px) {
  .page-estimer .estimation-form-container {
    scroll-padding-top: 80px;
  }
  
  .page-estimer .form-step {
    scroll-margin-top: 80px;
    scroll-margin-bottom: 60px;
  }
  
  .page-estimer .form-step.active::before {
    height: 80px;
    margin-top: -80px;
  }
}
