/* ==========================================================================
   ESSIK Devis — Formulaire multi-étapes UI
   Standalone, theme-indépendant
   ========================================================================== */

.ed-wrap {
  --ed-primary: #FF5500;
  --ed-primary-hover: #E04B00;
  --ed-primary-soft: #FFF2EB;
  --ed-dark: #0A0D12;
  --ed-text: #0F172A;
  --ed-text-muted: #64748B;
  --ed-border: #E2E8F0;
  --ed-bg: #FFFFFF;
  --ed-bg-muted: #F8FAFC;
  --ed-radius: 16px;
  --ed-radius-sm: 10px;
  --ed-shadow: 0 20px 60px -20px rgba(15, 23, 42, 0.18);

  max-width: 1100px;
  margin: 48px auto;
  padding: 0 20px;
  color: var(--ed-text);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, Arial, sans-serif;
  line-height: 1.5;
}

/* ---------- Success ---------- */
.ed-hidden { display: none !important; }
.ed-success {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
  min-height: 400px;
}
.ed-success-card {
  background: var(--ed-bg);
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius);
  padding: 48px 36px;
  box-shadow: var(--ed-shadow);
  max-width: 560px;
  width: 100%;
  text-align: center;
}
.ed-succes-ic { margin-bottom: 16px; }
.ed-succes-ic svg { display: block; margin: 0 auto; }
/* Icônes SVG inline (kicker, aide, boutons) : jamais d'emoji */
.ed-kicker svg,
.ed-help svg,
.ed-btn svg { flex: none; }
.ed-success-card h3 { font-size: 24px; margin: 0 0 8px; font-weight: 900; color: var(--ed-dark); }
.ed-success-card .ed-ref { margin: 0 0 16px; font-size: 16px; }
.ed-succes-desc { color: var(--ed-text-muted); margin: 0 auto 28px; max-width: 460px; }
.ed-success-ctas {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
}

/* ---------- Form shell ---------- */
.ed-form-shell {
  background: var(--ed-bg);
  border: 1px solid var(--ed-border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--ed-shadow);
}

