/* ============================================================
   CGP CHEVERNEUIL — Auto-évaluation patrimoniale
   Feuille de style alignée sur le design system du site
   (Playfair Display + Montserrat, bleu nuit + or, fond crème).
   Toutes les classes sont préfixées .dg- pour éviter toute
   collision avec site-v7.css / v2-main.css.
   ============================================================ */

/* ============ EN-TÊTE DE PAGE ============ */
.dg-hero {
  padding: clamp(48px, 6vw, 80px) var(--pad-x) 40px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.dg-hero-inner { max-width: var(--max); margin: 0 auto; }
.dg-hero-title {
  font-family: var(--serif);
  font-size: var(--t-h1);
  font-weight: 500;
  line-height: 1.1;
  color: var(--ink);
  margin: 16px 0 12px;
  letter-spacing: -0.01em;
}
.dg-hero-title em { font-style: italic; color: var(--gold-ink); }
.dg-hero-lede {
  font-size: clamp(18.5px, 1.5vw, 21px);
  color: var(--ink-muted);
  max-width: 62ch;
  line-height: 1.6;
}

/* ============ CONTENEUR ============ */
.dg-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(28px, 4vw, 48px) var(--pad-x) 72px;
}

/* ============ ÉCRANS ============ */
main .dg-screen { display: none; padding-top: clamp(32px, 4vw, 48px); }
main .dg-screen.is-on { display: block; animation: dg-in 0.35s ease; }
@keyframes dg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { main .dg-screen.is-on { animation: none; } }
.dg-stack > * + * { margin-top: 20px; }

/* ============ TYPOGRAPHIE ============ */
.dg-eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-ink);
}
.dg-title {
  font-family: var(--serif);
  font-size: clamp(30px, 4.2vw, 44px);
  font-weight: 500;
  line-height: 1.14;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.dg-title em { font-style: italic; color: var(--gold-ink); }
.dg-subtitle {
  font-family: var(--serif);
  font-size: clamp(23px, 2.6vw, 31px);
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.dg-h3 {
  font-family: var(--serif);
  font-size: clamp(21px, 2.2vw, 26px);
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
}
.dg-lead {
  font-size: 19px;
  line-height: 1.65;
  color: var(--ink-muted);
}
.dg-note {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-faint);
}

/* ============ BOUTONS ============ */
.dg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 14px 26px;
  background: var(--forest);
  color: #f8f7f4;
  border: 1px solid var(--forest);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.dg-btn:hover { background: var(--forest-deep); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.dg-btn:active { transform: none; }
.dg-btn--full { width: 100%; }
.dg-btn--ghost {
  background: transparent;
  color: var(--forest);
  border-color: var(--forest);
}
.dg-btn--ghost:hover { background: var(--forest); color: #f8f7f4; }
.dg-btn:focus-visible,
.dg-opt:focus-visible,
.dg-back:focus-visible,
.dg-restart:focus-visible,
.dg-copy:focus-visible {
  outline: 2px solid var(--gold-ink);
  outline-offset: 3px;
}

/* ============ INTRO : étapes + garanties ============ */
.dg-steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  font-size: 15px;
  color: var(--ink-faint);
}
.dg-steps span {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 10px 14px;
  background: var(--bg-card);
}
.dg-steps b {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--gold-ink);
  margin-right: 8px;
}
.dg-ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.dg-ticks li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.dg-ticks li::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  margin-top: 9px;
}

/* ============ QUIZ ============ */
.dg-prog {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.dg-bar {
  flex: 1;
  height: 3px;
  background: var(--line-strong);
  border-radius: 3px;
  overflow: hidden;
}
.dg-bar i {
  display: block;
  height: 100%;
  background: var(--gold);
  width: 0;
  transition: width 0.35s ease;
}
.dg-back {
  background: none;
  border: 0;
  padding: 8px 0;
  min-height: 44px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-faint);
  cursor: pointer;
}
.dg-back:hover { color: var(--ink); }
.dg-back[disabled] {
  visibility: hidden;
}
/* mode premier écran : retour vers l'intro */
.dg-back.is-first {
  color: var(--gold-ink);
  font-weight: 700;
}
.dg-back.is-first::after {
  content: " (début du questionnaire)";
  font-weight: 500;
  color: var(--ink-faint);
}

