/* =============================================================================
   DIRECTSDEVIS — SIMULATEUR ENGINE v3.0
   Feuille de style COMMUNE à tous les simulateurs (standalone PHP pages)
   =============================================================================
   Préfixe : .ddx-sim-  (évite tout conflit avec le thème WP)
   ============================================================================= */

/* --- Variables par défaut (surchargées par chaque simulateur via JS) --- */
:root {
  --sim-primary: #FF6B35;
  --sim-dark: #D4531E;
  --sim-light: #FFF5F0;
  --sim-accent: #FF8C42;
  --sim-bg-panel: #F5F0EB;
  --sim-bg-card: #FFFFFF;
  --sim-text: #FFFFFF;
  --sim-text-dark: #1A252F;
  --sim-text-body: #2C3E50;
  --sim-text-muted: rgba(44, 62, 80, 0.55);
  --sim-border: rgba(0, 0, 0, 0.08);
  --sim-radius: 14px;
  --sim-radius-lg: 20px;
  --sim-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  --sim-transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================================================================
   0. PAGE STANDALONE — Layout de la page simulateur
   ============================================================================= */
.ddx-page {
  background: #2C3E50;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: #FFFFFF;
  margin: 0;
  padding: 0;
  position: relative;
  overflow: hidden;
}

/* Vignettage subtil — limité au wrapper simulateur (pas au header/footer WP) */
.ddx-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.25) 100%);
  pointer-events: none;
  z-index: 0;
}

.ddx-page > * {
  position: relative;
  z-index: 1;
}

/* Wrapper blanc pleine largeur pour le contenu SEO sous le simulateur */
.ddx-page-seo-wrapper {
  background: #FFFFFF;
  width: 100%;
  font-size: 125%;
}

/* --- Top bar --- */
.ddx-page-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 32px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.ddx-page-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #FFFFFF;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 12px;
  background: rgba(255, 107, 53, 0.15);
  border: 2px solid rgba(255, 107, 53, 0.5);
  transition: all 0.3s ease;
}

.ddx-page-back:hover {
  background: #FF6B35;
  border-color: #FF6B35;
  color: #FFFFFF;
  transform: translateX(-3px);
  box-shadow: 0 4px 20px rgba(255, 107, 53, 0.4);
}

.ddx-page-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.ddx-page-brand-logo {
  height: 44px;
  width: auto;
  display: block;
}

/* --- Hero / Landing (visible quand le panel est fermé) --- */
.ddx-page-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 72px);
  padding: 40px 32px;
  text-align: center;
}

.ddx-page-hero.hidden {
  display: none;
}

@keyframes ddxFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.ddx-page-hero-icon {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ddxFloat 4s ease-in-out infinite;
  color: rgba(255, 255, 255, 0.85);
  filter: drop-shadow(0 4px 12px rgba(93, 173, 226, 0.35));
}

.ddx-page-hero-icon svg {
  width: 72px;
  height: 72px;
}

.ddx-page-hero-title {
  font-size: 48px;
  font-weight: 900;
  margin: 0 0 18px;
  line-height: 1.15;
}

.ddx-page-hero-subtitle {
  font-size: 21px;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 12px;
  max-width: 600px;
  line-height: 1.65;
}

/* Ligne de réassurance "Gratuit · Sans engagement · 2 minutes" */
.ddx-page-hero-trust {
  font-size: 15px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 40px;
}

