/* ════════════════════════════════════════
   DIAGNOSTIC — Multi-step wizard
   Extends the Leka Digital design system
════════════════════════════════════════ */

/* ── Layout ── */
.diag-section {
  /* Account for header (~72px) + breadcrumb (~44px) so the intro lands above the fold. */
  background: linear-gradient(160deg, var(--color-surface-blue) 0%, var(--color-off-white) 60%);
  min-height: calc(100vh - 116px);
  padding: 24px 0 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Intro screen specifically — ensure it fits above the fold on common laptops (>=680px tall). */
.diag-section:has(#diag-s0.diag-screen--active) {
  min-height: calc(100vh - 116px);
  padding-top: 16px;
  padding-bottom: 24px;
}

/* Page diagnostic : supprimer le bandeau blanc du fil d'Ariane après le menu
   et réduire l'espace en haut (~50px du menu au contenu). Scopé à cette page
   (diagnostic.css ne se charge que sur /diagnostic/). */
.breadcrumb {
  padding: 14px 0 0;
  background: transparent;
  border-bottom: none;
}
.diag-section {
  padding-top: 12px;
}

.diag-container {
  display: flex;
  justify-content: center;
}

.diag-wrapper {
  width: 100%;
  max-width: 760px;
  /* Keep the progress strip clear of the fixed header on step changes. */
  scroll-margin-top: 92px;
  max-height: min(90vh, calc(100dvh - 24px));
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 28px;
  box-shadow: var(--shadow-floating);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Progress header ── */
.diag-progress-header {
  flex: 0 0 auto;
  padding: 20px 36px 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-white);
}

.diag-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.diag-step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-slate);
}

.diag-step-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-blue);
}

.diag-progress-track {
  height: 6px;
  background: var(--color-border);
  border-radius: 999px;
  overflow: hidden;
}

.diag-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-blue), var(--color-mint));
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Screen base ── */
.diag-screen {
  display: none;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 40px 36px 36px;
}

/* Tighter padding on the intro screen so all content lands above the fold. */
#diag-s0.diag-screen {
  padding: 28px 36px 24px;
}

.diag-screen--active {
  display: block;
  flex: 1 1 auto;
  animation: diag-in 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.diag-screen--out {
  animation: diag-out 0.25s ease forwards;
}

@keyframes diag-in {
  from { opacity: 0; transform: translateX(22px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes diag-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(-18px); }
}

/* ── Intro screen ── */
.diag-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 8px 0;
}

.diag-intro-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  background: var(--color-blue-soft);
  color: var(--color-blue);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.diag-intro-badge svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.diag-intro h1 {
  font-size: clamp(24px, 3.4vw, 32px);
  font-weight: 800;
  color: var(--color-navy);
  line-height: 1.15;
  letter-spacing: -0.6px;
  max-width: 580px;
  margin: 0;
  text-wrap: balance;
}

.diag-intro-lead {
  font-size: 16px;
  color: var(--color-slate);
  line-height: 1.6;
  max-width: 480px;
  margin: 0;
}

/* Réassurance : chips horizontales (coût / temps / engagement) */
.diag-intro-perks {
  list-style: none;
  padding: 0;
  margin: 2px 0 4px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
}

.diag-intro-perks li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-navy);
}

.diag-intro-perks svg {
  width: 15px;
  height: 15px;
  color: var(--color-mint);
  flex-shrink: 0;
}

/* Livrables concrets : carte "Ce que vous obtenez" */
.diag-what {
  width: 100%;
  max-width: 520px;
  margin: 4px 0 4px;
  background: var(--color-off-white, #f7f8fa);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 20px 22px;
  text-align: left;
}

.diag-what-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  margin: 0 0 14px;
}

.diag-what-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.diag-what-list li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--color-slate);
}

.diag-what-list strong {
  font-weight: 700;
  color: var(--color-navy);
}

.diag-what-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 999px;
  background: var(--color-mint-soft, #eafaf0);
  color: var(--color-mint);
}

.diag-what-check svg {
  width: 12px;
  height: 12px;
}

.diag-start-btn {
  font-size: 16px;
  padding: 14px 32px;
  border-radius: 999px;
}

.diag-reassure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-muted);
  font-weight: 600;
  margin: 0;
}

.diag-reassure svg {
  width: 13px;
  height: 13px;
  color: var(--color-mint);
  flex-shrink: 0;
}

/* ── Question header ── */
.diag-q-header {
  margin-bottom: 28px;
}

.diag-q-header h2 {
  font-size: clamp(20px, 2.6vw, 28px);
  font-weight: 800;
  color: var(--color-navy);
  margin: 4px 0 0;
  letter-spacing: -0.4px;
  line-height: 1.2;
  text-wrap: balance;
}

