/* ============================================================
   Wizard "Demarrer un projet" - styles V1.5
   - Layout paysage desktop : sidebar gauche + content droit
   - Tient dans le viewport (pas de scroll page sur les etapes courtes)
   - Fallback mobile : empile verticalement (comportement original)
   ============================================================ */

.wizard-section {
  padding: 100px 0 40px;
  background: #fafafa;
  min-height: calc(100vh - 80px);
}

.wizard-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
}

.wizard-intro {
  text-align: center;
  margin-bottom: 24px;
}

.wizard-intro h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  margin: 0 0 8px;
  font-weight: 600;
}

.wizard-intro p {
  color: #555;
  font-size: 1rem;
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.5;
}

#wizard-root {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  padding: 32px;
  scroll-margin-top: 80px;
}

/* Layout mobile par defaut : structure en colonne */
.wizard-layout {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.wizard-side .wizard-side-content {
  margin-top: 16px;
}

/* ----- Progress bar ----- */
.wizard-header {
  margin-bottom: 32px;
}

.wizard-progress-bar {
  height: 6px;
  background: #eee;
  border-radius: 3px;
  overflow: hidden;
}

.wizard-progress-fill {
  height: 100%;
  background: #1a1a1a;
  border-radius: 3px;
  transition: width 0.35s ease;
}

.wizard-progress-label {
  text-align: right;
  font-size: 0.85rem;
  color: #888;
  margin-top: 8px;
  letter-spacing: 0.5px;
}

/* ----- Step header ----- */
.wizard-step {
  position: relative;
}

.wizard-title {
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  margin: 0 0 8px;
  font-weight: 600;
  color: #1a1a1a;
}

.wizard-subtitle {
  color: #666;
  margin: 0 0 28px;
  line-height: 1.5;
}

.wizard-step-body {
  margin-bottom: 24px;
}

/* ----- Radio cards (step "type de projet") ----- */
.wizard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.wizard-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 18px;
  border: 1.5px solid #e5e5e5;
  border-radius: 10px;
  cursor: pointer;
  background: #fff;
  transition: all 0.15s ease;
}

.wizard-card:hover {
  border-color: #999;
  transform: translateY(-1px);
}

.wizard-card.is-selected {
  border-color: #1a1a1a;
  background: #fafafa;
  box-shadow: 0 0 0 3px rgba(26,26,26,0.06);
}

.wizard-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.wizard-card-icon {
  font-size: 1.8rem;
  line-height: 1;
}

.wizard-card-label {
  font-weight: 600;
  font-size: 1rem;
  color: #1a1a1a;
}

.wizard-card-desc {
  font-size: 0.85rem;
  color: #777;
  line-height: 1.4;
}

/* ----- Radios verticaux ----- */
.wizard-radios {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wizard-radio {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1.5px solid #e5e5e5;
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
  transition: all 0.15s ease;
  font-size: 0.98rem;
  color: #333;
}

.wizard-radio:hover {
  border-color: #999;
  background: #fafafa;
}

.wizard-radio.is-selected {
  border-color: #1a1a1a;
  background: #fafafa;
  box-shadow: 0 0 0 3px rgba(26,26,26,0.06);
}

.wizard-radio input[type="radio"] {
  accent-color: #1a1a1a;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

/* ----- Champs texte / select / textarea ----- */
.wizard-field {
  margin-bottom: 18px;
}

.wizard-field label {
  display: block;
  font-weight: 500;
  font-size: 0.95rem;
  color: #333;
  margin-bottom: 6px;
}

.wizard-field input[type="text"],
.wizard-field input[type="email"],
.wizard-field input[type="tel"],
.wizard-field select,
.wizard-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.98rem;
  font-family: inherit;
  background: #fff;
  color: #1a1a1a;
  transition: border-color 0.15s ease;
  box-sizing: border-box;
}

.wizard-field input:focus,
.wizard-field select:focus,
.wizard-field textarea:focus {
  outline: none;
  border-color: #1a1a1a;
  box-shadow: 0 0 0 3px rgba(26,26,26,0.08);
}

.wizard-field textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

/* ----- Checkbox ----- */
.wizard-field-checkbox label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.92rem;
  color: #444;
  line-height: 1.5;
}