.ed-header-bar {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: 28px 36px 20px;
  background: linear-gradient(135deg, #0A0D12 0%, #151A23 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.ed-header-bar::before {
  content: "";
  position: absolute; right: -60px; top: -60px;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(255,85,0,0.35), transparent 60%);
}
.ed-header-bar::after {
  content: "";
  position: absolute; left: 30%; bottom: -80px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,85,0,0.12), transparent 60%);
}
.ed-header-bar > * { position: relative; z-index: 1; }
.ed-kicker {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  background: rgba(255, 85, 0, 0.16);
  color: #FF8750;
  border: 1px solid rgba(255, 85, 0, 0.3);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.ed-header-bar h2 { font-size: clamp(22px, 2.6vw, 30px); margin: 0; font-weight: 900; letter-spacing: -0.02em; }
.ed-sub { color: #CBD5E1; margin: 6px 0 0; font-size: 13.5px; max-width: 620px; }
.ed-ref-badge {
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 12px; color: #E2E8F0;
  backdrop-filter: blur(6px);
  white-space: nowrap;
}

/* ---------- Progress ---------- */
.ed-progress-wrap {
  padding: 24px 36px 0;
  border-bottom: 1px solid var(--ed-border);
}
/* Compteur "ÉTAPE 01 SUR 06" (style capture de référence) */
.ed-step-count {
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ed-primary); margin-bottom: 8px;
}
.ed-progress-bar {
  height: 6px; background: var(--ed-bg-muted); border-radius: 999px; overflow: hidden;
  position: relative;
}
.ed-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ed-primary), #FF8A4C);
  transition: width 0.32s cubic-bezier(.4,0,.2,1);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(255,85,0,0.3);
}
.ed-steps-dots {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 14px;
  padding-bottom: 20px;
}
.ed-step-dot {
  background: transparent; border: 0; cursor: pointer; padding: 6px 2px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.ed-step-dot .dot-num {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 11px; font-weight: 900; font-family: ui-monospace, monospace;
  background: var(--ed-bg-muted); color: var(--ed-text-muted);
  transition: all 0.2s ease;
}
.ed-step-dot .dot-label {
  font-size: 10px; font-weight: 700; color: var(--ed-text-muted);
  text-align: center; line-height: 1.3;
  max-width: 120px;
}
.ed-step-dot.is-done  .dot-num { background: #10D48A; color: #fff; }
.ed-step-dot.is-active .dot-num {
  background: var(--ed-primary); color: #fff;
  box-shadow: 0 0 0 4px rgba(255,85,0,0.14);
  transform: scale(1.1);
}
.ed-step-dot.is-active .dot-label { color: var(--ed-primary); }

/* ---------- Steps & Fields ---------- */
.ed-form { padding: 36px; }
.ed-step { display: none; border: 0; padding: 0; margin: 0; }
.ed-step.is-current {
  display: block;
  animation: edFadeUp 0.3s cubic-bezier(.4,0,.2,1) both;
}
@keyframes edFadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ed-step-head {
  margin: 0 0 24px; padding: 0;
}
.ed-step-chip {
  display: inline-block;
  padding: 4px 12px;
  background: var(--ed-primary-soft);
  color: var(--ed-primary);
  border-radius: 999px;
  font-size: 11px; font-weight: 900;
  letter-spacing: 0.05em; text-transform: uppercase;
  margin-bottom: 10px;
}
.ed-step-head h3 {
  font-size: 22px; font-weight: 900; letter-spacing: -0.02em; margin: 0 0 6px;
  color: var(--ed-dark);
}
.ed-step-head p { margin: 0; color: var(--ed-text-muted); font-size: 13.5px; }

.ed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
}
.ed-field.is-full { grid-column: 1 / -1; }
.ed-field label {
  display: block;
  font-size: 12.5px; font-weight: 800; color: var(--ed-text);
  margin-bottom: 5px;
  letter-spacing: 0.005em;
}
.ed-req { color: var(--ed-primary); margin-left: 3px; }
.ed-ph {
  display: block;
  color: #94A3B8; font-size: 11px; margin-bottom: 6px;
  font-style: italic;
}
.ed-field-ctrl input,
.ed-field-ctrl textarea,
.ed-field-ctrl select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--ed-border);
  background: var(--ed-bg);
  color: var(--ed-text);
  font-size: 14px;
  border-radius: var(--ed-radius-sm);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  font-family: inherit;
}
.ed-field-ctrl textarea { resize: vertical; min-height: 108px; }
.ed-field-ctrl input:focus,
.ed-field-ctrl textarea:focus,
.ed-field-ctrl select:focus {
  outline: none;
  border-color: var(--ed-primary);
  box-shadow: 0 0 0 3px rgba(255,85,0,0.12);
  background: #fff;
}
.ed-field-ctrl input::placeholder,
.ed-field-ctrl textarea::placeholder { color: #94A3B8; }
.ed-field.has-error input,
.ed-field.has-error textarea,
.ed-field.has-error select {
  border-color: #EF4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.08);
  background: #FEF2F2;
}

/* Radios + Checkbox groups — cartes à icône (style capture de référence).
   Les labels d’options portent .ed-opt ; la case RGPD (.ed-chk-lg) garde
   son style simple ci-dessous. */
.ed-radios, .ed-chk-wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.ed-radio, .ed-chk {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius-sm);
  background: var(--ed-bg-muted);
  cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--ed-text);
  transition: all 0.16s ease;
  user-select: none;
}
.ed-radio:hover, .ed-chk:hover {
  border-color: rgba(255,85,0,0.4);
  background: #fff;
}
.ed-radio input, .ed-chk input {
  accent-color: var(--ed-primary);
  width: 16px; height: 16px; cursor: pointer;
}
.ed-opt {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--ed-border);
  border-radius: 14px;
  background: var(--ed-bg);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.12s ease;
  user-select: none;
}
.ed-opt:hover {
  border-color: rgba(255,85,0,0.5);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -8px rgba(255,85,0,0.35);
}
.ed-opt input { position: absolute; opacity: 0; pointer-events: none; }
.ed-opt-ic {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--ed-primary-soft); color: var(--ed-primary);
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.ed-opt:hover .ed-opt-ic { transform: scale(1.08); }
.ed-opt-tx { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ed-opt-tx b { font-size: 13.5px; font-weight: 800; color: var(--ed-text); line-height: 1.3; }
.ed-opt-tx small { font-size: 11.5px; color: var(--ed-text-muted); line-height: 1.4; }
.ed-opt-check {
  margin-left: auto; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ed-border); color: #fff;
  transform: scale(0.6); opacity: 0;
  transition: all 0.2s cubic-bezier(.34,1.56,.64,1);
}
/* État sélectionné : bordure accent + glow + coche animée */
.ed-opt:has(input:checked) {
  border-color: var(--ed-primary);
  background: var(--ed-primary-soft);
  box-shadow: 0 0 0 3px rgba(255,85,0,0.12), 0 8px 22px -10px rgba(255,85,0,0.45);
}
.ed-opt:has(input:checked) .ed-opt-ic { background: var(--ed-primary); color: #fff; }
.ed-opt:has(input:checked) .ed-opt-tx b { color: var(--ed-primary); }
.ed-opt:has(input:checked) .ed-opt-check { background: var(--ed-primary); transform: scale(1); opacity: 1; }
.ed-opt:has(input:focus-visible) { outline: 2px solid var(--ed-primary); outline-offset: 2px; }
.ed-chk-lg {
  padding: 14px 16px; font-size: 13.5px;
  background: var(--ed-primary-soft);
  border-color: rgba(255,85,0,0.25);
}

/* Error */
.ed-err {
  color: #EF4444;
  font-size: 11px; font-weight: 700;
  margin-top: 4px;
  min-height: 14px;
}

/* ---------- Summary ---------- */
.ed-summary {
  background: var(--ed-bg-muted);
  border: 1px solid var(--ed-border);
  border-radius: var(--ed-radius);
  padding: 20px;
  max-height: 440px;
  overflow-y: auto;
}
.ed-s-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0; border-bottom: 1px dashed #E2E8F0;
}
.ed-s-row:last-child { border-bottom: 0; }
.ed-s-row .k {
  flex: 0 0 38%; font-size: 11.5px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--ed-text-muted); line-height: 1.4;
}
.ed-s-row .v {
  flex: 1 1 auto; color: var(--ed-text); font-size: 13.5px;
}
.ed-s-chip-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-s-chip {
  background: var(--ed-primary-soft);
  color: var(--ed-primary);
  font-size: 11.5px; font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,85,0,0.18);
}