/* --- Bouton identitaire simulateurs : cercle orange 190×190 --- */
.ddx-sim-launch-circle {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: #FF6B35;
  border: 4px solid rgba(255, 255, 255, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  cursor: pointer;
  color: #FFFFFF;
  font-family: inherit;
  text-decoration: none;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow:
    0 8px 32px rgba(255, 107, 53, 0.45),
    0 0 0 6px rgba(255, 107, 53, 0.15);
  animation: ddxLaunchPulse 3s ease-in-out infinite;
  margin-bottom: 36px;
}

.ddx-sim-launch-circle:hover {
  transform: scale(1.08);
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow:
    0 12px 48px rgba(255, 107, 53, 0.65),
    0 0 0 10px rgba(255, 107, 53, 0.25);
  animation: none;
}

.ddx-sim-launch-text {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Petit texte "Gratuit" sous le CTA dans le cercle */
.ddx-sim-launch-sub {
  font-size: 12px;
  font-weight: 600;
  font-style: italic;
  opacity: 0.85;
  margin-top: 4px;
  letter-spacing: 0.03em;
}

@keyframes ddxLaunchPulse {
  0%, 100% {
    box-shadow: 0 8px 32px rgba(255, 107, 53, 0.45), 0 0 0 6px rgba(255, 107, 53, 0.15);
  }
  50% {
    box-shadow: 0 8px 48px rgba(255, 107, 53, 0.7), 0 0 0 10px rgba(255, 107, 53, 0.25);
    transform: scale(1.03);
  }
}

/* --- Lien retour (dans le hero) --- */
.ddx-page-hero-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #FFFFFF;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 28px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.ddx-page-hero-back:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  color: #FFFFFF;
  transform: translateX(-3px);
}

/* =============================================================================
   1. CTA CIRCLE BUTTON — Bouton flottant 150×150 (pour pages WP)
   ============================================================================= */
.ddx-sim-cta-circle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 150px;
  height: 150px;
  background: linear-gradient(135deg, #FFB800 0%, #FFC107 100%);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px;
  cursor: pointer;
  z-index: 9990;
  box-shadow:
    0 8px 32px rgba(255, 184, 0, 0.5),
    0 0 0 4px rgba(44, 62, 80, 0.8),
    0 0 0 8px rgba(255, 184, 0, 0.2);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
  animation: ddxSimPulse 3s ease-in-out infinite;
  border: none;
  color: var(--sim-text-dark);
  font-family: inherit;
}

.ddx-sim-cta-circle:hover {
  transform: scale(1.1);
  box-shadow:
    0 16px 48px rgba(255, 184, 0, 0.7),
    0 0 0 4px #FF6B35,
    0 0 0 8px rgba(255, 107, 53, 0.3);
}

.ddx-sim-cta-icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 2px;
  display: block;
}

.ddx-sim-cta-text {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.ddx-sim-cta-text strong {
  font-size: 14px;
  display: block;
  letter-spacing: 0.04em;
}

.ddx-sim-cta-text small {
  font-size: 10px;
  font-weight: 600;
  opacity: 0.75;
  display: block;
  margin-top: 2px;
  text-transform: none;
}

@keyframes ddxSimPulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(255, 184, 0, 0.5), 0 0 0 4px rgba(44, 62, 80, 0.8), 0 0 0 8px rgba(255, 184, 0, 0.2); }
  50%      { box-shadow: 0 8px 48px rgba(255, 184, 0, 0.8), 0 0 0 4px rgba(44, 62, 80, 0.9), 0 0 0 12px rgba(255, 184, 0, 0.35); transform: scale(1.04); }
}

/* =============================================================================
   2. OVERLAY — Fond sombre derrière le panel
   ============================================================================= */
.ddx-sim-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 9995;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--sim-transition), visibility var(--sim-transition);
  backdrop-filter: blur(4px);
}

.ddx-sim-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* =============================================================================
   3. PANEL CENTRÉ — Panneau central (type modale)
   ============================================================================= */
.ddx-sim-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 94%;
  max-width: 920px;
  height: 92vh;
  height: 92dvh;
  background: var(--sim-bg-panel);
  z-index: 9996;
  transform: translate(-50%, -50%) scale(0.92);
  opacity: 0;
  visibility: hidden;
  transition: transform var(--sim-transition), opacity var(--sim-transition), visibility var(--sim-transition);
  color: var(--sim-text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--sim-radius-lg);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.ddx-sim-panel.active {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  visibility: visible;
}

