/* ══════════════════════════════════════════════════════
   QUOTEX — Diagnostic Devis-Facture — Frontend CSS
   Typeform-style, charte QUOTEX
   ══════════════════════════════════════════════════════ */

:root {
  --qdx-primary:   #3D3D8F;
  --qdx-rose:      #E8547A;
  --qdx-navy:      #2D2D6B;
  --qdx-text:      #2D2D2D;
  --qdx-muted:     #6B7280;
  --qdx-border:    #E5E7EB;
  --qdx-bg:        #F8F8FC;
  --qdx-white:     #FFFFFF;
  --qdx-success:   #16a34a;
  --qdx-warning:   #d97706;
  --qdx-danger:    #dc2626;
  --qdx-radius:    10px;
  --qdx-radius-lg: 16px;
  --qdx-shadow:    0 4px 24px rgba(61,61,143,0.10);
}

/* ── Conteneur principal ── */
.qdx-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  color: var(--qdx-text);
  box-sizing: border-box;
}

/* Neutralise toute contrainte parente — Elementor, thème, widget */
#qdx-app {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  float: none !important;
  box-sizing: border-box !important;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  overflow: hidden;
  background: white;
}

/* Forcer sur tous les wrappers Elementor possibles */
.elementor-widget-shortcode,
.elementor-widget-shortcode .elementor-shortcode,
.elementor-widget-shortcode > div,
.elementor-element .elementor-widget-container,
.elementor-element .elementor-widget-container > *,
.wp-block-shortcode {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}


/* ── Barre de progression ── */
.qdx-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
  padding: 16px 36px 20px;
}
.qdx-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--qdx-border);
  border-radius: 99px;
  overflow: hidden;
}
.qdx-progress-fill {
  height: 100%;
  background: var(--qdx-rose);
  border-radius: 99px;
  width: 0%;
  transition: width 0.4s ease;
}
.qdx-progress-label {
  font-size: 12px;
  color: var(--qdx-muted);
  white-space: nowrap;
  min-width: 60px;
  text-align: right;
}

/* ── Écrans ── */
.qdx-screen {
  animation: qdxFadeIn 0.3s ease;
}

/* Padding interne pour les écrans sans split layout */
#qdx-screen-questions {
  padding: 32px 36px !important;
}
#qdx-screen-intro {
  padding: 0;
}
#qdx-screen-form {
  padding: 0;
}
#qdx-screen-results {
  padding: 28px 36px;
}
.qdx-screen.active { display: block !important; }

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

/* ══ INTRO ══ */

.qdx-btn-start {
  background: var(--qdx-rose);
  color: white;
  border: none;
  border-radius: var(--qdx-radius);
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.qdx-btn-start:hover { background: #d44468; transform: translateY(-1px); }
.qdx-btn-start:active { transform: scale(0.98); }

/* ══ QUESTIONS ══ */
.qdx-q-section {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--qdx-rose);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.qdx-q-section::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--qdx-rose);
  border-radius: 99px;
}
.qdx-q-text {
  font-size: 26px;
  font-weight: 600;
  color: var(--qdx-navy);
  line-height: 1.35;
  margin-bottom: 8px;
}
.qdx-q-sub {
  font-size: 15px;
  color: var(--qdx-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}
.qdx-choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

/* ── Choix : base ── */
/* Spécificité maximale pour battre le thème Elementor sur button:hover */
#qdx-app .qdx-choices .qdx-choice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  background: #ffffff !important;
  border: 1.5px solid #E5E7EB !important;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  color: #2D2D2D !important;
  -webkit-text-fill-color: #2D2D2D !important;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}

#qdx-app .qdx-choices .qdx-choice:hover {
  border-color: #3D3D8F !important;
  background: #EBEBF8 !important;
  color: #2D2D6B !important;
  -webkit-text-fill-color: #2D2D6B !important;
}

#qdx-app .qdx-choices .qdx-choice.selected {
  border-color: #3D3D8F !important;
  background: #EBEBF8 !important;
  color: #2D2D6B !important;
  -webkit-text-fill-color: #2D2D6B !important;
}

#qdx-app .qdx-choices .qdx-choice:active { transform: scale(0.99); }

