/* ================================================
   D&V Diagnostic — Front-end CSS
   Design system : primary #1e3a6f / accent #e89132
   ================================================ */

:root {
  --dvd-primary: #1e3a6f;
  --dvd-primary-light: #2570bf;
  --dvd-accent: #e89132;
  --dvd-bg-soft: #f5f7fa;
  --dvd-bg-warm: #fef7ed;
  --dvd-text: #0f1729;
  --dvd-muted: #5a6477;
  --dvd-border: #e2e6ec;
  --dvd-success: #22c55e;
  --dvd-radius-btn: 8px;
  --dvd-radius-card: 12px;
  --dvd-font-display: 'Bricolage Grotesque', sans-serif;
  --dvd-font-body: 'Manrope', sans-serif;
  --dvd-font-script: 'Caveat', cursive;
}

/* ── Wrapper ─────────────────────────────────── */
.dv-diagnostic-wrapper {
  max-width: 760px;
  margin: 0 auto;
  font-family: var(--dvd-font-body);
  color: var(--dvd-text);
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(30, 58, 111, 0.10);
  overflow: hidden;
  position: relative;
}

/* ── Progress bar ────────────────────────────── */
.dv-progress-bar {
  height: 6px;
  background: var(--dvd-border);
  position: relative;
}
.dv-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--dvd-primary), var(--dvd-accent));
  border-radius: 0 3px 3px 0;
  transition: width 400ms ease-in-out;
}

/* ── Screens ─────────────────────────────────── */
.dv-screen {
  display: none;
  padding: 40px 48px;
  animation: dvdFadeIn 0.3s ease forwards;
}
.dv-screen.active { display: block; }

@media (max-width: 768px) {
  .dv-screen { padding: 28px 20px; }
}

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

/* ── Écran 0 : Intro ─────────────────────────── */
.dv-intro-content {
  text-align: center;
  padding: 16px 0;
}
.dv-eyebrow {
  display: inline-block;
  background: var(--dvd-bg-warm);
  color: var(--dvd-accent);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .5px;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 20px;
  animation: dvdFadeIn 0.3s ease 0.1s both;
}
.dv-intro-content .dv-title {
  font-family: var(--dvd-font-display);
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 700;
  color: var(--dvd-primary);
  line-height: 1.25;
  margin: 0 0 12px;
  animation: dvdFadeIn 0.3s ease 0.2s both;
}
.dv-subtitle {
  font-size: 16px;
  color: var(--dvd-muted);
  margin: 0 0 24px;
  animation: dvdFadeIn 0.3s ease 0.3s both;
}
.dv-citation {
  font-family: var(--dvd-font-script);
  font-size: 26px;
  line-height: 1.4;
  color: var(--dvd-accent);
  margin: 0 0 28px;
  animation: dvdFadeIn 0.3s ease 0.4s both;
}
.dv-info-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px 24px;
  font-size: 14px;
  color: var(--dvd-muted);
  background: var(--dvd-bg-soft);
  border-radius: var(--dvd-radius-card);
  padding: 16px 24px;
  margin-bottom: 32px;
  animation: dvdFadeIn 0.3s ease 0.5s both;
}
.dv-link-secondary {
  display: block;
  margin-top: 16px;
  color: var(--dvd-muted);
  font-size: 13px;
  text-decoration: underline;
  text-decoration-color: transparent;
  transition: color .2s, text-decoration-color .2s;
}
.dv-link-secondary:hover {
  color: var(--dvd-primary);
  text-decoration-color: var(--dvd-primary);
}

