/**
 * Formulaire Achat Appareils Apple - Styles
 * Version: 1.0.0
 */

* {
  box-sizing: border-box;
}

.faa-form-wrapper {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
  min-height: 100vh;
}

.form-container {
  max-width: 900px;
  margin: 0 auto;
  background-color: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.form-header {
  background: linear-gradient(135deg, #003d7a 0%, #764ba2 100%);
  color: white;
  padding: 40px 30px;
  text-align: center;
}

.form-header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
  font-weight: 700;
}

.form-header p {
  font-size: 1.1em;
  opacity: 0.95;
}

.form-content {
  padding: 40px 30px;
}

/* Barre de progression */
.progress-bar {
  display: flex;
  justify-content: space-between;
  margin-bottom: 40px;
  position: relative;
}

.progress-bar::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 2px;
  background: #e0e0e0;
  z-index: 0;
}

.progress-step {
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 1;
}

.progress-step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e0e0e0;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #999;
  transition: all 0.3s ease;
}

.progress-step.active .progress-step-circle {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  transform: scale(1.1);
}

.progress-step.completed .progress-step-circle {
  background: #4caf50;
  color: white;
}

.progress-step-label {
  font-size: 0.9em;
  color: #666;
}

/* Sections du formulaire */
.form-section {
  display: none;
  animation: fadeIn 0.5s ease;
}

.form-section.active {
  display: block;
}

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

.form-section h2 {
  color: #333;
  margin-bottom: 25px;
  font-size: 1.8em;
  border-bottom: 3px solid #667eea;
  padding-bottom: 10px;
}

/* Groupes de formulaire */
.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #555;
  font-size: 1em;
}

.form-group label .required {
  color: #f44336;
  margin-left: 3px;
}

.form-group select,
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group textarea,
.form-group input[type="number"] {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  font-size: 16px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
  border-color: #f44336;
}

.error-message {
  color: #f44336;
  font-size: 0.85em;
  margin-top: 5px;
  display: none;
}

.error-message.show {
  display: block;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* TÃ©lÃ©phone */
.phone-input {
  display: flex;
  gap: 10px;
}

.phone-input select {
  width: 140px;
  flex-shrink: 0;
}

.phone-input input {
  flex: 1;
}

/* Upload de fichiers */
.file-input-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.file-input-wrapper input[type="file"] {
  position: absolute;
  left: -9999px;
}

.file-input-label {
  display: block;
  padding: 12px 15px;
  background: #f5f5f5;
  border: 2px dashed #ccc;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.file-input-label:hover {
  background: #ebebeb;
  border-color: #667eea;
}

.file-input-label.has-file {
  background: #e8f5e9;
  border-color: #4caf50;
  color: #2e7d32;
}

/* Checkboxes et radios */
.checkbox-group,
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.checkbox-label,
.radio-label {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.checkbox-label:hover,
.radio-label:hover {
  background: #f0f0f0;
}

.checkbox-label input,
.radio-label input {
  margin-right: 12px;
  margin-top: 3px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Signature */
#signature-pad {
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background-color: #fff;
  cursor: crosshair;
  display: block;
  touch-action: none;
  width: 100%;
  max-width: 600px;
}

.signature-actions {
  margin-top: 15px;
  display: flex;
  gap: 10px;
}

/* Boutons */
.btn {
  padding: 14px 30px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #e0e0e0;
  color: #333;
}

.btn-secondary:hover {
  background: #d0d0d0;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-group {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  gap: 15px;
}

/* Estimation */
#estimation-result {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 25px;
  border-radius: 15px;
  text-align: center;
  margin-top: 20px;
  font-size: 1.5em;
  font-weight: bold;
  display: none;
  animation: slideIn 0.5s ease;
}

#estimation-result.show {
  display: block;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-overlay.show {
  display: flex;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Message de succÃ¨s */
.success-message {
  background: #4caf50;
  color: white;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  margin-top: 20px;
  display: none;
}

.success-message.show {
  display: block;
}

/* Responsive */
@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .form-header h1 {
    font-size: 1.8em;
  }

  .btn-group {
    flex-direction: column;
  }

  .progress-bar {
    flex-wrap: wrap;
  }

  .progress-step {
    flex: 0 0 33.33%;
    margin-bottom: 20px;
  }
  
  #signature-pad {
    width: 100%;
  }
  
  .faa-form-wrapper {
    padding: 10px;
  }
  
  .form-content {
    padding: 20px 15px;
  }
}

@media (max-width: 480px) {
  .form-header h1 {
    font-size: 1.5em;
  }
  
  .form-header {
    padding: 30px 20px;
  }
  
  .progress-step {
    flex: 0 0 50%;
  }
  
  .progress-step-label {
    font-size: 0.8em;
  }
}