/* --- Header --- */
.ddx-sim-header {
  background: linear-gradient(135deg, #FF6B35, #D4531E);
  padding: 24px 28px 20px;
  flex-shrink: 0;
  color: #FFFFFF;
  position: relative;
  z-index: 5;
}

.ddx-sim-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.ddx-sim-title {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
  line-height: 1.3;
}

.ddx-sim-title-icon {
  margin-right: 8px;
  font-size: 24px;
}

.ddx-sim-close {
  background: rgba(0, 0, 0, 0.25);
  border: none;
  color: #000000;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.ddx-sim-close:hover {
  background: rgba(0, 0, 0, 0.4);
  transform: scale(1.1);
}

/* --- Progress bar --- */
.ddx-sim-progress {
  background: rgba(255, 255, 255, 0.15);
  height: 6px;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 8px;
}

.ddx-sim-progress-fill {
  background: linear-gradient(90deg, #FFFFFF, rgba(255, 255, 255, 0.6));
  height: 100%;
  width: 0%;
  transition: width 0.5s ease;
  border-radius: 20px;
}

.ddx-sim-progress-text {
  font-size: 12px;
  opacity: 0.8;
  font-weight: 600;
}

/* --- Body (scrollable steps) — fond crème, texte sombre --- */
.ddx-sim-body {
  flex: 1;
  overflow-y: auto;
  padding: 32px 28px 120px;
  scroll-behavior: smooth;
  background: var(--sim-bg-panel);
  color: var(--sim-text-body);
}

/* --- Step container --- */
.ddx-sim-step-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px 0;
  line-height: 1.3;
  color: var(--sim-text-dark);
}

.ddx-sim-step-subtitle {
  font-size: 14px;
  color: var(--sim-text-muted);
  margin: 0 0 28px 0;
  line-height: 1.5;
}

/* --- Navigation (fixed bottom of panel) --- */
.ddx-sim-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 12px;
  padding: 16px 28px;
  background: linear-gradient(to top, var(--sim-bg-panel) 60%, transparent);
  z-index: 5;
}

.ddx-sim-btn {
  padding: 14px 24px;
  border: none;
  border-radius: var(--sim-radius);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  flex: 1;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
}

.ddx-sim-btn-prev {
  background: rgba(44, 62, 80, 0.08);
  color: #2C3E50;
  flex: 0 0 auto;
  padding: 14px 20px;
  border: 2px solid rgba(44, 62, 80, 0.15);
}

.ddx-sim-btn-prev:hover {
  background: rgba(44, 62, 80, 0.12);
  border-color: rgba(44, 62, 80, 0.25);
}

.ddx-sim-btn-next {
  background: linear-gradient(135deg, #FF6B35, #D4531E);
  color: white;
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.35);
}

.ddx-sim-btn-next:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(255, 107, 53, 0.5);
}

.ddx-sim-btn-next:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  filter: none;
  box-shadow: none;
}

/* Animation attention sur le bouton Suivant */
.ddx-sim-btn-attention {
  animation: ddxSimBtnPulse 0.6s ease-in-out 2;
}

@keyframes ddxSimBtnPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); box-shadow: 0 0 20px rgba(255, 107, 53, 0.5); }
}

/* =============================================================================
   4. CARDS — Choix radio (simple sélection)
   ============================================================================= */
.ddx-sim-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ddx-sim-card {
  background: var(--sim-bg-card);
  color: var(--sim-text-dark);
  border-radius: var(--sim-radius);
  padding: 18px 20px;
  cursor: pointer;
  border: 3px solid rgba(0, 0, 0, 0.06);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ddx-sim-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255, 107, 53, 0.12);
  border-color: rgba(255, 107, 53, 0.25);
}

.ddx-sim-card.selected {
  border-color: #FF6B35;
  background: #FFF5F0;
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.15);
}

.ddx-sim-card-icon {
  font-size: 26px;
  flex-shrink: 0;
  min-width: 52px;
  text-align: center;
  color: #1a1a1a;
  letter-spacing: -2px;
  line-height: 1;
}

.ddx-sim-card-content {
  flex: 1;
  min-width: 0;
}

.ddx-sim-card-label {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}

.ddx-sim-card-desc {
  font-size: 13px;
  color: #7f8c8d;
  line-height: 1.4;
}

.ddx-sim-card-radio {
  width: 22px;
  height: 22px;
  border: 3px solid #D0D0D0;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.2s;
}

.ddx-sim-card.selected .ddx-sim-card-radio {
  border-color: #FF6B35;
}

.ddx-sim-card.selected .ddx-sim-card-radio::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: #FF6B35;
  border-radius: 50%;
}

/* Option désactivée (ex: "Professionnel — Bientôt") */
.ddx-sim-card-disabled {
  opacity: 0.4;
  cursor: not-allowed !important;
  pointer-events: none;
  filter: grayscale(0.6);
}