/* ── Buttons ─────────────────────────────────── */
.dv-diagnostic-wrapper .dv-btn-primary,
.dv-diagnostic-wrapper a.dv-btn-primary,
.dv-diagnostic-wrapper button.dv-btn-primary {
  display: inline-block;
  background: var(--dvd-accent) !important;
  color: #ffffff !important;
  font-family: var(--dvd-font-body);
  font-size: 16px;
  font-weight: 600;
  padding: 16px 32px;
  border-radius: var(--dvd-radius-btn);
  border: none;
  cursor: pointer;
  text-decoration: none !important;
  transition: background .2s, transform .15s;
  animation: dvdFadeIn 0.3s ease 0.6s both;
  line-height: 1.4;
}
.dv-diagnostic-wrapper .dv-btn-primary:hover,
.dv-diagnostic-wrapper a.dv-btn-primary:hover { background: #d07a25 !important; color: #ffffff !important; transform: translateY(-2px); }
.dv-diagnostic-wrapper .dv-btn-primary:active { transform: translateY(0); }

.dv-diagnostic-wrapper .dv-btn-secondary,
.dv-diagnostic-wrapper a.dv-btn-secondary {
  display: inline-block;
  background: transparent !important;
  color: var(--dvd-primary) !important;
  font-family: var(--dvd-font-body);
  font-size: 15px;
  font-weight: 600;
  padding: 14px 32px;
  border-radius: var(--dvd-radius-btn);
  border: 1.5px solid var(--dvd-primary) !important;
  cursor: pointer;
  text-decoration: none !important;
  transition: background .2s, color .2s;
  line-height: 1.4;
}
.dv-diagnostic-wrapper .dv-btn-secondary:hover,
.dv-diagnostic-wrapper a.dv-btn-secondary:hover {
  background: var(--dvd-primary) !important;
  color: #ffffff !important;
}
.dv-btn-full { display: block; text-align: center; width: 100%; box-sizing: border-box; }

/* ── Questions ───────────────────────────────── */
.dv-questions-header { margin-bottom: 20px; }
.dv-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--dvd-muted);
  margin-bottom: 8px;
}
.dv-theme-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--dvd-bg-soft);
  border: 1.5px solid var(--dvd-border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--dvd-primary);
}
.dv-question-area {
  position: relative;
  overflow: hidden;
  min-height: 280px;
}
.dv-question-slide {
  display: none;
}
.dv-question-slide.active {
  display: block;
}
.dv-question-text {
  font-family: var(--dvd-font-display);
  font-size: clamp(17px, 3vw, 22px);
  font-weight: 600;
  color: var(--dvd-text);
  margin: 0 0 8px;
  line-height: 1.35;
}
.dv-question-encourage {
  font-style: italic;
  font-size: 13px;
  color: var(--dvd-muted);
  margin: 0 0 20px;
}
.dv-answers { list-style: none; padding: 0; margin: 0; }
.dv-answer-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  border: 1.5px solid var(--dvd-border);
  border-radius: var(--dvd-radius-card);
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
  margin-bottom: 12px;
  user-select: none;
  position: relative;
}
.dv-answer-card:hover {
  border-color: var(--dvd-accent);
  background: var(--dvd-bg-warm);
  transform: translateX(4px);
}
.dv-answer-card.selected {
  border-color: var(--dvd-primary);
  background: var(--dvd-primary);
  color: #fff;
  transform: translateX(0);
}
.dv-answer-card.selected .dv-answer-letter { background: rgba(255,255,255,0.2); color: #fff; }
.dv-answer-letter {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--dvd-bg-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: var(--dvd-primary);
  flex-shrink: 0;
  transition: all .2s;
}
.dv-answer-text { flex: 1; font-size: 15px; }
.dv-check {
  opacity: 0;
  transform: scale(0);
  transition: opacity .25s, transform .25s;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
}
.dv-answer-card.selected .dv-check { opacity: 1; transform: scale(1); }
.dv-btn-next-wrap {
  margin-top: 20px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .3s, transform .3s;
  pointer-events: none;
}
.dv-btn-next-wrap.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.dv-btn-next { float: right; }

/* Bridge quote */
.dv-bridge-quote {
  font-family: var(--dvd-font-script);
  font-size: 22px;
  line-height: 1.4;
  color: var(--dvd-muted);
  margin: 16px 0 20px;
  padding-left: 16px;
  border-left: 3px solid var(--dvd-accent);
}

/* Theme dots */
.dv-theme-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}
.dv-theme-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--dvd-border);
  transition: background .3s;
}
.dv-theme-dot.done { background: var(--dvd-success); }
.dv-theme-dot.active { background: var(--dvd-accent); }

