/* ============================================================
   DIAGNOSTIC TOITURE EN LIGNE — ck-diagnostic.css
   Assistant de diagnostic interactif (remplace "Votre toit, vu du ciel")
   Palette & tokens hérités de style.css (:root)
   ============================================================ */

.dq {
  --dq-red:    #D6492A;
  --dq-orange: var(--accent);
  --dq-green:  #6FA84B;
  --dq-card:   #1B1917;
  --dq-line:   rgba(236, 227, 208, 0.16);
  --dq-line-2: rgba(236, 227, 208, 0.10);
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
}

/* ---- Header ------------------------------------------------- */
.dq-head { text-align: center; margin-bottom: 34px; }
.dq-eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}
.dq-title {
  font-family: var(--serif);
  font-size: clamp(32px, 4.6vw, 56px);
  line-height: 1.04;
  color: var(--fg);
  margin: 0 0 12px;
}
.dq-title em { color: var(--accent-bright); font-style: italic; }
.dq-sub {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 13px; letter-spacing: 0.02em;
  color: var(--muted);
  border: 1px solid var(--dq-line);
  border-radius: 999px; padding: 6px 14px; margin: 0 0 12px;
}
.dq-sub svg { width: 14px; height: 14px; stroke: var(--accent); }
.dq-intro {
  font-family: var(--sans); font-size: clamp(15px, 1.2vw, 17px);
  color: var(--fg-soft); line-height: 1.7; margin: 6px auto 0; max-width: 52ch;
}

/* ---- Card wrapper ------------------------------------------- */
.dq-card {
  background: var(--dq-card);
  border: 1px solid var(--dq-line);
  border-radius: 22px;
  padding: clamp(24px, 3.4vw, 44px);
  box-shadow: 0 30px 80px -50px rgba(0,0,0,0.9);
  position: relative;
  overflow: hidden;
}

/* ---- Progress bar ------------------------------------------- */
.dq-progress { margin-bottom: 30px; }
.dq-progress__meta {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--sans); font-size: 12.5px; letter-spacing: 0.04em;
  color: var(--muted); margin-bottom: 10px;
}
.dq-progress__step { color: var(--fg-soft); }
.dq-progress__pct { color: var(--accent); font-variant-numeric: tabular-nums; }
.dq-progress__track {
  height: 4px; border-radius: 999px; background: var(--dq-line-2);
  overflow: hidden;
}
.dq-progress__fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent), var(--accent-bright));
  transition: width .55s var(--ease);
}

/* ---- Steps -------------------------------------------------- */
.dq-step { display: none; }
.dq-step.is-active { display: block; animation: dqStepIn .5s var(--ease); }
@keyframes dqStepIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.dq-q { margin-bottom: 26px; }
.dq-q:last-of-type { margin-bottom: 0; }
.dq-q__label {
  font-family: var(--serif);
  font-size: clamp(21px, 2.4vw, 28px);
  color: var(--fg); line-height: 1.2; margin: 0 0 6px;
}
/* Cibles focalisées par script (titre d'étape, fiche, confirmation) :
   focus déplacé pour l'accessibilité, sans liseré visible. */
.dq-q__label:focus,
.dq-result:focus,
.dq-done:focus { outline: none; }
.dq-q__hint {
  font-family: var(--sans); font-size: 13px; color: var(--muted);
  margin: 0 0 16px;
}

/* ---- Options grid ------------------------------------------- */
.dq-opts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  list-style: none; padding: 0; margin: 0;
}

/* Chaque case : pill sombre + point orange + magnetic + hover fill */
.dq-opt {
  position: relative;
  overflow: hidden;
  display: flex; align-items: center;
  min-height: 56px;
  padding: 15px 20px 15px 40px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--dq-line);
  color: var(--fg-soft);
  font-family: var(--sans); font-size: 15px; text-align: left;
  cursor: pointer;
  will-change: transform;
  transition: border-color .35s var(--ease), box-shadow .35s var(--ease),
              transform .6s var(--ease);
}
.dq-opt:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
}