.ddx-sim-card-badge {
  display: inline-block;
  background: var(--sim-primary, #FF6B35);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 8px;
  margin-left: 6px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* =============================================================================
   5. CHECKBOXES — Choix multiples
   ============================================================================= */
.ddx-sim-checks {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ddx-sim-check {
  background: var(--sim-bg-card);
  color: var(--sim-text-dark);
  border-radius: var(--sim-radius);
  padding: 16px 18px;
  cursor: pointer;
  border: 3px solid rgba(0, 0, 0, 0.06);
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ddx-sim-check:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.12);
  border-color: rgba(255, 107, 53, 0.25);
}

.ddx-sim-check.selected {
  border-color: #FF6B35;
  background: #FFF5F0;
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.15);
}

.ddx-sim-check-box {
  width: 22px;
  height: 22px;
  border: 3px solid #D0D0D0;
  border-radius: 6px;
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s;
}

.ddx-sim-check.selected .ddx-sim-check-box {
  background: #FF6B35;
  border-color: #FF6B35;
}

.ddx-sim-check.selected .ddx-sim-check-box::after {
  content: '✓';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 14px;
  font-weight: 800;
}

.ddx-sim-check-icon {
  font-size: 24px;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}

.ddx-sim-check-label {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
}

/* =============================================================================
   6. SLIDER — Curseur surface (m²)
   ============================================================================= */
.ddx-sim-slider-wrap {
  padding: 12px 0;
}

.ddx-sim-slider-value {
  text-align: center;
  font-size: 48px;
  font-weight: 900;
  color: #FF6B35;
  margin-bottom: 8px;
  line-height: 1;
}

.ddx-sim-slider-unit {
  font-size: 20px;
  font-weight: 600;
  color: rgba(44, 62, 80, 0.5);
}

.ddx-sim-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: rgba(44, 62, 80, 0.12);
  border-radius: 10px;
  outline: none;
  margin: 24px 0;
}

.ddx-sim-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF8C42, #FF6B35);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
  border: 3px solid white;
  transition: transform 0.2s;
}

.ddx-sim-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.ddx-sim-slider::-moz-range-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FF8C42, #FF6B35);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
  border: 3px solid white;
}

.ddx-sim-slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--sim-text-muted);
  font-weight: 600;
}

/* =============================================================================
   6b. COUNTERS — Composition pièces (+/- par type)
   ============================================================================= */
.ddx-sim-counters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
}

