/* Styles principaux du formulaire d'estimation modulaire */

/* Reset et base */
* {
  box-sizing: border-box;
}

body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  font-family: 'Montserrat', Arial, sans-serif;
  color: #2d3748;
  margin: 0;
  padding: 20px;
  min-height: 100vh;
  line-height: 1.6;
}

/* Container principal */
.form-container {
  max-width: 1200px;
  margin: 0 auto;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.1);
  overflow: hidden;
  animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header */
.header {
  background: linear-gradient(135deg, #1a237e 0%, #3949ab 100%);
  color: white;
  padding: 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

.header h1 {
  margin: 0;
  font-size: 2.2em;
  font-weight: 800;
  position: relative;
  z-index: 1;
}

.header p {
  margin: 10px 0 0 0;
  font-size: 1.1em;
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

/* Toolbar */
.toolbar {
  background: #f8fafc;
  padding: 15px 30px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-tool {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 15px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #4a5568;
}

.btn-tool:hover {
  background: #f7fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.btn-tool.active {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
}

/* Contenu principal */
.form-content {
  padding: 30px;
}

/* Étapes */
.step {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.step.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Sections */
.form-section {
  margin-bottom: 40px;
  padding: 25px;
  background: #f8fafc;
  border-radius: 15px;
  border: 1px solid #e2e8f0;
}

.section-title {
  font-size: 1.4em;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 20px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-icon {
  font-size: 1.2em;
}

/* Groupes de champs */
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

/* Labels */
.form-label {
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  font-size: 0.95em;
}

.required {
  color: #ef4444;
  font-weight: bold;
}

/* Inputs */
.form-input,
.form-select,
.form-textarea {
  padding: 12px 16px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 1em;
  font-family: inherit;
  background: white;
  transition: all 0.3s ease;
  width: 100%;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: #cbd5e1;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

/* Boutons rapides */
.quick-buttons {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.quick-btn {
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: white;
  font-size: 0.85em;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #4a5568;
}

.quick-btn:hover {
  background: #f7fafc;
  border-color: #cbd5e1;
}

.quick-btn.offert {
  background: #f0f9ff;
  border-color: #0ea5e9;
  color: #0ea5e9;
}

/* Groupes spéciaux */
.radio-group {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
}

.radio-item:hover {
  border-color: #cbd5e1;
  background: #f7fafc;
}

.radio-item input[type="radio"] {
  margin: 0;
}

.radio-item.checked {
  border-color: #3b82f6;
  background: #eff6ff;
}

.gps-group {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.btn-gps {
  padding: 8px 12px;
  background: #10b981;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-gps:hover {
  background: #059669;
  transform: translateY(-1px);
}

.coordinates-display {
  font-size: 0.85em;
  color: #6b7280;
  margin-top: 4px;
  padding: 4px 8px;
  background: #f3f4f6;
  border-radius: 4px;
  display: none;
}

.coordinates-display.show {
  display: block;
}

/* Navigation */
.step-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
  padding: 20px 0;
  border-top: 1px solid #e2e8f0;
}

.btn-nav {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-prev {
  background: #f1f5f9;
  color: #475569;
}

.btn-prev:hover {
  background: #e2e8f0;
}

.btn-next,
.btn-submit {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
}

.btn-next:hover,
.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
}

.btn-submit {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  padding: 15px 30px;
  font-size: 1.1em;
}

.btn-submit:hover {
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.btn-submit:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Indicateur d'étapes */
.step-indicator {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
}

.step-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
}

.step-dot.completed {
  background: #10b981;
  color: white;
}

.step-dot.active {
  background: #3b82f6;
  color: white;
}

.step-dot.inactive {
  background: #e2e8f0;
  color: #9ca3af;
}

/* Preview en direct */
.live-preview {
  position: sticky;
  top: 20px;
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 15px;
  padding: 20px;
  margin-left: 20px;
  max-height: 80vh;
  overflow-y: auto;
}

.preview-title {
  font-size: 1.2em;
  font-weight: 700;
  color: #1a202c;
  margin: 0 0 15px 0;
  text-align: center;
}

.preview-content p {
  margin: 8px 0;
  font-size: 0.9em;
}

.preview-content strong {
  color: #374151;
}

/* Responsive */
@media (max-width: 1024px) {
  .form-container {
    margin: 10px;
    border-radius: 15px;
  }
  
  .form-content {
    padding: 20px;
  }
  
  .live-preview {
    position: static;
    margin: 20px 0 0 0;
  }
}

@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  
  .header {
    padding: 20px;
  }
  
  .header h1 {
    font-size: 1.8em;
  }
  
  .toolbar {
    flex-direction: column;
    gap: 15px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .form-section {
    padding: 20px;
    margin-bottom: 25px;
  }
  
  .step-navigation {
    flex-direction: column;
    gap: 15px;
  }
  
  .btn-nav {
    width: 100%;
    justify-content: center;
  }
  
  .step-indicator {
    gap: 10px;
    margin: 15px 0;
  }
  
  .step-dot {
    width: 35px;
    height: 35px;
    font-size: 0.9em;
  }
  
  .radio-group {
    flex-direction: column;
    gap: 10px;
  }
  
  .quick-buttons {
    justify-content: center;
  }
  
  .gps-group {
    flex-direction: column;
  }
  
  /* Éviter le zoom sur iOS */
  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .header h1 {
    font-size: 1.5em;
  }
  
  .section-title {
    font-size: 1.2em;
  }
  
  .form-section {
    padding: 15px;
  }
  
  .toolbar {
    padding: 10px 15px;
  }
  
  .form-content {
    padding: 15px;
  }
}

/* Mode sombre (optionnel) */
@media (prefers-color-scheme: dark) {
  body {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
  }
  
  .form-container {
    background: #2d3748;
    color: #e2e8f0;
  }
  
  .form-section {
    background: #374151;
    border-color: #4a5568;
  }
  
  .form-input,
  .form-select,
  .form-textarea {
    background: #4a5568;
    border-color: #6b7280;
    color: #e2e8f0;
  }
  
  .radio-item {
    background: #4a5568;
    border-color: #6b7280;
  }
  
  .live-preview {
    background: #374151;
    border-color: #4a5568;
    color: #e2e8f0;
  }
}

/* Animations et transitions supplémentaires */
.form-input:valid,
.form-select:valid {
  border-color: #10b981;
}

.form-input:invalid:not(:placeholder-shown),
.form-select:invalid:not(:placeholder-shown) {
  border-color: #ef4444;
}

/* États de chargement */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #3b82f6;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Utilitaires */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.hidden { display: none !important; }
.visible { display: block !important; }