/* Ancien sélecteur conservé pour compatibilité */
.qdx-choice { color: #2D2D2D; }
.qdx-choice:hover { color: #2D2D6B; background: #EBEBF8; }
.qdx-choice.selected { color: #2D2D6B; background: #EBEBF8; }

/* Label du choix — retour à la ligne */
#qdx-app .qdx-choices .qdx-choice .qdx-choice-label,
.qdx-choice-label {
  flex: 1;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  line-height: 1.45;
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
}

/* Navigation */
.qdx-nav {
  display: flex;
  gap: 10px;
  align-items: center;
}
.qdx-btn-next {
  background: var(--qdx-primary);
  color: white;
  border: none;
  border-radius: var(--qdx-radius);
  padding: 12px 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}
.qdx-btn-next:disabled { opacity: 0.35; cursor: not-allowed; }
.qdx-btn-next:not(:disabled):hover { background: var(--qdx-navy); }
.qdx-btn-back {
  background: transparent;
  color: var(--qdx-muted);
  border: 1px solid var(--qdx-border);
  border-radius: var(--qdx-radius);
  padding: 12px 20px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.qdx-btn-back:hover { background: var(--qdx-bg); }

/* ══ FORMULAIRE SPLIT ══ */
.qdx-form-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-radius: var(--qdx-radius-lg);
  overflow: hidden;
  border: 1px solid var(--qdx-border);
  min-height: 400px;
}
.qdx-form-left {
  background: white;
  padding: 32px 28px;
  border-right: 1px solid var(--qdx-border);
}
.qdx-form-right {
  background: linear-gradient(135deg, #2D2D6B 0%, #3D3D8F 60%, #5B4BA8 100%);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}
.qdx-form-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--qdx-navy);
  margin-bottom: 6px;
}
.qdx-form-sub {
  font-size: 13px;
  color: var(--qdx-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}

/* ── Carte aperçu ── */
.qdx-preview-card {
  background: white;
  border-radius: 10px;
  padding: 16px;
}
.qdx-preview-hdr {
  font-size: 9px;
  font-weight: 700;
  color: #3D3D8F;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-bottom: 8px;
  border-bottom: 2px solid #3D3D8F;
  margin-bottom: 12px;
}
.qdx-preview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.qdx-preview-label {
  font-size: 11px;
  color: #6B7280;
}
.qdx-preview-val {
  font-size: 13px;
  font-weight: 700;
}
.qdx-preview-bar-wrap {
  margin-bottom: 10px;
}
.qdx-preview-bar {
  height: 5px;
  background: #E5E7EB;
  border-radius: 99px;
  overflow: hidden;
}
.qdx-preview-bar-fill {
  height: 5px;
  border-radius: 99px;
  transition: width 0.8s ease;
}
.qdx-preview-blur {
  opacity: 0.6;
}

/* ── Teaser gain ── */
.qdx-preview-teaser {
  background: rgba(255,255,255,0.1);
  border: 0.5px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 12px 14px;
  text-align: center;
}
.qdx-preview-teaser-l {
  font-size: 9px;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.qdx-preview-teaser-v {
  font-size: 22px;
  font-weight: 800;
  color: white;
  margin-bottom: 4px;
  user-select: none;
}
.qdx-preview-teaser-s {
  font-size: 10px;
  color: rgba(255,255,255,0.75);
}
.qdx-preview-lock {
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 600px) {
  .qdx-form-split { grid-template-columns: 1fr; }
  .qdx-form-right { display: none; }
}
.qdx-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.qdx-field {
  margin-bottom: 18px;
}
.qdx-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--qdx-text);
  margin-bottom: 6px;
}
.qdx-field .req { color: var(--qdx-rose); }
.qdx-field input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--qdx-border);
  border-radius: var(--qdx-radius);
  font-size: 14px;
  color: var(--qdx-text);
  background: var(--qdx-white);
  transition: border-color 0.15s;
  outline: none;
  box-sizing: border-box;
}
.qdx-field input:focus { border-color: var(--qdx-primary); }
.qdx-rgpd {
  margin-bottom: 20px;
}
.qdx-check-label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--qdx-muted);
  line-height: 1.5;
  margin-bottom: 12px;
  cursor: pointer;
}
.qdx-check-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  accent-color: var(--qdx-primary);
  cursor: pointer;
}
.qdx-check-label a { color: var(--qdx-primary); }
.qdx-form-error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: var(--qdx-radius);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--qdx-danger);
  margin-bottom: 16px;
}
.qdx-btn-submit {
  width: 100%;
  background: var(--qdx-rose);
  color: white;
  border: none;
  border-radius: var(--qdx-radius);
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.qdx-btn-submit:hover { background: #d44468; }
.qdx-btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* ══ RÉSULTATS ══ */
.qdx-results-header {
  margin-bottom: 28px;
}
.qdx-results-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--qdx-navy);
  margin-bottom: 6px;
}
.qdx-results-sub {
  font-size: 14px;
  color: var(--qdx-muted);
}