.ddx-sim-counter {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--sim-bg-card);
  color: var(--sim-text-dark);
  border: 1px solid var(--sim-border);
  border-radius: var(--sim-radius);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.ddx-sim-counter:hover {
  border-color: var(--sim-primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.ddx-sim-counter-icon {
  font-size: 22px;
  flex-shrink: 0;
  width: 32px;
  text-align: center;
}

.ddx-sim-counter-label {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--sim-text-dark);
}

.ddx-sim-counter-controls {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(0,0,0,0.05);
  border: 1px solid var(--sim-border);
  border-radius: 10px;
  overflow: hidden;
}

.ddx-sim-counter-btn {
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  color: var(--sim-primary);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ddx-sim-counter-btn:hover:not(:disabled) {
  background: rgba(0,0,0,0.06);
}
.ddx-sim-counter-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.ddx-sim-counter-value {
  min-width: 32px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--sim-text-dark);
  user-select: none;
}

/* Toggle (Oui/Non) */
.ddx-sim-counter-toggle {
  display: flex;
  gap: 0;
  background: rgba(0,0,0,0.05);
  border: 1px solid var(--sim-border);
  border-radius: 10px;
  overflow: hidden;
}

.ddx-sim-counter-tbtn {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--sim-text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.ddx-sim-counter-tbtn.active {
  background: var(--sim-primary);
  color: #fff;
}
.ddx-sim-counter-tbtn:hover:not(.active) {
  background: rgba(0,0,0,0.04);
  color: var(--sim-text-body);
}

/* =============================================================================
   7. LOADING — Écran de chargement (faux calcul)
   ============================================================================= */
.ddx-sim-loading {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 30px;
  text-align: center;
  min-height: 300px;
}

.ddx-sim-loading.active {
  display: flex;
}

.ddx-sim-loading-spinner {
  width: 64px;
  height: 64px;
  border: 5px solid rgba(44, 62, 80, 0.1);
  border-top-color: #FF6B35;
  border-radius: 50%;
  animation: ddxSimSpin 0.8s linear infinite;
  margin-bottom: 28px;
}

@keyframes ddxSimSpin {
  to { transform: rotate(360deg); }
}

.ddx-sim-loading-text {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 24px;
  min-height: 28px;
  color: var(--sim-text-dark);
}

.ddx-sim-loading-bar {
  width: 260px;
  max-width: 100%;
  height: 6px;
  background: rgba(44, 62, 80, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.ddx-sim-loading-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #FF8C42, #FF6B35);
  border-radius: 10px;
  transition: width 0.3s linear;
}

/* =============================================================================
   8. RESULT MODAL — Layout 2 colonnes (sidebar + détail)
   ============================================================================= */
.ddx-sim-result-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(6px);
}

.ddx-sim-result-overlay.active {
  display: flex;
}

.ddx-sim-result-modal {
  background: #FFFFFF;
  border-radius: var(--sim-radius-lg);
  width: 100%;
  max-width: 1280px;
  max-height: 94vh;
  max-height: 94dvh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
  color: var(--sim-text-dark);
  animation: ddxSimModalIn 0.4s ease-out;
  overflow: hidden;
  position: relative;
}

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

/* --- Modal header (full width — orange fixe DirectsDevis) --- */
.ddx-sim-result-header {
  background: linear-gradient(135deg, #FF6B35, #D4531E);
  color: white;
  padding: 12px 28px 18px;
  position: relative;
  flex-shrink: 0;
}

/* www.DirectsDevis.lu — centré en haut */
.ddx-sim-result-url {
  display: block;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
}

.ddx-sim-result-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0, 0, 0, 0.25);
  border: none;
  color: #000000;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 2;
}

.ddx-sim-result-close:hover {
  background: rgba(0, 0, 0, 0.4);
  transform: scale(1.1);
}

/* Logo DD dans ovale gris béton — à droite */
.ddx-sim-result-logo-circle {
  position: absolute;
  top: 50%;
  right: 60px;
  transform: translateY(-50%);
  width: 132px;
  height: 58px;
  background: #2A3C4D;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.15);
}
.ddx-sim-result-logo-circle img {
  height: 21px;
  width: auto;
  filter: brightness(1.1);
}

.ddx-sim-result-title {
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 4px 0;
}

.ddx-sim-result-subtitle {
  font-size: 14px;
  opacity: 0.85;
  margin: 0;
  max-width: calc(100% - 130px);
}

/* --- Content area : 2 columns --- */
.ddx-sim-result-content {
  display: flex;
  flex: 1;
  min-height: 0; /* allow flex children to shrink */
  overflow: hidden;
}

/* ─── SIDEBAR (gauche — 300px, police majorée) ─── */
.ddx-sim-result-sidebar {
  flex: 0 0 300px;
  background: #2C3E50;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  padding: 28px 24px;
  overflow-y: auto;
  gap: 0;
}

/* Sidebar disclaimer — protecteur / légal */
.ddx-sim-result-sidebar-disclaimer {
  flex: 1;
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.ddx-sim-result-sidebar-disclaimer .ddx-disclaimer-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: #FFC107;
  margin-bottom: 10px;
}

.ddx-sim-result-sidebar-disclaimer p {
  margin: 0 0 8px;
}

.ddx-sim-result-sidebar-disclaimer .ddx-disclaimer-warn {
  color: #FFC107;
  font-weight: 700;
}

/* Sidebar CTA — imposant */
.ddx-sim-result-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #27AE60, #219a52);
  color: white;
  text-decoration: none;
  border-radius: 14px;
  font-weight: 800;
  font-size: 16px;
  line-height: 1.35;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
  border: none;
  cursor: pointer;
  text-align: center;
}

.ddx-sim-result-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(39, 174, 96, 0.5);
  filter: brightness(1.05);
  color: white;
  text-decoration: none;
}

.ddx-sim-result-restart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 16px;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  width: 100%;
}