.wizard-field-checkbox input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  accent-color: #1a1a1a;
}

/* ----- Radio inline (canal de contact) ----- */
.wizard-field-inline-radios {
  margin: 8px 0 18px;
}

.wizard-field-label {
  display: block;
  font-weight: 500;
  font-size: 0.95rem;
  color: #333;
  margin-bottom: 8px;
}

.wizard-inline-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wizard-inline-radios label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid #e0e0e0;
  border-radius: 24px;
  cursor: pointer;
  font-size: 0.92rem;
  transition: all 0.15s ease;
}

.wizard-inline-radios label.is-selected {
  border-color: #1a1a1a;
  background: #1a1a1a;
  color: #fff;
}

.wizard-inline-radios input[type="radio"] {
  display: none;
}

/* ----- Turnstile ----- */
.wizard-turnstile {
  margin-top: 12px;
  margin-bottom: 8px;
}

.wizard-help-warning {
  background: #fff7e6;
  border: 1px solid #ffd591;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: #874d00;
  margin: 8px 0 0;
}

/* ----- Erreur ----- */
.wizard-error {
  min-height: 24px;
  margin-top: 12px;
  color: #c0392b;
  font-size: 0.92rem;
  font-weight: 500;
}

.wizard-error:empty {
  margin-top: 0;
}

/* ----- Navigation ----- */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 24px;
  border-top: 1px solid #eee;
  margin-top: 8px;
}

.wizard-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 0.98rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

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

.wizard-btn-secondary {
  background: #f4f4f4;
  color: #555;
}

.wizard-btn-secondary:hover:not(:disabled) {
  background: #e8e8e8;
}

.wizard-btn-primary {
  background: #1a1a1a;
  color: #fff;
  min-width: 200px;
}

.wizard-btn-primary:hover:not(:disabled) {
  background: #000;
  transform: translateY(-1px);
}

/* ============================================================
   Page merci
   ============================================================ */
.thank-you-section {
  padding: 120px 0 160px;
  text-align: center;
  background: #fafafa;
  min-height: calc(100vh - 200px);
}

.thank-you-card {
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
  padding: 48px 32px;
}

.thank-you-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
}

.thank-you-card h1 {
  font-size: 1.8rem;
  margin: 0 0 12px;
  color: #1a1a1a;
}

.thank-you-card p {
  color: #555;
  line-height: 1.6;
  margin: 0 0 16px;
}

.thank-you-ref {
  display: inline-block;
  padding: 10px 18px;
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 8px;
  font-family: monospace;
  font-size: 1rem;
  color: #1a1a1a;
  letter-spacing: 0.5px;
  margin: 12px 0 24px;
}

.thank-you-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
}

.thank-you-actions a {
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.98rem;
  transition: all 0.15s ease;
}

.thank-you-actions .btn-primary {
  background: #1a1a1a;
  color: #fff;
}

.thank-you-actions .btn-primary:hover {
  background: #000;
}

.thank-you-actions .btn-secondary {
  background: #f4f4f4;
  color: #555;
}

.thank-you-actions .btn-secondary:hover {
  background: #e8e8e8;
}

/* ============================================================
   Upload zone (V1.2 - etape Inspirations & documents)
   ============================================================ */

.wizard-upload-zone {
  border: 2px dashed #ccc;
  border-radius: 12px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s ease;
  background: #fafafa;
}

.wizard-upload-zone:hover,
.wizard-upload-zone:focus {
  border-color: #1a1a1a;
  background: #f4f4f4;
  outline: none;
}

.wizard-upload-zone.is-dragover {
  border-color: #1a1a1a;
  background: #f0f0f0;
  transform: scale(1.01);
}

.wizard-upload-icon {
  font-size: 2.2rem;
  margin-bottom: 8px;
  opacity: 0.7;
}