/* Le point orange en bas à gauche — devient le fill sweep */
.dq-opt__dot {
  position: absolute; left: 18px; top: 50%;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%) scale(1);
  transform-origin: center;
  transition: transform .5s var(--ease);
  z-index: 0; pointer-events: none;
}

.dq-opt__label,
.dq-opt__hover {
  position: relative; z-index: 1;
  transition: transform .38s var(--ease), opacity .34s var(--ease);
}
.dq-opt__hover {
  position: absolute; left: 40px; right: 20px; top: 50%;
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--accent-ink); font-weight: 600;
  transform: translateY(calc(-50% + 130%)); opacity: 0;
}
.dq-opt__hover svg { width: 16px; height: 16px; stroke: var(--accent-ink); flex: none; }
.dq-opt__label { transform: translateY(0); opacity: 1; }

/* Hover (uniquement pointeurs fins) */
@media (hover: hover) {
  .dq-opt:hover {
    border-color: transparent;
    box-shadow: 0 14px 30px -16px rgba(244,124,32,0.55);
  }
  .dq-opt:hover .dq-opt__dot { transform: translateY(-50%) scale(72); }
  .dq-opt:hover .dq-opt__label { transform: translateY(-130%); opacity: 0; }
  .dq-opt:hover .dq-opt__hover { transform: translateY(-50%); opacity: 1; }
}

/* État sélectionné : reste rempli orange en permanence */
.dq-opt.is-selected {
  border-color: transparent;
  box-shadow: 0 12px 26px -16px rgba(244,124,32,0.5);
}
.dq-opt.is-selected .dq-opt__dot { transform: translateY(-50%) scale(72); }
.dq-opt.is-selected .dq-opt__label { transform: translateY(-130%); opacity: 0; }
.dq-opt.is-selected .dq-opt__hover { transform: translateY(-50%); opacity: 1; }

/* ---- Navigation --------------------------------------------- */
.dq-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-top: 32px;
  padding-top: 24px; border-top: 1px solid var(--dq-line-2);
}
.dq-btn {
  font-family: var(--sans); font-size: 15px; font-weight: 600;
  border-radius: 999px; padding: 14px 26px; cursor: pointer;
  border: 1px solid transparent;
  transition: background .35s var(--ease), color .35s var(--ease),
              border-color .35s var(--ease), transform .35s var(--ease), opacity .3s;
  display: inline-flex; align-items: center; gap: 8px;
}
.dq-btn svg { width: 16px; height: 16px; }
.dq-btn--prev {
  background: transparent; color: var(--fg-soft);
  border-color: var(--dq-line);
}
.dq-btn--prev:hover { color: var(--fg); border-color: var(--fg-soft); }
.dq-btn--next {
  background: var(--accent); color: var(--accent-ink); margin-left: auto;
}
.dq-btn--next:hover { background: var(--accent-bright); transform: translateY(-2px); }
.dq-btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }
.dq-btn--prev[hidden] { display: none; }

/* ============================================================
   FICHE RÉSULTAT — rapport d'expertise
   ============================================================ */
.dq-result { display: none; }
.dq-result.is-active { display: block; animation: dqStepIn .55s var(--ease); }

.dq-result__head { text-align: center; margin-bottom: 8px; }
.dq-result__kicker {
  font-family: var(--sans); font-size: 12px; letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 8px;
}
.dq-result__title {
  font-family: var(--serif); font-size: clamp(30px, 4vw, 46px);
  color: var(--fg); margin: 0 0 4px;
}