.ddx-sim-result-restart:hover {
  border-color: #FF6B35;
  color: #FF6B35;
}

/* ─── LEAD CAPTURE (sidebar) ─── */
.ddx-sim-lead-separator {
  border-top: 1px solid rgba(0,0,0,0.08);
  margin: 20px 0 16px;
}
.ddx-sim-lead-icon {
  font-size: 28px;
  text-align: center;
  margin-bottom: 4px;
}
.ddx-sim-lead-title {
  font-size: 15px;
  font-weight: 800;
  color: #1a1a2e;
  text-align: center;
  margin: 0 0 2px;
}
.ddx-sim-lead-subtitle {
  font-size: 13px;
  color: #555;
  text-align: center;
  margin: 0 0 12px;
  line-height: 1.4;
}
.ddx-sim-lead-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ddx-sim-lead-input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #ddd;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
  color: #222;
}
.ddx-sim-lead-input:focus {
  border-color: #FF6B35;
}
.ddx-sim-lead-input::placeholder {
  color: #aaa;
}
.ddx-sim-lead-submit {
  width: 100%;
  padding: 10px 16px;
  background: linear-gradient(135deg, #0052CC, #0066FF);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.ddx-sim-lead-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,102,255,0.35);
}
.ddx-sim-lead-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}
.ddx-sim-lead-privacy {
  font-size: 11px;
  color: #999;
  text-align: center;
  margin: 4px 0 0;
}
.ddx-sim-lead-success .ddx-sim-lead-icon {
  font-size: 32px;
}
.ddx-sim-lead-success .ddx-sim-lead-title {
  color: #27ae60;
}
.ddx-sim-lead-success .ddx-sim-lead-subtitle {
  color: #666;
  font-size: 12px;
}

/* ─── LEAD INLINE (dans le contenu principal, sous le total) ─── */
.ddx-sim-lead-inline {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: linear-gradient(135deg, #EBF5FF, #F0F8FF);
  border: 2px solid #CCE5FF;
  border-radius: 14px;
  padding: 20px 24px;
  margin: 24px 0;
}
.ddx-sim-lead-inline .ddx-sim-lead-title {
  text-align: left;
  color: #1a1a2e;
  font-size: 16px;
  margin: 0 0 4px;
}
.ddx-sim-lead-inline .ddx-sim-lead-subtitle {
  text-align: left;
  color: #555;
  font-size: 13px;
  margin: 0 0 12px;
}
.ddx-sim-lead-inline .ddx-sim-lead-privacy {
  text-align: left;
}
.ddx-sim-lead-inline-icon {
  font-size: 36px;
  flex-shrink: 0;
  margin-top: 4px;
}
.ddx-sim-lead-inline-body {
  flex: 1;
  min-width: 0;
}
.ddx-sim-lead-form-inline {
  flex-direction: row !important;
  gap: 8px !important;
}
.ddx-sim-lead-form-inline .ddx-sim-lead-input {
  flex: 1;
  min-width: 0;
}
.ddx-sim-lead-form-inline .ddx-sim-lead-submit {
  width: auto;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ─── EN-TÊTES COLONNES (style devis) ─── */
.ddx-sim-result-colheaders {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 2px solid #2C3E50;
  margin-bottom: 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #2C3E50;
}
.ddx-sim-result-colheader-label {
  flex: 1;
}
.ddx-sim-result-colheader-detail {
  width: 140px;
  text-align: right;
  padding-right: 16px;
  color: #7f8c8d;
}
.ddx-sim-result-colheader-price {
  width: 80px;
  text-align: right;
}

/* ─── TOTAL EN BAS (style devis) ─── */
.ddx-sim-result-total-bottom {
  margin-top: 24px;
  padding: 20px 0;
  border-top: 3px solid #2C3E50;
}
.ddx-sim-result-total-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ddx-sim-result-total-bottom-label {
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #2C3E50;
}
.ddx-sim-result-total-bottom-price {
  font-size: 32px;
  font-weight: 900;
  color: var(--sim-primary, #FF6B35);
}
.ddx-sim-result-total-bottom-range {
  text-align: right;
  font-size: 13px;
  font-weight: 600;
  color: #7f8c8d;
  margin-top: 6px;
}

/* ─── MAIN (droite — scrollable) ─── */
.ddx-sim-result-main {
  flex: 1;
  padding: 24px 28px;
  overflow-y: auto;
  min-width: 0;
  position: relative;
}

/* --- Category group --- */
.ddx-sim-result-cat {
  margin-bottom: 20px;
}

.ddx-sim-result-cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 2px solid #FFF5F0;
  margin-bottom: 6px;
}

.ddx-sim-result-cat-title {
  font-size: 17px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #FF6B35;
}

.ddx-sim-result-cat-subtotal {
  font-size: 17px;
  font-weight: 800;
  color: #D4531E;
  white-space: nowrap;
}

/* --- Detail line --- */
.ddx-sim-result-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 16px;
  border-bottom: 1px solid #f5f5f5;
  gap: 10px;
}

.ddx-sim-result-line:last-child {
  border-bottom: none;
}

.ddx-sim-result-line-label {
  flex: 1;
  min-width: 0;
  padding-right: 10px;
  color: #444;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ddx-sim-result-line-qty {
  font-size: 14px;
  color: #999;
  margin-right: 8px;
  white-space: nowrap;
}

.ddx-sim-result-line-price {
  font-weight: 700;
  font-size: 17px;
  white-space: nowrap;
  color: var(--sim-text-dark);
}

/* --- Tooltip Info ⓘ --- */
.ddx-sim-tip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: transparent;
  color: #0066FF;
  border: 2px solid #0066FF;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
}