.wizard-upload-zone p {
  margin: 0;
  color: #555;
  line-height: 1.5;
}

.wizard-upload-hint {
  font-size: 0.85rem;
  color: #888;
  margin-top: 8px !important;
}

.wizard-upload-list {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wizard-upload-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.15s ease;
}

.wizard-upload-item.is-uploading {
  border-color: #d0d0d0;
  background: #fafafa;
}

.wizard-upload-thumb {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wizard-upload-thumb-icon {
  font-size: 1.8rem;
  color: #999;
}

.wizard-upload-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wizard-upload-name {
  font-weight: 500;
  color: #1a1a1a;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wizard-upload-info {
  font-size: 0.78rem;
  color: #888;
}

.wizard-upload-progress {
  height: 4px;
  background: #eee;
  border-radius: 2px;
  overflow: hidden;
  margin-top: 4px;
}

.wizard-upload-progress-fill {
  height: 100%;
  background: #1a1a1a;
  border-radius: 2px;
  transition: width 0.2s ease;
}

.wizard-upload-type-select {
  margin-top: 4px;
  padding: 4px 8px;
  font-size: 0.82rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  max-width: 140px;
}

.wizard-upload-remove {
  background: transparent;
  border: 1px solid #e8e8e8;
  color: #666;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  align-self: flex-start;
}

.wizard-upload-remove:hover {
  background: #fee;
  border-color: #f99;
  color: #c0392b;
}

/* ============================================================
   Modal de reprise de brouillon (V1.2)
   ============================================================ */

.wizard-draft-modal {
  padding: 24px 4px;
  text-align: center;
}

.wizard-draft-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

@media (max-width: 480px) {
  .wizard-upload-item { grid-template-columns: 48px 1fr auto; gap: 10px; padding: 10px; }
  .wizard-upload-thumb { width: 48px; height: 48px; }
}

/* ============================================================
   Composants additionnels (utilises sur contact.html + header)
   ============================================================ */

/* Lien Contact discret a cote du CTA primaire dans le header */
.header-link-secondary {
  color: #555;
  text-decoration: none;
  font-size: 0.95rem;
  margin-right: 16px;
  transition: color 0.15s ease;
}
.header-link-secondary:hover { color: #1a1a1a; }

/* Banniere de redirection vers le wizard sur la page contact */
.contact-cta-banner {
  background: linear-gradient(135deg, #fafafa, #f0f0f0);
  border-left: 4px solid #1a1a1a;
  padding: 18px 22px;
  border-radius: 8px;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.contact-cta-banner p { margin: 0; color: #444; line-height: 1.5; font-size: 0.95rem; }
.contact-cta-banner strong { color: #1a1a1a; }
.contact-cta-banner .btn-primary {
  align-self: flex-start;
  background: #1a1a1a; color: #fff; padding: 10px 18px;
  border-radius: 6px; text-decoration: none; font-size: 0.95rem;
  font-weight: 500; transition: all 0.15s ease;
}
.contact-cta-banner .btn-primary:hover { background: #000; transform: translateY(-1px); }

/* Checkbox dans contact form */
.form-group-checkbox label {
  display: flex; align-items: flex-start; gap: 10px;
  cursor: pointer; font-size: 0.92rem; color: #444; line-height: 1.5;
}
.form-group-checkbox input[type="checkbox"] {
  margin-top: 3px; width: 18px; height: 18px; flex: 0 0 18px;
  accent-color: #1a1a1a;
}

/* Message d'erreur/succes contact form */
.form-error {
  min-height: 24px; margin-top: 12px;
  font-size: 0.92rem; font-weight: 500;
}

/* CTA mobile menu */
.mobile-menu .mobile-cta {
  display: inline-block; margin-top: 8px;
  background: #1a1a1a; color: #fff !important;
  padding: 10px 18px; border-radius: 6px;
  text-align: center; font-weight: 500;
}

/* ============================================================
   Desktop : layout PAYSAGE
   Sidebar gauche (titre + progress) | contenu droit (form + nav)
   #wizard-root devient une "carte" qui tient dans le viewport.
   ============================================================ */
@media (min-width: 900px) {
  /* Reduit l'espace pris par la section et l'intro pour laisser le wizard
     occuper le maximum de viewport sans scroll. */
  .wizard-section { padding: 90px 0 24px; min-height: 0; }
  .wizard-intro { display: none; } /* la sidebar du wizard porte le titre */
  .wizard-container { max-width: 1180px; padding: 0 20px; }

  /* Hauteur fixe basee sur le viewport : permet aux grid items
     d'avoir une vraie hauteur pour le flex enfant. */
  #wizard-root {
    padding: 0;
    overflow: hidden;
    height: calc(100vh - 130px);
    max-height: calc(100vh - 130px);
    min-height: 460px;
  }

  .wizard-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    height: 100%;
  }

  /* Sidebar */
  .wizard-side {
    background: linear-gradient(180deg, #1a1a1a 0%, #2c2c2c 100%);
    color: #fff;
    padding: 28px 26px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
  }

  .wizard-side .wizard-header { margin-bottom: 24px; }

  .wizard-side .wizard-progress-bar {
    background: rgba(255,255,255,0.18);
    height: 5px;
  }
  .wizard-side .wizard-progress-fill { background: #fff; }
  .wizard-side .wizard-progress-label {
    color: rgba(255,255,255,0.65);
    font-size: 0.8rem;
  }

  .wizard-side .wizard-side-content {
    margin-top: 0;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
  }

  .wizard-side .wizard-title {
    color: #fff;
    font-size: 1.35rem;
    line-height: 1.3;
    margin: 0 0 10px;
  }

  .wizard-side .wizard-subtitle {
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
  }

  /* Panel droit : flex column, nav sticky en bas, body fait le reste */
  .wizard-main {
    display: flex;
    flex-direction: column;
    padding: 24px 28px 18px;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
  }

  .wizard-step {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
  }

  .wizard-step-body {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    margin-right: -4px;
    min-height: 0;
  }

  .wizard-error {
    flex-shrink: 0;
  }

  .wizard-nav {
    flex-shrink: 0;
    border-top: 1px solid #eee;
    padding-top: 12px;
    margin-top: 8px;
  }
  .wizard-btn { padding: 10px 20px; font-size: 0.95rem; }
  .wizard-btn-primary { min-width: 180px; }

  /* Champs denses */
  .wizard-field { margin-bottom: 12px; }
  .wizard-field input[type="text"],
  .wizard-field input[type="email"],
  .wizard-field input[type="tel"],
  .wizard-field select,
  .wizard-field textarea { padding: 10px 12px; font-size: 0.95rem; }
  .wizard-field textarea { min-height: 80px; }
  .wizard-field > label { margin-bottom: 4px; font-size: 0.9rem; }
  .wizard-radios { gap: 6px; }
  .wizard-radio { padding: 9px 14px; font-size: 0.93rem; }

  /* Cartes : 3 colonnes fixes pour que les 6 services tiennent en 2 lignes */
  .wizard-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .wizard-card {
    padding: 12px 12px;
    gap: 4px;
    border-radius: 8px;
  }
  .wizard-card-icon { font-size: 1.35rem; }
  .wizard-card-label { font-size: 0.92rem; }
  .wizard-card-desc { font-size: 0.78rem; line-height: 1.35; }
}

@media (min-width: 1280px) {
  .wizard-layout { grid-template-columns: 300px 1fr; }
  .wizard-main { padding: 28px 32px 20px; }
  .wizard-side { padding: 32px 28px; }
  .wizard-card { padding: 14px 14px; }
}

/* ============================================================
   Mobile
   ============================================================ */
@media (max-width: 640px) {
  .wizard-section { padding: 100px 0 60px; }
  #wizard-root { padding: 20px 18px; border-radius: 8px; }
  .wizard-cards { grid-template-columns: 1fr; }
  .wizard-nav { flex-direction: column-reverse; }
  .wizard-btn { width: 100%; }
  .thank-you-card { padding: 32px 20px; margin: 0 18px; }
}
