/* Funil de diagnóstico. Prefixo .dg — usa tokens e botões de styles/base.css */
.page-diagnostico { background: #f7f8fc; min-height: 100vh; overflow-x: clip; } /* as telas entram deslizando; nada vaza para o lado */
.dg { position: relative; max-width: 1040px; margin: 0 auto; padding: calc(var(--nav-h) + 24px) 24px 64px; }

/* ===== topo: voltar + progresso ===== */
.dg__top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; margin-bottom: 28px; }
.dg__back { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 8px; border: 0; border-radius: 999px; background: #fff; color: var(--ink-2); font: 500 13.5px Inter, sans-serif; cursor: pointer; box-shadow: 0 0 0 1px var(--line); }
.dg__back:hover { color: var(--ink); }
.dg__back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dg__back[hidden] { visibility: hidden; display: inline-flex; }
.dg__bar { height: 6px; border-radius: 999px; background: #e6e8f2; overflow: hidden; }
.dg__bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--brand-400), var(--brand-500)); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.dg__step { min-width: 120px; text-align: right; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ===== palco e transições ===== */
.dg__stage { position: relative; min-height: 520px; }
.dg__screen { position: relative; }
.dg__screen--out, .dg__screen--out-back { position: absolute; inset: 0; pointer-events: none; animation: dg-out .3s ease forwards; }
.dg__screen--out-back { animation-name: dg-out-back; }
.dg__screen--in { animation: dg-in .45s cubic-bezier(.2,.8,.2,1) both; }
.dg__screen--in-back { animation: dg-in-back .45s cubic-bezier(.2,.8,.2,1) both; }
@keyframes dg-in { from { opacity: 0; transform: translateX(36px); } }
@keyframes dg-in-back { from { opacity: 0; transform: translateX(-36px); } }
@keyframes dg-out { to { opacity: 0; transform: translateX(-36px); } }
@keyframes dg-out-back { to { opacity: 0; transform: translateX(36px); } }

/* ===== painel: ilustração + conteúdo ===== */
.dg__panel { display: grid; grid-template-columns: 300px 1fr; gap: 40px; align-items: start; padding: 36px; border-radius: 20px; background: #fff; box-shadow: 0 0 0 1px var(--line), 0 24px 60px -40px rgba(11,16,51,.25); }
.dg__ill { position: sticky; top: 100px; }
.dg__ill svg { display: block; width: 100%; height: auto; }
/* palco da ilustração voxel: grade de pontos, brilho e a cena flutuando */
.dg__art { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 16px; border: 1px solid #eceef4;
  background: radial-gradient(rgba(59,43,255,.1) 1px, transparent 1.2px) 0 0 / 16px 16px, linear-gradient(180deg, #fbfbff, #efeefe); }
.dg__art-glow { position: absolute; left: 50%; top: 56%; width: 80%; height: 80%; transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(circle, rgba(123,108,255,.35), transparent 65%); }
.dg__art img { position: relative; display: block; width: 92%; height: auto; margin: 4% auto 0; filter: drop-shadow(0 24px 22px rgba(11,16,51,.18));
  animation: dg-pop .7s cubic-bezier(.34,1.56,.64,1) both .08s, dg-float 4.5s ease-in-out infinite .8s; }
@keyframes dg-pop { from { opacity: 0; transform: scale(.8) rotate(-6deg); } }
@keyframes dg-float { 50% { transform: translateY(-8px) rotate(1.5deg); } }
@media (prefers-reduced-motion: reduce) { .dg__art img { animation: none; } }
.dg__kicker { display: inline-block; margin-bottom: 12px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-500); }
.dg__copy h1, .dg__copy h2 { font-size: clamp(24px, 2.8vw, 32px); line-height: 1.18; letter-spacing: -.025em; font-weight: 600; color: var(--ink); text-wrap: balance; }
.dg__copy > p, .dg__sub { margin-top: 12px; font-size: 16px; line-height: 1.6; color: var(--ink-2); }
.dg__panel--intro .btn { margin-top: 28px; }
.dg__note { display: block; margin-top: 12px; font-size: 13px; color: var(--muted); }

/* ===== opções ===== */
.dg__options { display: grid; gap: 10px; margin-top: 22px; }
.dg__opt {
  display: flex; align-items: flex-start; gap: 14px; width: 100%; padding: 14px 16px; text-align: left; cursor: pointer;
  border: 0; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow .15s, background .15s, transform .15s;
}
.dg__opt:hover { box-shadow: inset 0 0 0 1px var(--brand-300); background: #fcfbff; }
.dg__opt:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.dg__opt:active { transform: scale(.995); }
.dg__opt.is-on { background: var(--brand-50); box-shadow: inset 0 0 0 2px var(--brand-500); }
.dg__opt-mark { flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px #c9cde0; color: #fff; transition: background .15s, box-shadow .15s; }
.dg__opt-mark svg { width: 12px; height: 12px; opacity: 0; }
.dg__opt.is-on .dg__opt-mark { background: var(--brand-500); box-shadow: none; }
.dg__opt.is-on .dg__opt-mark svg { opacity: 1; }
.dg__opt-text b { display: block; font-size: 15.5px; font-weight: 600; line-height: 1.35; color: var(--ink); }
.dg__opt-text small { display: block; margin-top: 2px; font-size: 13px; color: var(--ink-2); }
.dg__continue { margin-top: 20px; }
.dg__continue:disabled { opacity: .45; cursor: not-allowed; }

/* ===== lead ===== */
.dg__preview { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: var(--brand-50); font-size: 14px; line-height: 1.5; color: var(--brand-700); box-shadow: inset 0 0 0 1px var(--brand-100); }
.dg__form { display: grid; gap: 14px; margin-top: 20px; max-width: 460px; }
.dg__form label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.dg__form label span { font-weight: 400; color: var(--muted); }
.dg__form input { height: 46px; padding: 0 14px; border: 1px solid #d9dceb; border-radius: 10px; font: 400 15px Inter, sans-serif; color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s; }
.dg__form input:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(59,43,255,.15); }
.dg__form .btn { margin-top: 6px; }
.dg__error { padding: 10px 12px; border-radius: 8px; background: #fef2f2; color: #b91c1c; font-size: 13.5px; }

/* ===== resultado ===== */
.dg--result .dg__top { margin-bottom: 20px; }
.dg__panel--result { display: block; padding: 0; overflow: hidden; }
.dg__result-head { padding: 40px 40px 28px; background: linear-gradient(135deg, var(--brand-900), var(--brand-600) 70%, var(--brand-500)); color: #fff; }
.dg__result-head .dg__kicker { color: #c9c3ff; }
.dg__result-head h2 { font-size: clamp(26px, 3vw, 36px); line-height: 1.12; letter-spacing: -.03em; font-weight: 600; max-width: 20ch; }
.dg__result-head p { margin-top: 14px; max-width: 640px; font-size: 16.5px; line-height: 1.6; color: #d2cdff; }
.dg__result-head p b { color: #fff; }
.dg__stats { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.dg__stats > div { padding: 22px 28px; border-left: 1px solid var(--line); }
.dg__stats > div:first-child { border-left: 0; }
.dg__stats b { display: block; font-size: 26px; font-weight: 600; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.dg__stats small { display: block; margin-top: 4px; font-size: 13px; color: var(--ink-2); }
.dg__reco { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; padding: 32px 40px; }
.dg__reco-media { margin: 0; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 40px -24px rgba(11,16,51,.4), 0 0 0 1px var(--line); }
.dg__reco-media img { display: block; width: 100%; height: auto; }
.dg__reco-text h3 { font-size: 22px; letter-spacing: -.02em; font-weight: 600; color: var(--ink); }
.dg__reco-text ul { list-style: none; display: grid; gap: 10px; margin-top: 14px; }
.dg__reco-text li { display: flex; gap: 10px; font-size: 15px; line-height: 1.5; color: var(--ink); }
.dg__reco-text li svg { flex: none; width: 16px; height: 16px; margin-top: 4px; color: var(--brand-500); }
.dg__reco-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; font-size: 15px; font-weight: 600; color: var(--brand-500); }
.dg__next { padding: 28px 40px 36px; border-top: 1px solid var(--line); background: var(--tint); }
.dg__next p { max-width: 640px; font-size: 16px; line-height: 1.6; color: var(--ink); }
.dg__next .btn { margin-top: 18px; gap: 10px; }
.dg__next .btn svg { width: 20px; height: 20px; }

/* ===== responsivo ===== */
@media (max-width: 860px) {
  .dg { padding: calc(var(--nav-h) + 16px) 16px 48px; }
  .dg__top { gap: 12px; margin-bottom: 18px; }
  .dg__step { min-width: 0; font-size: 12.5px; }
  .dg__panel { grid-template-columns: 1fr; gap: 10px; padding: 22px 18px 24px; border-radius: 16px; }
  .dg__ill { position: static; width: 180px; margin: 0 auto 6px; }
  .dg__art { border-radius: 14px; }
  .dg__copy h1, .dg__copy h2 { font-size: 23px; text-align: center; }
  .dg__kicker { display: block; text-align: center; }
  .dg__copy > p, .dg__sub { text-align: center; font-size: 15px; }
  .dg__panel--intro .dg__copy { text-align: center; }
  .dg__panel--intro .btn, .dg__continue, .dg__form .btn { width: 100%; }
  .dg__opt { padding: 13px 14px; }
  .dg__opt-text b { font-size: 15px; }
  .dg__form { max-width: none; }
  .dg__result-head { padding: 28px 20px 22px; }
  .dg__stats { grid-template-columns: 1fr; }
  .dg__stats > div { border-left: 0; border-top: 1px solid var(--line); padding: 16px 20px; }
  .dg__stats > div:first-child { border-top: 0; }
  .dg__reco { grid-template-columns: 1fr; gap: 20px; padding: 24px 20px; }
  .dg__next { padding: 22px 20px 28px; }
  .dg__next .btn, .dg__panel--intro .btn, .dg__form .btn, .dg__continue { width: 100%; height: auto; min-height: 50px; padding: 12px 18px; white-space: normal; text-align: center; line-height: 1.25; }
  .dg__result-head h2 { max-width: none; }
  .dg__panel--result { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .dg__screen--in, .dg__screen--in-back, .dg__screen--out, .dg__screen--out-back { animation: none; }
}