.diag-q-header .eyebrow {
  color: var(--color-blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.diag-q-hint {
  font-size: 13px;
  color: var(--color-slate);
  margin: 10px 0 0;
}

.diag-q-header--lead {
  text-align: center;
}

.diag-lead-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  background: #ECFDF3;
  color: var(--color-mint-dark);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
}

.diag-lead-badge svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ── Motivating message (gamification) ── */
.diag-motivate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: linear-gradient(135deg, #FEF3C7, #FFF7ED);
  border: 1px solid #FDE68A;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #92400E;
  margin-bottom: 20px;
}

/* ── Card grids ── */
.diag-field {
  margin-bottom: 24px;
}

.diag-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 10px;
}

.diag-cards {
  display: grid;
  gap: 10px;
}

.diag-cards--4 { grid-template-columns: repeat(4, 1fr); }
.diag-cards--3 { grid-template-columns: repeat(3, 1fr); }
.diag-cards--2 { grid-template-columns: repeat(2, 1fr); }
.diag-cards--multi { grid-template-columns: 1fr; gap: 8px; }

/* ── Card ── */
.diag-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 14px;
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: 16px;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.diag-card:hover {
  border-color: var(--color-blue);
  background: var(--color-blue-soft);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(37, 99, 255, 0.12);
}

.diag-card.is-selected {
  border-color: var(--color-blue);
  background: var(--color-blue-soft);
  box-shadow: 0 0 0 3px rgba(37, 99, 255, 0.14);
  transform: translateY(-1px);
}

/* Keyboard focus is invisible by default because the radio/checkbox is sr-only.
   Reflect focus on the label/card so keyboard users see where they are. */
.diag-card:focus-within {
  outline: 3px solid rgba(37, 99, 255, 0.36);
  outline-offset: 3px;
  border-color: var(--color-blue);
}

.diag-card.is-selected .diag-card-icon {
  transform: scale(1.08);
}

/* Tall cards (3-col data screen) */
.diag-card--tall {
  padding: 24px 14px;
  gap: 8px;
}

/* Larger cards (2-col with descriptions) */
.diag-cards--lg .diag-card {
  padding: 22px 18px;
  align-items: flex-start;
  text-align: left;
}

/* Multi-select (horizontal layout) */
.diag-card--check {
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: 14px;
  padding: 16px 18px;
}

/* Card icon */
.diag-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-bottom: 10px;
  transition: transform 0.15s ease;
}

.diag-cards--lg .diag-card-icon { margin-bottom: 14px; }
.diag-card--check .diag-card-icon { margin-bottom: 0; }
.diag-card--tall .diag-card-icon { width: 48px; height: 48px; border-radius: 14px; }

.diag-card-icon svg {
  width: 22px;
  height: 22px;
}

.diag-card-icon--blue   { background: var(--color-blue-soft);   color: var(--color-blue); }
.diag-card-icon--mint   { background: var(--color-mint-soft);   color: var(--color-mint-dark); }
.diag-card-icon--coral  { background: var(--color-coral-soft);  color: var(--color-coral); }
.diag-card-icon--yellow { background: var(--color-yellow-soft); color: var(--color-yellow); }
.diag-card-icon--gray   { background: var(--color-surface-soft); color: var(--color-slate); }

/* Card text */
.diag-card-text { flex: 1; min-width: 0; }

.diag-card-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1.3;
}

.diag-card-desc {
  display: block;
  font-size: 12px;
  color: var(--color-slate);
  line-height: 1.4;
  margin-top: 4px;
}

.diag-cards--lg .diag-card-label { font-size: 14px; }

/* Checkmark for multi-select */
.diag-card-checkmark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--color-border);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-left: auto;
  background: white;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.diag-card-checkmark svg {
  width: 12px;
  height: 12px;
  opacity: 0;
  transition: opacity 0.15s ease;
  color: white;
}

.diag-card.is-selected .diag-card-checkmark {
  background: var(--color-blue);
  border-color: var(--color-blue);
}

.diag-card.is-selected .diag-card-checkmark svg {
  opacity: 1;
}

/* "Aucun" card looks a bit different when others are selected */
.diag-card--none:not(.is-selected) {
  opacity: 0.7;
}

/* ── Select field ── */
.diag-select-wrap {
  position: relative;
}

.diag-select {
  width: 100%;
  appearance: none;
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  padding: 12px 40px 12px 16px;
  font-family: inherit;
  font-size: 14px;
  color: var(--color-navy);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.diag-select:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 255, 0.14);
}

.diag-select-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--color-slate);
  pointer-events: none;
}

/* ── Actions bar ── */
.diag-actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  margin: 24px -36px -36px;
  padding: 16px 36px 24px;
  display: flex;
  gap: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--color-white) 38%);
}

/* ── Lead form ── */
.diag-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
}

