/* ============================================================
   RCI Formation — Formulaire de devis (Wizard 3 étapes)
   Design system : Noir & Or RCI, cohérent avec /caces/ et /securite/
   ============================================================ */

/* === LAYOUT WIZARD === */
.wizard-container {
  max-width: 880px;
  margin: 0 auto;
  background: var(--rci-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* === BARRE DE PROGRESSION === */
.wizard-progress {
  background: var(--rci-cream);
  padding: 30px 40px 20px;
  border-bottom: 1px solid var(--rci-border);
}

.progress-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  margin-bottom: 14px;
}

.progress-bar::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 5%;
  right: 5%;
  height: 2px;
  background: var(--rci-border);
  z-index: 0;
}

.progress-bar-fill {
  position: absolute;
  top: 18px;
  left: 5%;
  height: 2px;
  background: var(--rci-gold);
  z-index: 1;
  transition: width 0.4s ease;
}

.progress-step {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.progress-step .step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--rci-white);
  border: 2px solid var(--rci-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: var(--rci-text-muted);
  transition: all 0.3s;
}

.progress-step .step-label {
  margin-top: 8px;
  font-size: 12px;
  color: var(--rci-text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-align: center;
}

.progress-step.active .step-num {
  background: var(--rci-gold);
  border-color: var(--rci-gold);
  color: var(--rci-black);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.progress-step.active .step-label {
  color: var(--rci-black);
}

.progress-step.done .step-num {
  background: var(--rci-black);
  border-color: var(--rci-black);
  color: var(--rci-gold);
}

.progress-step.done .step-num::before {
  content: "✓";
  font-size: 18px;
}

.progress-step.done .step-num .num-digit {
  display: none;
}

/* === ÉTAPES === */
.wizard-step {
  display: none;
  padding: 40px;
  animation: fadeIn 0.4s ease;
}

.wizard-step.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.wizard-step h2 {
  font-size: 28px;
  margin-bottom: 8px;
  color: var(--rci-black);
}

.wizard-step h2 em {
  color: var(--rci-gold-dark);
  font-style: normal;
}

.wizard-step .step-intro {
  color: var(--rci-text-muted);
  font-size: 16px;
  margin-bottom: 30px;
}

/* === GROUPES DE CHOIX (RADIO CARDS) === */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.choice-card {
  position: relative;
  background: var(--rci-white);
  border: 2px solid var(--rci-border);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.choice-card:hover {
  border-color: var(--rci-gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.choice-card input[type="radio"],
.choice-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-card .choice-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.choice-card .choice-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--rci-black);
  margin-bottom: 4px;
}

.choice-card .choice-desc {
  font-size: 13px;
  color: var(--rci-text-muted);
  line-height: 1.4;
}

.choice-card.selected {
  border-color: var(--rci-gold);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.06), rgba(212, 175, 55, 0.02));
}

.choice-card.selected::after {
  content: "✓";
  position: absolute;
  top: 10px;
  right: 12px;
  width: 22px;
  height: 22px;
  background: var(--rci-gold);
  color: var(--rci-black);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

/* === CHAMPS FORMULAIRE STANDARD === */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}

.form-row.single {
  grid-template-columns: 1fr;
}

.form-field {
  display: flex;
  flex-direction: column;
}

.form-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--rci-black);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.form-field label .required {
  color: #c0392b;
  margin-left: 2px;
}

.form-field label .hint {
  font-size: 12px;
  color: var(--rci-text-muted);
  font-weight: 400;
  margin-left: 6px;
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="tel"],
.form-field input[type="number"],
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--rci-border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 15px;
  color: var(--rci-text);
  background: var(--rci-white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--rci-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.form-field textarea {
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

.form-field .field-error {
  display: none;
  color: #c0392b;
  font-size: 12px;
  margin-top: 6px;
  font-weight: 500;
}

.form-field.error input,
.form-field.error select,
.form-field.error textarea {
  border-color: #c0392b;
}

.form-field.error .field-error {
  display: block;
}

/* === CHECKBOX ET RADIO STYLISÉS === */
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--rci-gold);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-row label {
  font-size: 14px;
  color: var(--rci-text);
  cursor: pointer;
  line-height: 1.5;
}

.checkbox-row label a {
  color: var(--rci-gold-dark);
  text-decoration: underline;
}

/* === HONEYPOT (caché aux humains, visible aux bots) === */
.honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* === ACTIONS WIZARD (BOUTONS PRECEDENT/SUIVANT) === */
.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 40px;
  background: var(--rci-cream);
  border-top: 1px solid var(--rci-border);
}

.wizard-actions .btn {
  min-width: 140px;
}

.wizard-actions .btn-prev {
  background: transparent;
  color: var(--rci-text-muted);
  border-color: var(--rci-border);
}

.wizard-actions .btn-prev:hover {
  color: var(--rci-black);
  border-color: var(--rci-text-muted);
  background: var(--rci-white);
  transform: none;
}

.wizard-actions .btn-prev:disabled,
.wizard-actions .btn-prev.hidden {
  visibility: hidden;
}

/* === RÉCAPITULATIF ÉTAPE 3 === */
.recap-box {
  background: var(--rci-cream);
  border-left: 4px solid var(--rci-gold);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  margin-bottom: 24px;
}

.recap-box .recap-title {
  font-weight: 700;
  color: var(--rci-black);
  margin-bottom: 8px;
  font-size: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.recap-box .recap-line {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 14px;
  color: var(--rci-text);
}

.recap-box .recap-line strong {
  color: var(--rci-black);
}

/* === MESSAGE DE SUCCÈS / ERREUR APRÈS SUBMIT === */
.form-message {
  display: none;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 14px;
}

.form-message.success {
  background: #e8f5e9;
  border-left: 4px solid #2e7d32;
  color: #1b5e20;
}

.form-message.error {
  background: #fbe9e7;
  border-left: 4px solid #c0392b;
  color: #a93226;
}

.form-message.visible {
  display: block;
}

/* === LOADING STATE (bouton submit) === */
.btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.btn-loading::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 50%;
  border-top-color: transparent;
  margin-left: 10px;
  animation: spin 0.6s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === MENTIONS LÉGALES MICRO === */
.legal-mini {
  font-size: 12px;
  color: var(--rci-text-muted);
  text-align: center;
  margin-top: 16px;
  line-height: 1.5;
}

.legal-mini a {
  color: var(--rci-text-muted);
  text-decoration: underline;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .wizard-step,
  .wizard-progress,
  .wizard-actions {
    padding: 24px 20px;
  }

  .wizard-step {
    padding: 28px 20px;
  }

  .progress-step .step-label {
    font-size: 10px;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .wizard-actions {
    flex-direction: column-reverse;
    gap: 12px;
  }

  .wizard-actions .btn {
    width: 100%;
  }

  .wizard-actions .btn-prev.hidden {
    display: none;
  }
}