.dg-opts { display: grid; gap: 10px; margin-top: 24px; }
.dg-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 15px 18px;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.dg-opt small {
  display: block;
  color: var(--ink-muted);
  font-size: 14.5px;
  font-weight: 400;
  margin-top: 3px;
}
.dg-opt::after {
  content: "→";
  color: var(--gold-ink);
  opacity: 0;
  transition: opacity var(--t-fast);
  flex: none;
}
.dg-opt:hover { border-color: var(--forest); background: #fff; }
.dg-opt:hover::after { opacity: 1; }
.dg-opt.is-sel { border-color: var(--forest); background: var(--tint-gold); }

/* ============ CARTES ============ */
.dg-card {
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 26px 22px;
}
.dg-card--info { background: #fff; border-left: 3px solid var(--gold); }
.dg-card--info h4 {
  margin: 0 0 8px;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.dg-card--info p { font-size: 17px; line-height: 1.65; color: var(--ink-muted); }
.dg-card--info p + p { margin-top: 12px; }

/* ============ RÉSULTAT : verdict ============ */
.dg-verdict { display: flex; gap: 20px; align-items: center; }
.dg-ring { flex: none; width: 96px; height: 96px; position: relative; }
.dg-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dg-ring b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 33px;
  font-weight: 600;
  color: var(--ink);
}
.dg-tag {
  display: inline-block;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 11px;
  border-radius: var(--radius);
  background: var(--gold-pale);
  color: var(--gold-ink);
  white-space: nowrap;
}
.dg-tag--ok { background: rgba(31, 122, 77, 0.10); color: var(--ok-green); }
.dg-tag--hot { background: rgba(179, 69, 58, 0.10); color: var(--ko-red); }
.dg-tag--gold { background: rgba(210, 138, 44, 0.16); color: var(--gold-ink); }
.dg-tag--dark { background: var(--forest-deep); color: #f8f7f4; }

/* ============ SECTIONS DU RÉSULTAT ============ */
.dg-sec { margin-top: 48px; }
.dg-sec > .dg-h3 { margin-bottom: 8px; }

.dg-axis { padding: 20px 0; border-top: 1px solid var(--line); }
.dg-axis:first-child { border-top: 0; padding-top: 4px; }
.dg-axis:last-child { padding-bottom: 4px; }
.dg-axis .dg-axis-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.dg-axis .dg-axis-top b {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.dg-axis p { font-size: 16px; line-height: 1.6; color: var(--ink-faint); margin-top: 10px; }

.dg-track {
  height: 8px;
  border-radius: 8px;
  background: var(--line-strong);
  overflow: hidden;
  margin-top: 12px;
}
.dg-track i {
  display: block;
  height: 100%;
  border-radius: 8px;
  transition: width 0.5s ease;
}

/* ============ SIMULATEUR ============ */
.dg-sim-row { margin-top: 20px; }
.dg-sim-row label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-faint);
}
.dg-sim-row label b {
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dg-sim-row input[type="range"] {
  width: 100%;
  accent-color: var(--forest);
  margin: 10px 0 0;
  height: 32px;
  cursor: pointer;
}
.dg-out { margin-top: 28px; display: grid; gap: 6px; }
.dg-sc { padding: 12px; border-radius: var(--radius); border: 1px solid transparent; }
.dg-sc.is-me { background: var(--tint-gold); border-color: var(--gold); }
.dg-sc .dg-sc-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  font-size: 14.5px;
}
.dg-sc .dg-sc-line span { font-weight: 600; color: var(--ink-soft); }
.dg-sc .dg-sc-line small { color: var(--ink-faint); font-weight: 500; }
.dg-sc .dg-sc-line b {
  font-size: 17px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dg-sc .dg-track { margin-top: 8px; background: var(--line); }
.dg-sc .dg-me-tag {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-ink);
  margin-bottom: 5px;
}
.dg-gap {
  border-top: 1px solid var(--line-strong);
  padding-top: 20px;
  margin-top: 18px;
  text-align: center;
}
.dg-gap strong {
  display: block;
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  margin: 6px 0;
}

/* ============ PISTES ============ */
.dg-piste {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 18px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.dg-piste:first-of-type { border-top: 0; }
.dg-piste .dg-piste-n {
  font-family: var(--serif);
  font-size: 32px;
  line-height: 1;
  color: var(--gold);
  grid-row: span 3;
}
.dg-piste h4 {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}
.dg-piste p { font-size: 16.5px; line-height: 1.6; color: var(--ink-muted); }
.dg-piste .dg-why {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-top: 10px;
}
.dg-piste .dg-why b {
  color: var(--gold-ink);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 12px;
}

/* ============ CTA ============ */
.dg-cta {
  background: var(--forest-deep);
  color: #f8f7f4;
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
}
.dg-cta .dg-h3 { color: #f8f7f4; font-size: clamp(24px, 3vw, 31px); }
.dg-cta em { font-style: italic; color: var(--gold-light); }
.dg-cta p { color: rgba(248, 247, 244, 0.82); font-size: 15.5px; line-height: 1.65; }
.dg-cta .dg-btn { background: var(--gold); border-color: var(--gold); color: var(--forest-deep); }
.dg-cta .dg-btn:hover { background: var(--gold-light); border-color: var(--gold-light); }
.dg-cta .dg-mini { font-size: 13px; color: rgba(248, 247, 244, 0.65); }
.dg-cta .dg-copy {
  background: none;
  border: 0;
  color: #f8f7f4;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  padding: 10px;
  min-height: 44px;
}
.dg-cta--light {
  background: var(--bg-card);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.dg-cta--light .dg-h3 { color: var(--ink); }
.dg-cta--light p { color: var(--ink-muted); }
.dg-cta--light em { color: var(--gold-ink); }
.dg-cta--light .dg-btn { background: var(--forest); border-color: var(--forest); color: #f8f7f4; }
.dg-cta--light .dg-btn:hover { background: var(--forest-deep); }
.dg-cta--light .dg-mini { color: var(--ink-faint); }
.dg-cta--light .dg-copy { color: var(--ink); }

.dg-quick { margin-top: 20px; }

/* ============ MENTIONS + RELANCE ============ */
.dg-legal {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--line-strong);
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-faint);
  display: grid;
  gap: 10px;
}
.dg-legal a { color: var(--gold-ink); }
.dg-restart {
  background: none;
  border: 0;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-faint);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  margin: 32px auto 0;
  display: block;
  min-height: 44px;
  padding: 8px 16px;
}
.dg-restart:hover { color: var(--ink); }

/* ============ RESPONSIVE ============ */
@media (max-width: 640px) {
  .dg-steps { grid-template-columns: 1fr; }
  .dg-verdict { flex-direction: column; align-items: flex-start; gap: 14px; }
  .dg-cta { padding: 28px 18px; }
  .dg-card { padding: 22px 18px; }
  .dg-opt { font-size: 15.5px; padding: 14px 16px; }
}

/* ============ CORRECTIFS QC (11/11) ============ */
.dg-card--flush { padding-top: 6px; padding-bottom: 6px; }
.dg-h4 {
  margin: 0;
  font-family: var(--sans);
  font-size: 16.5px;
  font-weight: 700;
  color: var(--ink);
}
.dg-cta.dg-stack > * + * { margin-top: 16px; }
.dg-cta .dg-btn { margin-top: 8px; }
.dg-cta .dg-mini { display: block; margin-top: 4px; }
.dg-hero-lede { max-width: 68ch; }
/* hiérarchie : corps de page jamais en dessous de 15px */
.dg-axis .dg-axis-top b { font-size: 17px; }
.dg-sc .dg-sc-line { font-size: 15px; }
.dg-sc .dg-sc-line b { font-size: 18px; }
.dg-sim-row label { font-size: 15.5px; }
.dg-cta-p { font-size: 16px; line-height: 1.65; }

/* --- mention réglementaire (intro) --- */
.dg-notice {
  margin: 18px 0 4px;
  padding: 14px 16px;
  border-left: 3px solid var(--gold);
  background: var(--tint-gold);
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.62;
  color: var(--ink-soft);
}
.dg-notice strong { color: var(--ink); font-weight: 600; }

/* --- simulateur en fourchette --- */
.dg-sc small.dg-sc-range { display: block; color: var(--ink-faint); font-weight: 500; margin-top: 2px; }
.dg-sc-line b.dg-sc-vals { font-variant-numeric: tabular-nums; }

/* ============ JAUGES 4 NIVEAUX ============ */
.dg-gauge {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr; /* 4 niveaux de largeur égale : le curseur est placé par le script à l'intérieur du bon segment */
  gap: 3px;
  margin-top: 22px;
}
.dg-gauge-seg {
  display: block;
  height: 34px;
  border-radius: var(--radius);
  background: var(--line);
  position: relative;
  font-style: normal;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.dg-gauge-seg b {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0.45;
  color: var(--ink-muted);
}
.dg-gauge-seg.is-s1 { background: rgba(31, 122, 77, 0.14); }
.dg-gauge-seg.is-s2 { background: rgba(210, 138, 44, 0.12); }
.dg-gauge-seg.is-s3 { background: rgba(210, 138, 44, 0.22); }
.dg-gauge-seg.is-s4 { background: rgba(138, 90, 26, 0.22); }
.dg-gauge-seg.is-on { box-shadow: inset 0 0 0 2px var(--gold-ink); }
.dg-gauge-seg.is-on b { opacity: 1; color: var(--ink); }
.dg-gauge-pin {
  position: absolute;
  top: -7px;
  width: 3px;
  height: 48px;
  background: var(--forest-deep);
  border-radius: 2px;
  transition: left .8s cubic-bezier(.4,0,.2,1);
  left: 0;
}
.dg-gauge-pin::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--forest-deep);
}
@media (max-width: 640px) {
  .dg-gauge { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .dg-gauge-seg { height: 30px; }
  .dg-gauge-seg b { font-size: 8.5px; letter-spacing: 0; }
  .dg-gauge-pin { height: 44px; }
}

/* ============ REMARQUES DE COHÉRENCE (sous le verdict) ============ */
.dg-coh:empty { display: none; }
.dg-coh { margin-top: 14px; padding: 12px 14px; border-left: 3px solid var(--gold); background: var(--tint-gold); border-radius: var(--radius); }
.dg-coh .dg-note + .dg-note { margin-top: 6px; }