/* Score : anneau + gros chiffre */
.dq-score {
  display: flex; align-items: center; justify-content: center; gap: 26px;
  flex-wrap: wrap;
  margin: 24px 0 30px; padding: 26px;
  background: var(--bg); border: 1px solid var(--dq-line); border-radius: 18px;
}
.dq-ring { position: relative; width: 132px; height: 132px; flex: none; }
.dq-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dq-ring__bg { stroke: var(--dq-line); }
.dq-ring__val { stroke: var(--accent); transition: stroke-dashoffset 1.1s var(--ease), stroke .6s; stroke-linecap: round; }
.dq-ring__num {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: var(--serif); color: var(--fg); line-height: 1;
}
.dq-ring__num b { font-size: 40px; }
.dq-ring__num span { font-size: 14px; color: var(--muted); font-family: var(--sans); margin-top: 2px; }
.dq-score__side { flex: 1; min-width: 220px; }
.dq-score__label {
  font-family: var(--sans); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 8px;
}
.dq-pastille {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--fg);
  padding: 8px 16px 8px 12px; border-radius: 999px;
  border: 1px solid var(--dq-line); background: var(--dq-card);
}
.dq-pastille__dot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 0 4px rgba(255,255,255,0.04); }
.dq-pastille--rouge  .dq-pastille__dot { background: var(--dq-red); }
.dq-pastille--orange .dq-pastille__dot { background: var(--dq-orange); }
.dq-pastille--vert   .dq-pastille__dot { background: var(--dq-green); }
.dq-score__urgence { font-family: var(--sans); font-size: 14.5px; color: var(--fg-soft); line-height: 1.6; margin: 12px 0 0; }

/* Grille infos (projet / complexité / temps) */
.dq-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.dq-cell {
  background: var(--bg); border: 1px solid var(--dq-line);
  border-radius: 14px; padding: 18px;
}
.dq-cell__k {
  font-family: var(--sans); font-size: 11.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 8px;
}
.dq-cell__v { font-family: var(--serif); font-size: 19px; color: var(--fg); line-height: 1.25; }
.dq-stars { font-size: 19px; letter-spacing: 3px; color: var(--accent); }
.dq-stars .dq-star--off { color: var(--dq-line); }

