/* ========================================
   FORM STYLES - Contact & Join Forms
   RESPONSIVE OPTIMISÉ 2025
   ======================================== */

/* ========== VARIABLES ========== */
:root {
  --violet: #562C80;
  --indigo: #5b3dbb;
  --blue: #1E3A8A;
  --dark: #0f172a;
  --muted: #64748b;
  --paper: #ffffff;
  --bg: #f8fafc;
  --gradient: linear-gradient(135deg, #562C80 0%, #5b3dbb 50%, #1E3A8A 100%);
  --shadow-sm: 0 2px 8px rgba(86, 44, 128, 0.08);
  --shadow-md: 0 8px 24px rgba(86, 44, 128, 0.12);
  --shadow-lg: 0 16px 48px rgba(86, 44, 128, 0.16);
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
}

/* ========================================
   CONTAINER - UNIFIÉ AVEC INDEX
   ======================================== */
.container {
  max-width: 1400px; /* ← UNIFIÉ avec header et index.html */
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* ========================================
   PROGRESS BAR
   ======================================== */
.progress-bar {
  display: flex;
  justify-content: space-between;
  margin: 100px auto 40px;
  position: relative;
  z-index: 10;
  max-width: 900px; /* ← Garde la progress bar centrée */
}

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

.progress-bar-fill {
  position: absolute;
  top: 20px;
  left: 0;
  height: 3px;
  background: var(--gradient);
  transition: width 0.4s ease;
  z-index: 1;
}

.progress-step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  cursor: pointer;
  transition: all 0.3s ease;
}

.progress-step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: 3px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

.progress-step.active .progress-step-circle {
  background: var(--gradient);
  border-color: var(--indigo);
  color: white;
  transform: scale(1.1);
}

.progress-step.completed .progress-step-circle {
  background: var(--indigo);
  border-color: var(--indigo);
  color: white;
}

.progress-step-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

.progress-step.active .progress-step-label {
  color: var(--indigo);
  font-weight: 700;
}

/* ========================================
   FORM CARD - PREND TOUTE LA LARGEUR
   ======================================== */
.form-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 48px;
  box-shadow: var(--shadow-lg);
  border: 1px solid #f1f5f9;
  min-height: 500px;
  /* ← PAS de max-width ! Prend toute la largeur du container */
}

.form-step {
  display: none;
  animation: fadeIn 0.4s ease;
}

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

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

.step-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 12px;
  font-family: 'Space Grotesk', sans-serif;
}

.step-subtitle {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 32px;
}

/* ========================================
   FORM LABELS
   ======================================== */
.form-label {
  display: block;
  font-weight: 600;
  font-size: 15px;
  color: var(--dark);
  margin-bottom: 8px;
}

.form-label.required::after,
.required::after {
  content: " *";
  color: #dc3545;
  font-weight: bold;
}

/* ========================================
   FORM INPUTS
   ======================================== */
.form-group {
  margin-bottom: 24px;
}

input[type="text"], 
input[type="email"], 
input[type="tel"], 
textarea, 
select {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 12px;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-sm);
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  box-sizing: border-box;
  background-color: var(--paper);
  color: var(--dark);
}

input[type="text"]:focus, 
input[type="email"]:focus, 
input[type="tel"]:focus, 
textarea:focus, 
select:focus {
  border-color: var(--indigo);
  outline: none;
  background-color: white;
  box-shadow: 0 0 0 3px rgba(91, 61, 187, 0.1);
}

select {
  cursor: pointer;
  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='%235b3dbb' 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 12px center;
  background-size: 16px;
  padding-right: 40px;
}

textarea {
  resize: vertical;
  min-height: 120px;
  max-height: 300px;
  line-height: 1.6;
}

/* ========================================
   VALIDATION
   ======================================== */
.field-error {
  border-color: #dc3545 !important;
  background-color: #fff5f5 !important;
}

.field-success {
  border-color: #28a745 !important;
  background-color: #f8fff9 !important;
}

.error-message {
  color: #dc3545;
  font-size: 14px;
  margin-top: -8px;
  margin-bottom: 12px;
  display: none;
  font-weight: 600;
}

/* ========================================
   RADIO & CHECKBOX OPTIONS
   ======================================== */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radio-option {
  display: flex;
  align-items: center;
  padding: 16px;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.3s ease;
}

.radio-option:hover {
  border-color: var(--indigo);
  background: #f8fafc;
}

.radio-option input[type="radio"] {
  margin-right: 12px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--indigo);
}

.radio-option.selected {
  border-color: var(--indigo);
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
}

.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-option {
  display: flex;
  align-items: flex-start;
  padding: 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

.checkbox-option:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.checkbox-option input[type="checkbox"] {
  margin: 2px 12px 0 0;
  min-width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--indigo);
}

.checkbox-option label,
.radio-option label {
  cursor: pointer;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.besoin-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
  line-height: 1.4;
}

.besoin-description {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
  font-weight: 400;
}

.checkbox-option.selected .besoin-title,
.radio-option.selected .besoin-title {
  color: var(--indigo);
}

/* ========================================
   ALERTS
   ======================================== */
.alert {
  padding: 16px 20px;
  border-radius: 12px;
  margin-bottom: 25px;
  font-size: 14px;
  line-height: 1.6;
}