/* ── Fin de thème ────────────────────────────── */
.dv-screen-theme-end { text-align: center; padding: 60px 40px; }
.dv-theme-complete { animation: dvdFadeIn .3s ease; }
.dv-theme-complete-icon { font-size: 48px; margin-bottom: 12px; }
.dv-theme-complete-text {
  font-family: var(--dvd-font-display);
  font-size: 20px;
  font-weight: 600;
  color: var(--dvd-primary);
  margin-bottom: 20px;
}
.dv-theme-complete-bar {
  width: 200px; height: 6px;
  background: var(--dvd-border);
  border-radius: 3px;
  margin: 0 auto;
  overflow: hidden;
}
.dv-theme-complete-fill {
  height: 100%;
  background: var(--dvd-success);
  border-radius: 3px;
  width: 0;
  animation: fillBar 1.2s ease-out .2s forwards;
}
@keyframes fillBar { to { width: 100%; } }

/* ── Email capture ───────────────────────────── */
.dv-screen-email { background: var(--dvd-bg-warm); }
.dv-email-content { max-width: 480px; margin: 0 auto; }
.dv-email-title {
  font-family: var(--dvd-font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--dvd-primary);
  margin: 0 0 8px;
}
.dv-email-subtitle { color: var(--dvd-muted); font-size: 15px; margin: 0 0 28px; }

.dv-field-group { margin-bottom: 18px; }

/* Reset agressif des labels pour contrer les thèmes Elementor/WordPress */
.dv-diagnostic-wrapper .dv-field-group label,
.dv-diagnostic-wrapper .dv-field-group > label {
  display: block !important;
  font-family: var(--dvd-font-body) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--dvd-text) !important;
  margin: 0 0 6px !important;
  padding: 0 !important;
  line-height: 1.4 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

.dv-optional { font-weight: 400 !important; color: var(--dvd-muted) !important; font-size: 12px !important; }

.dv-diagnostic-wrapper .dv-field-group input[type="text"],
.dv-diagnostic-wrapper .dv-field-group input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--dvd-border);
  border-radius: var(--dvd-radius-btn);
  font-family: var(--dvd-font-body);
  font-size: 15px;
  color: var(--dvd-text);
  background: #fff;
  box-sizing: border-box;
  transition: border-color .2s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.dv-diagnostic-wrapper .dv-field-group input:focus {
  border-color: var(--dvd-primary);
  box-shadow: 0 0 0 3px rgba(30,58,111,.1);
}
.dv-diagnostic-wrapper .dv-field-group input.invalid { border-color: #ef4444; }
.dv-field-error { display: block !important; font-size: 12px !important; color: #ef4444 !important; margin-top: 4px; min-height: 16px; }

/* Checkbox RGPD — reset complet */
.dv-field-checkbox { display: flex; flex-direction: column; margin-top: 4px; }
.dv-diagnostic-wrapper .dv-checkbox-label {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  cursor: pointer !important;
  font-family: var(--dvd-font-body) !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: var(--dvd-muted) !important;
  line-height: 1.5 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Cacher le checkbox natif proprement */
.dv-diagnostic-wrapper .dv-checkbox-label input[type="checkbox"] {
  position: absolute !important;
  opacity: 0 !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none !important;
}

/* Case à cocher custom visible */
.dv-checkbox-custom {
  display: inline-block !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  border: 2px solid var(--dvd-primary) !important;
  border-radius: 4px !important;
  background: #fff !important;
  position: relative !important;
  transition: border-color .2s, background .2s !important;
  margin-top: 2px !important;
  flex-shrink: 0 !important;
}
.dv-diagnostic-wrapper .dv-checkbox-label:hover .dv-checkbox-custom {
  border-color: var(--dvd-accent) !important;
}
.dv-diagnostic-wrapper .dv-checkbox-label input:checked ~ .dv-checkbox-custom {
  background: var(--dvd-primary) !important;
  border-color: var(--dvd-primary) !important;
}
.dv-checkbox-custom::after {
  content: '';
  position: absolute;
  left: 5px; top: 2px;
  width: 6px; height: 10px;
  border: 2px solid #fff;
  border-top: none; border-left: none;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity .15s;
}
.dv-diagnostic-wrapper .dv-checkbox-label input:checked ~ .dv-checkbox-custom::after {
  opacity: 1 !important;
}

.dv-privacy-note {
  font-family: var(--dvd-font-body) !important;
  font-size: 12px !important;
  color: var(--dvd-muted) !important;
  text-align: center;
  margin-top: 12px;
}

/* ── Loading ─────────────────────────────────── */
.dv-screen-loading { text-align: center; padding: 60px 40px; }
.dv-loading-content { max-width: 320px; margin: 0 auto; }
.dv-compass { margin-bottom: 24px; display: inline-block; }
.dv-compass-needle { transform-origin: 50px 50px; animation: compassSpin 2s linear infinite; }
.dv-compass-arc { animation: arcFill 3s linear forwards; }
@keyframes compassSpin { to { transform: rotate(360deg); } }
@keyframes arcFill { from { stroke-dashoffset: 141; } to { stroke-dashoffset: 0; } }
.dv-loading-bar-wrap { margin-bottom: 20px; }
.dv-loading-bar {
  height: 6px; background: var(--dvd-border);
  border-radius: 3px; overflow: hidden;
}
.dv-loading-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--dvd-primary), var(--dvd-accent));
  border-radius: 3px;
  width: 0;
  animation: loadingProgress 3s ease-out forwards;
}
@keyframes loadingProgress { to { width: 100%; } }
.dv-loading-msg {
  font-size: 15px;
  color: var(--dvd-muted);
  transition: opacity .3s;
}

