/* Ensemble Ressources : styles isolés sous .ensp, polices héritées du thème. */
.ensp {
  --ensp-yellow: #ffdd00;
  --ensp-orange: #fbb034;
  --ensp-green: #4ed199;
  --ensp-blue: #037ef3;
  --ensp-ink: #111111;
  --ensp-text: #374151;
  --ensp-muted: #6b7280;
  --ensp-line: #e5e7eb;
  --ensp-soft: #f6f7f9;
  --ensp-radius: 18px;
  font-family: inherit;
  color: var(--ensp-text);
  line-height: 1.6;
  box-sizing: border-box;
}
.ensp *, .ensp *::before, .ensp *::after { box-sizing: inherit; }
.ensp h3, .ensp h4 { color: var(--ensp-ink); margin: 0 0 .5em; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
.ensp h3 { font-size: clamp(1.35rem, 2.6vw, 1.9rem); }
.ensp h4 { font-size: 1.15rem; }
.ensp p { margin: 0 0 1em; }
.ensp [hidden] { display: none !important; }

.ensp-kicker {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ensp-ink); background: var(--ensp-yellow); padding: .3em .75em; border-radius: 8px; margin-bottom: 1em; line-height: 1.4;
}

/* Boutons ------------------------------------------------------------- */
.ensp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  background: var(--ensp-yellow); color: var(--ensp-ink) !important; border: 2px solid var(--ensp-yellow);
  font: inherit; font-weight: 700; font-size: 1rem; padding: .85em 1.7em; border-radius: 60px;
  cursor: pointer; text-decoration: none !important; transition: transform .2s, box-shadow .2s, background .2s;
}
.ensp-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -10px rgba(251,176,52,.9); }
.ensp-btn:disabled { opacity: .6; cursor: wait; transform: none; }
.ensp-btn-lg { font-size: 1.08rem; padding: 1em 2.1em; }
.ensp-btn-ghost { background: transparent; border-color: var(--ensp-ink); }
.ensp-btn-ghost:hover { background: var(--ensp-ink); color: #fff !important; box-shadow: none; }
.ensp-link { background: none; border: 0; padding: .5em 0; font: inherit; color: var(--ensp-muted); cursor: pointer; }
.ensp-link:hover { color: var(--ensp-ink); }

/* Champs -------------------------------------------------------------- */
.ensp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin: 1.2em 0; }
.ensp-span { grid-column: 1 / -1; }
.ensp-field { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 600; color: var(--ensp-ink); }
.ensp-field input, .ensp-field select {
  font: inherit; font-weight: 400; font-size: 1rem; width: 100%; padding: .8em 1em; color: var(--ensp-ink);
  background: #fff; border: 1.5px solid var(--ensp-line); border-radius: 12px; transition: border-color .2s, box-shadow .2s;
  height: auto; margin: 0;
}
.ensp-field input:focus, .ensp-field select:focus { outline: none; border-color: var(--ensp-ink); box-shadow: 0 0 0 4px rgba(255,221,0,.45); }
.ensp-field.is-invalid input { border-color: #e5484d; }
.ensp-check { display: flex; gap: .6em; align-items: flex-start; font-size: .9rem; margin: .4em 0 .6em; cursor: pointer; }
.ensp-check input { margin-top: .3em; accent-color: var(--ensp-ink); width: 18px; height: 18px; flex: none; }
.ensp-legal { font-size: .78rem; color: var(--ensp-muted); margin-bottom: 1.2em; }
.ensp-legal a { color: inherit; text-decoration: underline; }
.ensp-error { color: #c62828; font-size: .9rem; margin: .8em 0 0; }
.ensp-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Livre blanc --------------------------------------------------------- */
.ensp-lb { background: #fff; border-radius: var(--ensp-radius); padding: clamp(22px, 4vw, 40px); box-shadow: 0 30px 60px -30px rgba(17,17,17,.25); position: relative; overflow: hidden; }
.ensp-lb::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: linear-gradient(90deg, var(--ensp-orange), var(--ensp-yellow), var(--ensp-green)); }
.ensp-lb .ensp-lead { color: var(--ensp-muted); }
.ensp-theme-sombre { background: var(--ensp-ink); color: #d1d5db; }
.ensp-theme-sombre h3, .ensp-theme-sombre .ensp-field { color: #fff; }
.ensp-theme-sombre .ensp-field input { background: #1c1c1c; border-color: #333; color: #fff; }
.ensp-nl .ensp-btn { margin-top: 4px; }
.ensp-nl .ensp-legal { margin-top: 14px; }
.ensp-nl .ensp-done { padding: .5em 0; }
.ensp-done { text-align: center; padding: 1em 0; }
.ensp-done-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; background: var(--ensp-yellow); color: var(--ensp-ink); font-size: 30px; font-weight: 700; display: grid; place-items: center; animation: ensp-pop .5s cubic-bezier(.2,1.4,.4,1); }
@keyframes ensp-pop { from { transform: scale(.3); opacity: 0; } }

/* Bandeau CTA --------------------------------------------------------- */
.ensp-cta { display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--ensp-ink); color: #d1d5db; border-radius: var(--ensp-radius); padding: 28px 32px; margin: 2em 0; }
.ensp-cta > div { flex: 1 1 320px; }
.ensp-cta-title { color: #fff; font-size: 1.35rem; font-weight: 700; margin: 0 0 .3em !important; line-height: 1.3; }
.ensp-cta p:last-child { margin: 0; }

/* Diagnostic ---------------------------------------------------------- */
.ensp-diag { container-type: inline-size; background: #fff; border-radius: var(--ensp-radius); box-shadow: 0 30px 70px -35px rgba(17,17,17,.3); padding: clamp(22px, 5vw, 56px); position: relative; overflow: hidden; min-height: 420px; scroll-margin-top: 120px; }
.ensp-diag::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: linear-gradient(90deg, var(--ensp-orange), var(--ensp-yellow), var(--ensp-green)); }
.ensp-stage { opacity: 0; transform: translateY(14px); transition: opacity .35s ease, transform .35s ease; }
.ensp-stage.is-in { opacity: 1; transform: none; }
.ensp-loading { color: var(--ensp-muted); }

.ensp-intro { max-width: 720px; }
.ensp-intro p { font-size: 1.05rem; }
.ensp-intro-list { list-style: none; padding: 0; margin: 1.2em 0 1.8em; display: flex; flex-wrap: wrap; gap: 8px; }
.ensp-intro-list li { background: var(--ensp-soft); border: 1px solid var(--ensp-line); padding: .4em .9em; border-radius: 40px; font-size: .88rem; font-weight: 600; color: var(--ensp-ink); }

.ensp-progress { height: 6px; background: var(--ensp-soft); border-radius: 6px; margin-bottom: 28px; overflow: hidden; }
.ensp-progress div { height: 100%; background: var(--ensp-ink); border-radius: 6px; transition: width .45s cubic-bezier(.4,0,.2,1); }

.ensp-q h3 { min-height: 2.6em; max-width: 820px; }
.ensp-ctx { display: grid; gap: 16px; max-width: 560px; margin: 1.2em 0 .4em; }

.ensp-opts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 1.6em 0 1em; }
.ensp-opt {
  font: inherit; background: #fff; border: 1.5px solid var(--ensp-line); border-radius: 14px; padding: 16px 8px 14px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ensp-text); transition: all .18s;
}
.ensp-opt b { font-size: 1.5rem; line-height: 1; color: var(--ensp-ink); }
.ensp-opt span { font-size: .8rem; text-align: center; line-height: 1.25; min-height: 1.25em; }
.ensp-opt:hover { border-color: var(--ensp-ink); transform: translateY(-3px); }
.ensp-opt.is-on { background: var(--ensp-yellow); border-color: var(--ensp-yellow); transform: translateY(-3px) scale(1.03); box-shadow: 0 12px 24px -12px rgba(251,176,52,.9); }
.ensp-opt:focus-visible { outline: 3px solid var(--ensp-blue); outline-offset: 2px; }

.ensp-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 1.4em; gap: 12px; }
.ensp-gate .ensp-form { max-width: 620px; }

/* Résultat ------------------------------------------------------------ */
.ensp-res > * { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.ensp-res.is-in > * { opacity: 1; transform: none; }
.ensp-res.is-in > *:nth-child(2) { transition-delay: .1s; }
.ensp-res.is-in > *:nth-child(3) { transition-delay: .2s; }
.ensp-res.is-in > *:nth-child(4) { transition-delay: .3s; }
.ensp-res.is-in > *:nth-child(5) { transition-delay: .4s; }
.ensp-res.is-in > *:nth-child(6) { transition-delay: .5s; }

.ensp-res-hero { display: flex; gap: 32px; align-items: center; background: var(--ensp-ink); color: #d1d5db; border-radius: 16px; padding: clamp(20px, 4vw, 36px); margin-bottom: 18px; }
.ensp-res-hero h3 { color: #fff; }
.ensp-res-hero p { margin: 0; }
.ensp-res-score { position: relative; width: 150px; height: 150px; flex: none; }
.ensp-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ensp-ring circle { fill: none; stroke-width: 11; }
.ensp-ring-bg { stroke: #2a2a2a; }
.ensp-ring-fg { stroke: var(--ensp-yellow); stroke-linecap: round; stroke-dashoffset: 340; transition: stroke-dashoffset 1.4s cubic-bezier(.4,0,.2,1) .2s; }
.ensp-res.is-in .ensp-ring-fg { stroke-dashoffset: var(--ensp-off); }
.ensp-res-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; }
.ensp-res-num b { font-size: 2.8rem; line-height: 1; }
.ensp-res-num span { font-size: .9rem; color: #9ca3af; }
.ensp-note { background: var(--ensp-soft); border-left: 4px solid var(--ensp-green); padding: .8em 1em; border-radius: 8px; font-size: .92rem; }

.ensp-res-sec { border-top: 1px solid var(--ensp-line); padding: 28px 0; }
.ensp-bars { display: grid; gap: 14px; }
.ensp-bar-head { display: flex; justify-content: space-between; font-size: .95rem; font-weight: 600; color: var(--ensp-ink); margin-bottom: 6px; }
.ensp-bar-head span:last-child { color: var(--ensp-muted); font-weight: 500; }
.ensp-bar-track { height: 12px; background: var(--ensp-soft); border-radius: 12px; overflow: hidden; }
.ensp-bar-fill { height: 100%; width: 0; border-radius: 12px; transition: width 1.1s cubic-bezier(.4,0,.2,1) .5s; }
.ensp-res.is-in .ensp-bar-fill { width: var(--ensp-w); }
.ensp-bar-fill.is-hi { background: var(--ensp-green); }
.ensp-bar-fill.is-mid { background: var(--ensp-yellow); }
.ensp-bar-fill.is-lo { background: var(--ensp-orange); }

.ensp-prio { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.ensp-prio li { display: flex; gap: 16px; background: var(--ensp-soft); border-radius: 14px; padding: 18px 20px; }
.ensp-prio-n { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--ensp-yellow); color: var(--ensp-ink); font-weight: 700; display: grid; place-items: center; }
.ensp-prio strong { color: var(--ensp-ink); }
.ensp-prio p { margin: .3em 0 0; font-size: .95rem; }

.ensp-res-mx { display: grid; grid-template-columns: minmax(220px, 320px) 1fr; gap: 32px; align-items: center; }
.ensp-mx { position: relative; padding: 0 0 28px 28px; }
.ensp-mx-grid { position: relative; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 4px; aspect-ratio: 1; }
.ensp-mx-q { background: var(--ensp-soft); border-radius: 10px; display: flex; padding: 10px; font-size: .78rem; font-weight: 700; color: var(--ensp-muted); line-height: 1.2; transition: background .4s, color .4s; }
.ensp-mx-q.tl, .ensp-mx-q.tr { align-items: flex-start; }
.ensp-mx-q.bl, .ensp-mx-q.br { align-items: flex-end; }
.ensp-mx-q.tr, .ensp-mx-q.br { justify-content: flex-end; text-align: right; }
.ensp-mx-q.is-active { background: var(--ensp-yellow); color: var(--ensp-ink); }
.ensp-mx-dot { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--ensp-ink); border: 4px solid #fff; box-shadow: 0 0 0 2px var(--ensp-ink); transform: scale(0); transition: transform .5s cubic-bezier(.2,1.4,.4,1) 1s; }
.ensp-res.is-in .ensp-mx-dot { transform: scale(1); }
.ensp-mx-ax { position: absolute; font-size: .72rem; color: var(--ensp-muted); font-weight: 600; letter-spacing: .02em; }
.ensp-mx-x { bottom: 4px; left: 28px; right: 0; text-align: center; }
.ensp-mx-y { left: 0; top: 0; bottom: 28px; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; }

.ensp-res-cta { display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--ensp-soft); border-radius: 16px; padding: 26px 28px; }
.ensp-res-cta > div:first-child { flex: 1 1 300px; }
.ensp-res-cta p { margin: 0; }
.ensp-res-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.ensp-res-foot { text-align: center; font-size: .88rem; margin: 18px 0 0; }
.ensp-res-foot a { color: var(--ensp-muted); }

@media (max-width: 680px) {
  .ensp-grid { grid-template-columns: 1fr; }
  .ensp-opts { grid-template-columns: 1fr; gap: 8px; }
  .ensp-opt { flex-direction: row; justify-content: flex-start; padding: 13px 16px; gap: 14px; }
  .ensp-opt b { font-size: 1.15rem; width: 1.2em; }
  .ensp-opt span { text-align: left; }
  .ensp-opts-scale .ensp-opt span:empty, .ensp-opts-scale .ensp-opt span { min-height: 0; }
  .ensp-res-hero { flex-direction: column; text-align: center; gap: 18px; }
  .ensp-res-mx { grid-template-columns: 1fr; }
  .ensp-q h3 { min-height: 0; }
  .ensp-res-btns .ensp-btn { width: 100%; }
}

@container (max-width: 760px) {
  .ensp-res-mx { grid-template-columns: 1fr; }
  .ensp-res-mx .ensp-mx { max-width: 340px; }
  .ensp-res-hero { flex-direction: column; text-align: center; gap: 18px; }
}
@container (max-width: 560px) {
  .ensp-opts { grid-template-columns: 1fr; gap: 8px; }
  .ensp-opt { flex-direction: row; justify-content: flex-start; padding: 13px 16px; gap: 14px; }
  .ensp-opt b { font-size: 1.15rem; width: 1.2em; }
  .ensp-opt span { text-align: left; min-height: 0; }
  .ensp-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .ensp *, .ensp-stage { transition: none !important; animation: none !important; }
}