/* Points de vigilance + conseils */
.dq-block { margin-bottom: 22px; }
.dq-block__title {
  font-family: var(--sans); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.dq-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.dq-list li {
  position: relative; padding-left: 26px;
  font-family: var(--sans); font-size: 14.5px; color: var(--fg-soft); line-height: 1.55;
}
.dq-list li::before {
  content: ""; position: absolute; left: 6px; top: 8px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}
.dq-list--conseils li::before { background: var(--dq-green); }

.dq-disclaimer {
  font-family: var(--sans); font-size: 12.5px; color: var(--muted);
  line-height: 1.6; font-style: italic;
  padding: 14px 16px; border-left: 2px solid var(--dq-line);
  background: var(--bg); border-radius: 0 10px 10px 0; margin: 4px 0 26px;
}

/* ---- Encart CTA + mini-formulaire --------------------------- */
.dq-cta {
  background: linear-gradient(180deg, rgba(244,124,32,0.10), rgba(244,124,32,0.03));
  border: 1px solid rgba(244,124,32,0.32);
  border-radius: 18px; padding: clamp(20px, 3vw, 30px); text-align: center;
}
.dq-cta__q {
  font-family: var(--serif); font-size: clamp(20px, 2.4vw, 27px);
  color: var(--fg); margin: 0 0 6px;
}
.dq-cta__sub { font-family: var(--sans); font-size: 14.5px; color: var(--fg-soft); margin: 0 0 18px; }
.dq-cta__btn {
  font-family: var(--sans); font-size: 16px; font-weight: 700;
  background: var(--accent); color: var(--accent-ink);
  border: none; border-radius: 999px; padding: 16px 32px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 10px;
  transition: background .35s var(--ease), transform .35s var(--ease), box-shadow .35s var(--ease);
}
.dq-cta__btn svg { width: 18px; height: 18px; }
.dq-cta__btn:hover { background: var(--accent-bright); transform: translateY(-2px); box-shadow: 0 18px 38px -16px rgba(244,124,32,0.6); }

.dq-fallback { margin-top: 16px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.dq-fallback a {
  font-family: var(--sans); font-size: 14px; color: var(--fg-soft);
  text-decoration: none; display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid var(--dq-line);
  transition: border-color .3s, color .3s, background .3s;
}
.dq-fallback a:hover { color: var(--fg); border-color: var(--fg-soft); }
.dq-fallback a svg { width: 15px; height: 15px; }
.dq-fallback a.dq-wa { border-color: rgba(37,211,102,0.4); color: #7EE0A0; }
.dq-fallback a.dq-wa:hover { border-color: #25D366; color: #fff; }
.dq-fallback a[hidden] { display: none; }

/* Mini-formulaire */
.dq-form { display: none; margin-top: 22px; text-align: left; }
.dq-form.is-open { display: block; animation: dqStepIn .4s var(--ease); }
.dq-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dq-field { display: flex; flex-direction: column; gap: 6px; }
.dq-field label {
  font-family: var(--sans); font-size: 12px; letter-spacing: 0.06em;
  color: var(--muted);
}
.dq-field input {
  font-family: var(--sans); font-size: 15px; color: var(--fg);
  background: var(--bg); border: 1px solid var(--dq-line);
  border-radius: 12px; padding: 13px 15px; width: 100%;
  transition: border-color .3s, box-shadow .3s;
}
.dq-field input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(244,124,32,0.16);
}
.dq-field--full { grid-column: 1 / -1; }
.dq-form__rgpd {
  font-family: var(--sans); font-size: 12px; color: var(--muted);
  line-height: 1.55; margin: 14px 0 16px; display: flex; gap: 9px; align-items: flex-start;
}
.dq-form__rgpd input { margin-top: 2px; accent-color: var(--accent); flex: none; }
.dq-form__submit {
  font-family: var(--sans); font-size: 16px; font-weight: 700;
  background: var(--accent); color: var(--accent-ink);
  border: none; border-radius: 999px; padding: 15px 30px; cursor: pointer;
  width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  transition: background .35s var(--ease), transform .35s var(--ease);
}
.dq-form__submit svg { width: 17px; height: 17px; }
.dq-form__submit:hover { background: var(--accent-bright); transform: translateY(-2px); }
.dq-form__submit:disabled { opacity: 0.55; cursor: wait; transform: none; }
.dq-form__err {
  font-family: var(--sans); font-size: 13px; color: var(--dq-red);
  margin: 12px 0 0; text-align: center;
}
.dq-form__err[hidden] { display: none; }

/* Écran de confirmation */
.dq-done { display: none; text-align: center; padding: 10px 0; }
.dq-done.is-active { display: block; animation: dqStepIn .5s var(--ease); }
.dq-done__icon {
  width: 68px; height: 68px; margin: 0 auto 20px; border-radius: 50%;
  background: rgba(111,168,75,0.14); border: 1px solid rgba(111,168,75,0.5);
  display: flex; align-items: center; justify-content: center;
}
.dq-done__icon svg { width: 32px; height: 32px; stroke: var(--dq-green); }
.dq-done__title { font-family: var(--serif); font-size: clamp(26px, 3.4vw, 38px); color: var(--fg); margin: 0 0 10px; }
.dq-done__txt { font-family: var(--sans); font-size: 15.5px; color: var(--fg-soft); line-height: 1.7; max-width: 46ch; margin: 0 auto 20px; }
.dq-restart {
  font-family: var(--sans); font-size: 14px; color: var(--muted);
  background: none; border: none; cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px;
}
.dq-restart:hover { color: var(--fg-soft); }

/* ---- Responsive --------------------------------------------- */
@media (max-width: 620px) {
  .dq-opts { grid-template-columns: 1fr; }
  .dq-form__row { grid-template-columns: 1fr; }
  .dq-score { gap: 18px; }
  .dq-nav { flex-wrap: wrap; }
}

/* ---- Reduced motion : pas d'aimantation ni de sweep animé --- */
@media (prefers-reduced-motion: reduce) {
  .dq-step.is-active,
  .dq-result.is-active,
  .dq-done.is-active,
  .dq-form.is-open { animation: none; }
  .dq-opt { transition: border-color .2s, background .2s, color .2s; }
  .dq-opt__dot { transition: none; }
  .dq-opt__label, .dq-opt__hover { transition: none; }
  .dq-ring__val { transition: none; }
  .dq-progress__fill { transition: none; }
  /* fill net sans animation : fond plein sur hover/selected */
  @media (hover: hover) {
    .dq-opt:hover .dq-opt__dot { transform: translateY(-50%) scale(72); }
  }
  .dq-opt.is-selected .dq-opt__dot { transform: translateY(-50%) scale(72); }
}