.diag-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.diag-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.diag-input {
  width: 100%;
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 14px;
  color: var(--color-navy);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.diag-input:focus {
  outline: none;
  border-color: var(--color-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 255, 0.14);
}

.diag-input.has-error {
  border-color: var(--color-coral);
}

.diag-input.is-valid {
  border-color: var(--color-mint);
}

.diag-req { color: var(--color-coral); }

.diag-error {
  /* #B91C1C — WCAG AA on white (~6.4:1). --color-coral fails AA for body text. */
  font-size: 11px;
  font-weight: 600;
  color: #B91C1C;
  min-height: 14px;
}

/* RGPD row */
.diag-rgpd-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--color-slate);
  line-height: 1.5;
}

.diag-rgpd-row a {
  color: var(--color-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.diag-rgpd-box {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border-radius: 5px;
  border: 1.5px solid var(--color-border);
  display: grid;
  place-items: center;
  background: var(--color-white);
  margin-top: 1px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.diag-rgpd-box svg {
  width: 10px;
  height: 10px;
  color: white;
  opacity: 0;
  transition: opacity 0.15s ease;
}

#diag-rgpd:checked + .diag-rgpd-box {
  background: var(--color-blue);
  border-color: var(--color-blue);
}

#diag-rgpd:checked + .diag-rgpd-box svg {
  opacity: 1;
}

.diag-submit-btn {
  font-size: 15px;
  padding: 14px 32px;
  justify-content: center;
  gap: 10px;
}

.diag-submit-btn svg {
  width: 16px;
  height: 16px;
}

/* Loading state */
.diag-submit-btn.is-loading {
  opacity: 0.7;
  pointer-events: none;
}

/* ── Results screen ── */
.diag-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 8px 0;
}

.diag-result h2 {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 800;
  color: var(--color-navy);
  letter-spacing: -0.5px;
  margin: 4px 0 0;
}

/* Gauge */
.diag-gauge-wrap {
  display: flex;
  justify-content: center;
}

.diag-gauge {
  position: relative;
  width: 180px;
  height: 180px;
}

.diag-gauge-svg {
  width: 100%;
  height: 100%;
  transition: all 0.1s linear;
}

.diag-gauge-arc {
  transition: stroke-dashoffset 0.06s linear, stroke 0.4s ease;
}

.diag-gauge-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.diag-gauge-num {
  font-size: 42px;
  font-weight: 800;
  color: var(--color-navy);
  line-height: 1;
}

.diag-gauge-denom {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-slate);
}

.diag-gauge-profile {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-blue);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

/* Result message */
.diag-result-msg {
  background: var(--color-surface-soft);
  border-radius: 20px;
  padding: 24px 28px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--color-slate);
  max-width: 600px;
  text-align: center;
  border: 1px solid var(--color-border);
}

.diag-result-msg strong {
  color: var(--color-navy);
}

/* Recommendations */
.diag-result-recos {
  width: 100%;
}

.diag-result-recos h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-navy);
  text-align: center;
  margin: 0 0 16px;
}

.diag-reco-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.diag-reco-card {
  padding: 18px 16px;
  border-radius: 16px;
  border: 1px solid var(--color-border);
  text-align: center;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.diag-reco-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.diag-reco-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
}

.diag-reco-icon svg {
  width: 20px;
  height: 20px;
}

.diag-reco-card span {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1.3;
}

/* CTA row */
.diag-result-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.diag-result-cta .btn {
  font-size: 14px;
}

/* ── Responsive ── */
@media (max-width: 767px) {
  .diag-section {
    padding: 24px 0 48px;
    min-height: auto;
  }

  .diag-wrapper {
    max-height: min(90vh, calc(100dvh - 16px));
    border-radius: 20px;
  }

  .diag-progress-header {
    padding: 16px 20px 14px;
  }

  .diag-screen {
    padding: 28px 20px 24px;
  }

  .diag-actions {
    margin: 22px -20px -24px;
    padding: 14px 20px 20px;
  }

  .diag-cards--4,
  .diag-cards--3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .diag-cards--2 {
    grid-template-columns: 1fr;
  }

  .diag-form-row {
    grid-template-columns: 1fr;
  }

  .diag-reco-grid {
    grid-template-columns: 1fr;
  }

  .diag-result-cta {
    flex-direction: column;
    width: 100%;
  }

  .diag-result-cta .btn {
    width: 100%;
    justify-content: center;
  }

  .diag-gauge {
    width: 150px;
    height: 150px;
  }

  .diag-gauge-num {
    font-size: 34px;
  }
}

@media (max-width: 480px) {
  .diag-cards--4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .diag-start-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── Polish 2026-05 ── */

/* Centered text utility for result screen (was inline style). */
.diag-result .eyebrow,
.diag-result > h2 {
  text-align: center;
}

/* Submit error styling (was an inline style attribute). */
.diag-submit-error {
  margin-top: 8px;
  color: #B91C1C;
  font-size: 13px;
  font-weight: 600;
}

/* Lighter "encouragement" treatment, no emoji. Brand voice stays direct. */
.diag-motivate {
  background: var(--color-mint-soft);
  border-color: rgba(34, 197, 94, 0.32);
  color: var(--color-mint-dark);
}