/* Bloc maturité */
.qdx-block {
  background: var(--qdx-white);
  border: 1px solid var(--qdx-border);
  border-radius: var(--qdx-radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--qdx-shadow);
}
.qdx-block-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--qdx-primary);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--qdx-primary);
}
.qdx-mat-score {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.qdx-mat-val {
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
}
.qdx-mat-label {
  font-size: 15px;
  color: var(--qdx-muted);
}
.qdx-bar-track {
  height: 10px;
  background: var(--qdx-border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 16px;
}
.qdx-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 1s ease;
}
.qdx-mat-text {
  font-size: 14px;
  color: var(--qdx-text);
  line-height: 1.6;
  padding: 14px 16px;
  border-radius: var(--qdx-radius);
  border-left: 4px solid;
}

/* Couleurs maturité */
.qdx-mat-high   { color: var(--qdx-success); }
.qdx-mat-medium { color: var(--qdx-warning); }
.qdx-mat-low    { color: #f97316; }
.qdx-mat-critical { color: var(--qdx-danger); }

/* Risques */
.qdx-risk-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--qdx-radius);
  margin-bottom: 10px;
}
.qdx-risk-item.warning { background: #FFFBEB; border: 1px solid #FDE68A; }
.qdx-risk-item.danger  { background: #FEF2F2; border: 1px solid #FECACA; }
.qdx-risk-ico { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.qdx-risk-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.qdx-risk-item.warning .qdx-risk-title { color: var(--qdx-warning); }
.qdx-risk-item.danger  .qdx-risk-title { color: var(--qdx-danger); }
.qdx-risk-detail { font-size: 13px; color: var(--qdx-muted); line-height: 1.5; }
.qdx-risk-summary {
  font-size: 13px;
  color: var(--qdx-muted);
  margin-top: 8px;
}

/* Impact financier */
.qdx-impact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.qdx-impact-card {
  background: var(--qdx-bg);
  border-radius: var(--qdx-radius);
  padding: 16px;
  text-align: center;
}
.qdx-impact-label {
  font-size: 11px;
  color: var(--qdx-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}
.qdx-impact-val {
  font-size: 24px;
  font-weight: 700;
  color: var(--qdx-primary);
  margin-bottom: 4px;
}
.qdx-impact-note {
  font-size: 10px;
  color: #9CA3AF;
  line-height: 1.4;
}
.qdx-gain-box {
  background: var(--qdx-primary);
  border-radius: var(--qdx-radius);
  padding: 20px;
  text-align: center;
  margin-bottom: 10px;
}
.qdx-gain-label {
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.qdx-gain-val {
  font-size: 36px;
  font-weight: 700;
  color: white;
  margin-bottom: 4px;
}
.qdx-gain-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
}
.qdx-taux-note {
  font-size: 11px;
  color: #9CA3AF;
  font-style: italic;
  margin-top: 8px;
  text-align: center;
}

/* CTA */
.qdx-cta-block {
  background: linear-gradient(135deg, var(--qdx-navy), var(--qdx-primary));
  border-radius: var(--qdx-radius-lg);
  padding: 28px;
  text-align: center;
  margin-bottom: 16px;
}
.qdx-cta-title {
  font-size: 18px;
  font-weight: 700;
  color: white;
  margin-bottom: 10px;
}
.qdx-cta-text {
  font-size: 14px;
  color: rgba(255,255,255,0.82);
  line-height: 1.6;
  margin-bottom: 20px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.qdx-cta-btn-wrap {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.qdx-btn-rdv {
  display: inline-block;
  background: var(--qdx-rose);
  color: white;
  border: none;
  border-radius: 99px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.15s;
}
.qdx-btn-rdv:hover { background: #d44468; transform: translateY(-1px); }
.qdx-btn-pdf {
  display: inline-block;
  background: rgba(255,255,255,0.12);
  color: white;
  border: 1.5px solid rgba(255,255,255,0.35);
  border-radius: 99px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.qdx-btn-pdf:hover { background: rgba(255,255,255,0.20); }

/* Responsive */
@media (max-width: 560px) {
  .qdx-field-row { grid-template-columns: 1fr; }
  .qdx-impact-grid { grid-template-columns: 1fr; }
  .qdx-intro-title { font-size: 21px; }
  .qdx-q-text { font-size: 18px; }
  .qdx-form-body { padding: 20px 16px; }
  .qdx-cta-block { padding: 20px 16px; }
}

/* ══ INTRO SPLIT ══ */
.qdx-intro-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 320px;
  border-radius: var(--qdx-radius-lg);
  overflow: hidden;
  border: 1px solid var(--qdx-border);
}
.qdx-intro-left {
  background: #ffffff;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--qdx-border);
}
.qdx-intro-right {
  background: linear-gradient(135deg, #2D2D6B 0%, #3D3D8F 60%, #5B4BA8 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  gap: 14px;
}
.qdx-intro-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #C94070;
  border: 1px solid #C94070;
  border-radius: 99px;
  padding: 4px 12px;
  margin-bottom: 14px;
  width: fit-content;
}
.qdx-intro-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--qdx-navy);
  line-height: 1.25;
  margin-bottom: 10px;
}
.qdx-intro-sub {
  font-size: 15px;
  color: var(--qdx-muted);
  line-height: 1.6;
  margin-bottom: 18px;
}
.qdx-intro-checks {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.qdx-intro-checks li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: #374151;
}
.qdx-intro-check-ico {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #EBEBF8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 10px;
  color: #3D3D8F;
  font-weight: 700;
}
.qdx-intro-badge {
  background: rgba(255,255,255,0.18);
  border: 0.5px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 11px;
  font-weight: 600;
  color: white;
}

/* ── Mockup rapport ── */
.qdx-mockup {
  background: white;
  border-radius: 10px;
  padding: 18px;
  width: 100%;
  max-width: 240px;
  border: 0.5px solid #E5E7EB;
}
.qdx-mockup-hdr {
  font-size: 10px;
  font-weight: 700;
  color: #3D3D8F;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-bottom: 7px;
  border-bottom: 2px solid #3D3D8F;
  margin-bottom: 10px;
}
.qdx-mockup-score-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 7px;
}
.qdx-mockup-pct {
  font-size: 34px;
  font-weight: 800;
  color: #d97706;
  line-height: 1;
}
.qdx-mockup-lbl {
  font-size: 11px;
  color: #6B7280;
  line-height: 1.4;
}
.qdx-mockup-bar {
  height: 5px;
  background: #E5E7EB;
  border-radius: 99px;
  margin-bottom: 10px;
  overflow: hidden;
}
.qdx-mockup-bar-fill {
  height: 5px;
  width: 45%;
  background: #d97706;
  border-radius: 99px;
}
.qdx-mockup-risks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.qdx-mockup-risk {
  font-size: 10px;
  border-radius: 4px;
  padding: 4px 7px;
}
.qdx-mockup-risk.warn   { color: #92400e; background: #FFFBEB; }
.qdx-mockup-risk.danger { color: #991b1b; background: #FEF2F2; }
.qdx-mockup-gain-l {
  font-size: 9px;
}
.qdx-mockup-gain-v {
  font-size: 17px;
}
.qdx-mockup-gain {
  background: #3D3D8F;
  border-radius: 6px;
  padding: 8px;
  text-align: center;
}
.qdx-mockup-gain-l {
  font-size: 7px;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}
.qdx-mockup-gain-v {
  font-size: 14px;
  font-weight: 800;
  color: white;
}

@media (max-width: 600px) {
  .qdx-intro-split {
    grid-template-columns: 1fr;
  }
  .qdx-intro-right {
    display: none;
  }
}