.ed-gdpr { margin: 18px 0 0; }

/* ---------- Nav (style capture : bouton Suivant pleine largeur) ---------- */
.ed-nav {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--ed-border);
  display: flex; flex-direction: column;
  gap: 12px;
}
.ed-nav-right { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.ed-nav .ed-next, .ed-nav .ed-submit { width: 100%; padding: 15px 20px; font-size: 14px; }
.ed-nav .ed-prev { align-self: flex-start; }
.ed-nav .ed-prev[disabled] { display: none; }
.ed-help {
  font-size: 11.5px; color: var(--ed-text-muted);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}

.ed-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13px; font-weight: 800;
  border: 0; cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.18s ease, background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}
.ed-btn:active { transform: scale(0.98); }
.ed-btn[disabled] { opacity: 0.42; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.ed-btn-primary {
  background: var(--ed-primary);
  color: #fff;
  box-shadow: 0 8px 20px -6px rgba(255, 85, 0, 0.55);
}
.ed-btn-primary:hover:not([disabled]) {
  background: var(--ed-primary-hover);
  box-shadow: 0 10px 28px -6px rgba(255, 85, 0, 0.65);
  transform: translateY(-1px);
}
.ed-btn-accent {
  background: linear-gradient(135deg, var(--ed-dark), #1E293B);
  color: #fff;
  box-shadow: 0 8px 22px -6px rgba(10, 13, 18, 0.55);
}
.ed-btn-accent:hover:not([disabled]) {
  background: var(--ed-primary);
  box-shadow: 0 10px 28px -6px rgba(255, 85, 0, 0.55);
}
.ed-btn-ghost {
  background: transparent;
  color: var(--ed-text);
  border: 1px solid var(--ed-border);
}
.ed-btn-ghost:hover:not([disabled]) {
  border-color: var(--ed-primary);
  color: var(--ed-primary);
  background: var(--ed-primary-soft);
}

.is-submitting .ed-submit { pointer-events: none; opacity: 0.85; }
.is-submitting .ed-submit::after {
  content: "";
  display: inline-block;
  width: 14px; height: 14px; margin-left: 8px;
  border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff;
  border-radius: 50%;
  animation: edSpin 0.7s linear infinite;
}
@keyframes edSpin { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .ed-wrap { margin: 24px 0; padding: 0; }
  .ed-form-shell { border-radius: 12px; }
  .ed-header-bar { padding: 22px 20px 16px; }
  .ed-progress-wrap { padding: 20px 20px 0; }
  .ed-form { padding: 24px 20px; }
  .ed-grid { grid-template-columns: 1fr; }
  .ed-steps-dots .dot-label { display: none; }
  .ed-steps-dots { grid-template-columns: repeat(6, 1fr); }
  .ed-step-head h3 { font-size: 19px; }
  .ed-nav { gap: 12px; }
  .ed-btn { width: 100%; padding: 13px; }
  .ed-radios, .ed-chk-wrap { grid-template-columns: 1fr; }
  .ed-opt-ic { width: 34px; height: 34px; }
  .ed-summary { max-height: 380px; padding: 14px; }
  .ed-s-row { flex-direction: column; gap: 2px; padding: 12px 0; }
  .ed-s-row .k { flex: none; width: 100%; }
}

/* Light / Dark respect system preference subtly */
@media (prefers-color-scheme: dark) {
  body .ed-form-shell,
  body .ed-field-ctrl input,
  body .ed-field-ctrl textarea,
  body .ed-field-ctrl select,
  body .ed-summary { background: #12161F; color: #E2E8F0; }
  body .ed-progress-bar { background: #1F2633; }
  body .ed-field-ctrl input::placeholder { color: #64748B; }
  body .ed-form-shell { border-color: #1F2633; }
  body .ed-progress-wrap { border-color: #1F2633; }
  body .ed-step-head h3, body .ed-header-bar h2 { color: #F8FAFC; }
  body .ed-s-summary { color: #CBD5E1; }
  body .ed-radio, body .ed-chk { background: #151A24; border-color: #1F2633; color: #E2E8F0; }
  body .ed-radio:hover, body .ed-chk:hover { border-color: rgba(255,85,0,0.4); background: #1A1F2B; }
  body .ed-opt { background: #151A24; border-color: #1F2633; }
  body .ed-opt-tx b { color: #E2E8F0; }
  body .ed-step-count { color: #FF8750; }
}