/* ── Résultat ────────────────────────────────── */
.dv-screen-result { padding: 40px 48px; }
@media (max-width: 768px) { .dv-screen-result { padding: 28px 20px; } }

.dv-result-phase { text-align: center; }

/* Badge */
.dv-badge {
  width: 140px; height: 140px;
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  margin: 0 auto 20px;
  position: relative;
}
.dv-badge.fondation {
  background: linear-gradient(135deg, #e8f0fe, #c7d8f8);
  border: 3px solid #2570bf;
  animation: badgeBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.dv-badge.croissance {
  background: linear-gradient(135deg, #1e3a6f, #2570bf);
  border: 3px solid var(--dvd-accent);
  animation: badgeSlideIn 0.5s ease-out both;
}
.dv-badge.expansion {
  background: linear-gradient(135deg, #0d1f3d, #1e3a6f);
  border: 3px solid var(--dvd-accent);
  animation: badgeSpin 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  box-shadow: 0 0 24px rgba(232,145,50,0.35);
}
.dv-badge.expansion::after {
  content: '✦ ✦ ✦';
  position: absolute;
  top: -22px; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: var(--dvd-accent);
  animation: sparkle 1.5s ease-in-out infinite;
  white-space: nowrap;
}
.dv-badge-icon { font-size: 52px; line-height: 1; }
.dv-badge-label {
  font-family: var(--dvd-font-script);
  font-size: 17px; font-weight: 600;
  color: var(--dvd-accent);
  margin-top: 6px;
}

@keyframes badgeBounce {
  0%   { transform: scale(0) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes badgeSlideIn {
  0%   { transform: translateX(60px); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes badgeSpin {
  0%   { transform: scale(0) rotate(-180deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes sparkle {
  0%, 100% { opacity: 0.3; transform: translateX(-50%) scale(0.8); }
  50%       { opacity: 1;   transform: translateX(-50%) scale(1.2); }
}

/* Titre résultat */
.dv-result-title {
  font-family: var(--dvd-font-display);
  font-size: clamp(18px, 3vw, 26px);
  font-weight: 700;
  color: var(--dvd-primary);
  margin: 0 0 24px;
  line-height: 1.3;
}

/* Score visuel */
.dv-score-visual { margin-bottom: 28px; }
.dv-score-bar-wrap { text-align: left; }
.dv-score-bar {
  height: 12px;
  background: var(--dvd-bg-soft);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
}
.dv-score-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--dvd-primary), var(--dvd-accent));
  border-radius: 6px;
  transition: width 1s ease-out .3s;
}
.dv-score-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--dvd-muted);
}
.dv-score-labels strong { color: var(--dvd-text); font-size: 14px; }

/* Texte résultat */
.dv-result-text {
  text-align: left;
  font-size: 15px;
  line-height: 1.75;
  color: var(--dvd-text);
  margin-bottom: 24px;
}

/* Forces / Axes */
.dv-feedback-block {
  text-align: left;
  margin-bottom: 20px;
  padding: 20px 24px;
  border-radius: var(--dvd-radius-card);
}
.dv-forces { background: #f0fdf4; border: 1px solid #bbf7d0; }
.dv-axes   { background: var(--dvd-bg-warm); border: 1px solid #fde68a; }
.dv-feedback-block h3 {
  font-family: var(--dvd-font-display);
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--dvd-text);
}
.dv-forces h3 { color: #16a34a; }
.dv-axes   h3 { color: #d97706; }
.dv-feedback-block ul { list-style: none; padding: 0; margin: 0; }
.dv-feedback-block li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  padding: 6px 0;
  color: var(--dvd-text);
}
.dv-check-icon { color: #16a34a; font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.dv-arrow-icon { color: var(--dvd-accent); font-weight: 700; flex-shrink: 0; margin-top: 1px; }

/* Citation résultat */
.dv-citation-result {
  font-family: var(--dvd-font-script);
  font-size: 24px;
  line-height: 1.4;
  color: var(--dvd-muted);
  border-left: 3px solid var(--dvd-accent);
  padding: 12px 20px;
  margin: 24px 0;
  text-align: left;
}

.dv-divider { border: none; border-top: 1px solid var(--dvd-border); margin: 24px 0; }

/* CTAs résultat */
.dv-result-phase .dv-btn-primary  { margin-bottom: 12px; }
.dv-result-phase .dv-btn-secondary { margin-bottom: 24px; }

/* Partage */
.dv-share {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; flex-wrap: wrap;
  font-size: 13px; color: var(--dvd-muted);
  margin-bottom: 20px;
}
.dv-share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: 50%;
  transition: opacity .2s, transform .2s;
  text-decoration: none;
}
.dv-share-btn:hover { opacity: .8; transform: scale(1.1); }
.dv-share-linkedin { background: #0a66c2; color: #fff; }
.dv-share-email    { background: var(--dvd-primary); color: #fff; }

.dv-encouragement {
  font-size: 15px;
  color: var(--dvd-muted);
  font-style: italic;
  margin-top: 4px;
}

/* ── Toast ───────────────────────────────────── */
.dv-toast {
  position: absolute;
  bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--dvd-primary);
  color: #fff;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s;
  z-index: 10;
}
.dv-toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

/* ── Slide transitions ───────────────────────── */
@keyframes slideOutLeft {
  to { transform: translateX(-40px); opacity: 0; }
}
@keyframes slideInRight {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.dv-slide-out-left { animation: slideOutLeft 350ms ease-in-out forwards; }
.dv-slide-in-right { animation: slideInRight 350ms ease-in-out forwards; }

/* ── Accessibility ───────────────────────────── */
.dv-answer-card:focus-visible {
  outline: 3px solid var(--dvd-accent);
  outline-offset: 2px;
}
.dv-btn-primary:focus-visible,
.dv-btn-secondary:focus-visible {
  outline: 3px solid var(--dvd-accent);
  outline-offset: 2px;
}

/* ── Mobile overrides ────────────────────────── */
@media (max-width: 480px) {
  .dv-answer-card { padding: 14px 16px; }
  .dv-badge { width: 110px; height: 110px; }
  .dv-badge-icon { font-size: 40px; }
  .dv-info-bar { flex-direction: column; gap: 8px; text-align: center; }
  .dv-share { flex-direction: column; }
}