.alert-warning {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 2px solid #f59e0b;
  color: #92400e;
}

.alert-success {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 2px solid #10b981;
  color: #065f46;
}

.alert a {
  color: #562C80;
  font-weight: 600;
  text-decoration: none;
}

.alert a:hover {
  text-decoration: underline;
}

/* ========================================
   COUNTER
   ======================================== */
.counter {
  text-align: center;
  padding: 16px;
  background: linear-gradient(135deg, #f0f4ff 0%, #e8eeff 100%);
  border-radius: 10px;
  margin-bottom: 20px;
}

.counter-number {
  font-size: 32px;
  font-weight: 700;
  color: #562C80;
  font-family: 'Space Grotesk', sans-serif;
}

.counter-label {
  font-size: 13px;
  color: #64748b;
  margin-top: 4px;
}

/* ========================================
   FORM ACTIONS
   ======================================== */
.form-actions {
  display: flex;
  gap: 16px;
  margin-top: 40px;
}

.btn {
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  font-family: 'Inter', sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  min-height: 48px;
}

.btn-primary {
  background: var(--gradient);
  color: white;
  box-shadow: var(--shadow-md);
  flex: 1;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

.btn-secondary {
  background: white;
  color: var(--dark);
  border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
  border-color: var(--indigo);
  background: #f8fafc;
}

/* ========================================
   CONDITIONAL DISPLAY
   ======================================== */
.conditional {
  display: none;
}

.conditional.show {
  animation: fadeIn 0.4s ease;
}

/* ========================================
   MODAL
   ======================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal-container {
  background: white;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 480px;
  width: 90%;
  margin: 20px;
  animation: slideUp 0.3s ease;
}

.modal-content {
  padding: 40px 32px 32px;
  text-align: center;
}

.modal-icon {
  font-size: 56px;
  margin-bottom: 20px;
  line-height: 1;
}

.modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 12px;
}

.modal-message {
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 28px;
}

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

/* ========================================
   RESPONSIVE - TABLET (769px - 1024px)
   ======================================== */
@media (min-width: 769px) and (max-width: 1024px) {
  .container {
    padding: 0 32px;
  }
  
  .form-card {
    padding: 40px 32px;
  }
  
  .progress-bar {
    margin-top: 120px;
  }
}

/* ========================================
   RESPONSIVE - MOBILE (< 768px)
   ======================================== */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  
  .progress-bar {
    margin-top: 92px;
    margin-bottom: 28px;
    padding: 0 8px;
  }
  
  .progress-bar::before {
    top: 18px;
    height: 2px;
  }
  
  .progress-bar-fill {
    top: 18px;
    height: 2px;
  }
  
  .progress-step-circle {
    width: 36px;
    height: 36px;
    font-size: 15px;
    border-width: 2px;
  }
  
  .progress-step-label {
    display: none;
  }
  
  .form-card {
    padding: 28px 20px;
    border-radius: 12px;
    min-height: 400px;
  }
  
  .step-title {
    font-size: 22px;
    margin-bottom: 10px;
  }
  
  .step-subtitle {
    font-size: 14px;
    margin-bottom: 24px;
  }
  
  .form-label {
    font-size: 14px;
  }
  
  input[type="text"], 
  input[type="email"], 
  input[type="tel"], 
  textarea, 
  select {
    padding: 16px 14px;
    font-size: 16px;
    min-height: 48px;
  }
  
  textarea {
    min-height: 100px;
  }
  
  .radio-option,
  .checkbox-option {
    padding: 14px 12px;
    min-height: 48px;
  }
  
  .besoin-title {
    font-size: 15px;
  }
  
  .besoin-description {
    font-size: 13px;
  }
  
  .alert {
    padding: 14px 16px;
    font-size: 13px;
  }
  
  .counter {
    padding: 14px;
  }
  
  .counter-number {
    font-size: 28px;
  }
  
  .form-actions {
    flex-direction: column-reverse;
    gap: 12px;
    margin-top: 32px;
  }
  
  .btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 15px;
    min-height: 52px;
  }
  
  .modal-container {
    max-width: 92%;
  }
  
  .modal-content {
    padding: 32px 24px 24px;
  }
  
  .modal-icon {
    font-size: 48px;
  }
  
  .modal-title {
    font-size: 20px;
  }
  
  .modal-message {
    font-size: 14px;
  }
}

/* ========================================
   RESPONSIVE - TRÈS PETIT (< 375px)
   ======================================== */
@media (max-width: 374px) {
  .form-card {
    padding: 24px 16px;
  }
  
  .step-title {
    font-size: 20px;
  }
  
  .progress-step-circle {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }
  
  .btn {
    padding: 14px 20px;
    font-size: 14px;
  }
}

/* ========================================
   ACCESSIBILITY - TOUCH TARGETS
   ======================================== */
@media (hover: none) and (pointer: coarse) {
  .btn,
  .radio-option,
  .checkbox-option,
  .progress-step-circle {
    min-height: 48px;
    min-width: 48px;
  }
  
  .radio-option input[type="radio"],
  .checkbox-option input[type="checkbox"] {
    width: 24px;
    height: 24px;
  }
}

/* ========================================
   PREVENT TEXT ZOOM ON MOBILE
   ======================================== */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px !important;
  }
}