.ddx-sim-tip-btn:hover {
  background: #0066FF;
  color: #fff;
  border-color: #0066FF;
  transform: scale(1.2);
  box-shadow: 0 0 8px rgba(0, 102, 255, 0.4);
}

/* Popup — position fixe centrée écran, fond bleu électrique */
.ddx-sim-tip-popup {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 420px;
  max-width: 90vw;
  background: linear-gradient(135deg, #0052CC, #0066FF);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 102, 255, 0.2);
  padding: 24px 26px 22px;
  z-index: 10010;
  animation: ddxTipIn 0.25s ease-out;
}

.ddx-sim-tip-popup.active {
  display: block;
}

/* Overlay derrière le popup pour focus */
.ddx-sim-tip-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 10009;
}
.ddx-sim-tip-overlay.active {
  display: block;
}

@keyframes ddxTipIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.ddx-sim-tip-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
}

.ddx-sim-tip-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

.ddx-sim-tip-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 8px;
}

.ddx-sim-tip-content {
  font-size: 15px;
  line-height: 1.7;
  color: #FFFFFF;
  padding-right: 24px;
}

/* --- Chart — Répartition par catégorie (en bas) --- */
.ddx-sim-result-chart {
  margin-top: 24px;
  padding: 20px 0 0;
  border-top: 2px solid #f0f0f0;
}

.ddx-sim-result-chart-title {
  font-size: 17px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #2C3E50;
  margin: 0 0 14px 0;
}

.ddx-sim-result-chart-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.ddx-sim-result-chart-label {
  flex: 0 0 160px;
  font-size: 14px;
  font-weight: 600;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ddx-sim-result-chart-bar-wrap {
  flex: 1;
  height: 16px;
  background: #f0f0f0;
  border-radius: 8px;
  overflow: hidden;
  min-width: 40px;
}

.ddx-sim-result-chart-bar {
  height: 100%;
  border-radius: 8px;
  min-width: 4px;
  transition: width 0.6s ease-out;
}

.ddx-sim-result-chart-val {
  flex: 0 0 120px;
  font-size: 14px;
  font-weight: 700;
  color: #2C3E50;
  text-align: right;
  white-space: nowrap;
}

/* =============================================================================
   9. RESPONSIVE
   ============================================================================= */
@media (max-width: 768px) {
  /* CTA circle (page WP) */
  .ddx-sim-cta-circle {
    width: 120px;
    height: 120px;
    bottom: 16px;
    right: 16px;
    padding: 10px;
  }
  .ddx-sim-cta-icon { font-size: 22px; }
  .ddx-sim-cta-text { font-size: 9px; }
  .ddx-sim-cta-text strong { font-size: 12px; }

  /* Panel centré → plein écran mobile */
  .ddx-sim-panel {
    width: 100%;
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
  }
  .ddx-sim-header { padding: 18px 20px 16px; }
  .ddx-sim-title { font-size: 17px; }
  .ddx-sim-body { padding: 24px 20px 110px; }
  .ddx-sim-nav { padding: 12px 20px; }
  .ddx-sim-step-title { font-size: 19px; }

  /* Result modal — mobile : sidebar en haut (simplifiée), détail en bas */
  .ddx-sim-result-modal { max-height: 96vh; border-radius: 14px; max-width: 98vw; }
  .ddx-sim-result-header { padding: 10px 16px 14px; }
  .ddx-sim-result-url { font-size: 10px; margin-bottom: 6px; }
  .ddx-sim-result-logo-circle { width: 90px; height: 38px; right: 50px; }
  .ddx-sim-result-logo-circle img { height: 16px; }
  .ddx-sim-result-title { font-size: 18px; }
  .ddx-sim-result-subtitle { font-size: 12px; }
  .ddx-sim-result-content { flex-direction: column; }
  .ddx-sim-result-sidebar {
    flex: 0 0 auto;
    padding: 14px 16px;
    flex-direction: column;
    gap: 10px;
  }
  .ddx-sim-result-sidebar-disclaimer { display: none; }
  .ddx-sim-result-cta { flex: 1 0 140px; padding: 12px; font-size: 13px; }
  .ddx-sim-result-restart { margin-top: 0; flex: 0 0 auto; padding: 10px 14px; font-size: 12px; }
  .ddx-sim-result-main { padding: 16px; }
  /* Colonnes devis mobile */
  .ddx-sim-result-colheaders { font-size: 10px; }
  .ddx-sim-result-colheader-detail { display: none; }
  .ddx-sim-result-colheader-price { width: 60px; }
  /* Total bottom mobile */
  .ddx-sim-result-total-bottom-label { font-size: 15px; }
  .ddx-sim-result-total-bottom-price { font-size: 26px; }
  .ddx-sim-result-total-bottom-range { font-size: 12px; }
  /* Lead inline mobile */
  .ddx-sim-lead-inline { flex-direction: column; padding: 16px; gap: 10px; }
  .ddx-sim-lead-form-inline { flex-direction: column !important; }
  .ddx-sim-result-line { font-size: 13px; padding: 6px 0; }
  .ddx-sim-result-line-label { font-size: 13px; }
  .ddx-sim-result-line-price { font-size: 13px; }
  .ddx-sim-result-cat-title { font-size: 13px; }
  .ddx-sim-result-cat-subtotal { font-size: 13px; }
  .ddx-sim-result-chart-label { flex: 0 0 100px; font-size: 11px; }
  .ddx-sim-result-chart-val { flex: 0 0 90px; font-size: 11px; }
  .ddx-sim-result-chart-bar-wrap { height: 12px; }
  .ddx-sim-tip-popup { max-width: 92vw; width: 360px; }

  .ddx-sim-slider-value { font-size: 40px; }

  .ddx-sim-card { padding: 16px 16px; }
  .ddx-sim-check { padding: 14px 14px; }

  /* Page standalone */
  .ddx-page-topbar { padding: 12px 16px; }
  .ddx-page-back { font-size: 13px; padding: 10px 18px; }
  .ddx-page-brand-logo { height: 36px; }

  .ddx-page-hero { padding: 30px 20px; }
  .ddx-page-hero-title { font-size: 32px; }
  .ddx-page-hero-subtitle { font-size: 17px; }
  .ddx-page-hero-icon svg { width: 56px; height: 56px; }

  /* Bouton identitaire — ajustement mobile */
  .ddx-sim-launch-circle { width: 160px; height: 160px; }
  .ddx-sim-launch-text { font-size: 14px; }
}

@media (max-width: 400px) {
  .ddx-sim-cta-circle {
    width: 100px;
    height: 100px;
    bottom: 12px;
    right: 12px;
  }
  .ddx-sim-cta-text strong { font-size: 11px; }
  .ddx-sim-cta-text small { display: none; }

  .ddx-sim-launch-circle { width: 140px; height: 140px; }
  .ddx-page-hero-title { font-size: 26px; }
  .ddx-sim-launch-text { font-size: 12px; }
}
