.page-diag { background: var(--bg-light); }

.diag-hero {
  position: relative; overflow: hidden;
  padding: calc(var(--header-h) + 64px) 0 150px;
  background: var(--navy-950); color: var(--white); text-align: center;
}
.diag-hero__inner { position: relative; max-width: 820px; }
.diag-hero h1 { font-size: clamp(1.9rem, 4vw, 3rem); }
.diag-hero p { color: var(--muted-light); font-size: 1.1rem; max-width: 640px; margin-inline: auto; }

.diag-wrap { position: relative; padding: 0 0 100px; margin-top: -100px; }
.container--quiz { width: calc(100% - 40px); max-width: 900px; width: min(900px, 100% - 40px); }

.quiz-card {
  position: relative;
  background: var(--white);
  border-radius: 24px;
  padding: 44px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}
.quiz-card::before {
  content: ""; position: absolute; left: 44px; right: 44px; top: 0; height: 4px;
  border-radius: 0 0 4px 4px; background: var(--grad-brand);
}

.intro { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: start; }
.intro h2 { font-size: 1.6rem; }
.intro__text > p { color: var(--muted); }
.intro__list { list-style: none; padding: 0; margin: 24px 0 32px; display: grid; gap: 16px; }
.intro__list li { display: flex; gap: 14px; align-items: flex-start; }
.intro__list svg { width: 40px; height: 40px; padding: 9px; border-radius: 11px; background: rgba(14,90,122,.1); color: var(--teal-600); }
.intro__list strong { display: block; font-family: var(--font-head); font-weight: 600; }
.intro__list span { color: var(--muted); font-size: .93rem; }
.intro__areas {
  background: var(--navy-900); color: var(--white);
  border-radius: 18px; padding: 28px;
  display: grid; gap: 12px;
  background-image: radial-gradient(400px 200px at 100% 0%, rgba(14,90,122,.5), transparent 70%);
}
.intro__areas { grid-template-columns: 1fr 1fr; gap: 10px; padding: 24px; }
.intro__areas .area-pill { padding: 11px 12px; font-size: .88rem; gap: 9px; }
.intro__areas-title { grid-column: 1 / -1; margin: 0 0 4px; font-family: var(--font-head); font-weight: 600; color: var(--gold-light); font-size: .8rem; text-transform: uppercase; letter-spacing: .16em; }
.area-pill { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); font-weight: 500; }
.area-pill span { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); }

.progress { margin-bottom: 34px; }
.progress__top { display: flex; justify-content: space-between; gap: 12px; font-size: .85rem; font-weight: 600; margin-bottom: 10px; }
.progress__top span:first-child { color: var(--teal-600); text-transform: uppercase; letter-spacing: .1em; font-size: .78rem; }
.progress__top span:last-child { color: var(--muted); }
.progress__bar { height: 8px; border-radius: 99px; background: var(--bg-light); overflow: hidden; }
.progress__bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad-brand); transition: width .5s ease; }

.step-panel { animation: stepIn .45s ease; }
.step-panel h2 { font-size: 1.6rem; margin-bottom: 6px; }
.step-panel__intro { color: var(--muted); margin-bottom: 30px; }
@keyframes stepIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

.q { border: 0; padding: 0; margin: 0 0 30px; min-width: 0; }
.q__label { display: block; padding: 0; font-family: var(--font-head); font-weight: 600; font-size: 1.04rem; margin-bottom: 12px; color: var(--ink); }
.q__label em { font-style: normal; font-weight: 400; color: var(--muted); font-size: .9rem; }
.q__help { margin: -6px 0 12px; font-size: .88rem; color: var(--muted); }
.q.is-invalid .q__label { color: #c23a3a; }
.q.is-invalid .opt__box { border-color: rgba(214,69,69,.5); }

.opts { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 10px; }
.opt { position: relative; cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt__box {
  display: flex; align-items: center; gap: 12px; height: 100%;
  padding: 13px 16px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--white);
  font-size: .95rem; line-height: 1.35;
  transition: border-color .2s, background .2s, box-shadow .2s, transform .15s;
}
.opt:hover .opt__box { border-color: var(--teal-400); }
.opt__mark {
  flex-shrink: 0; width: 20px; height: 20px;
  border: 2px solid #c3cfdc; border-radius: 50%;
  display: grid; place-items: center;
  transition: border-color .2s, background .2s;
}
.opt--checkbox .opt__mark { border-radius: 6px; }
.opt input:checked + .opt__box {
  border-color: var(--teal-600);
  background: rgba(14,90,122,.06);
  box-shadow: 0 0 0 3px rgba(30,163,200,.15);
  font-weight: 500;
}
.opt input:checked + .opt__box .opt__mark { border-color: var(--teal-600); background: var(--teal-600); }
.opt--radio input:checked + .opt__box .opt__mark::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--white); }
.opt--checkbox input:checked + .opt__box .opt__mark::after {
  content: ""; width: 5px; height: 10px; margin-top: -2px;
  border: solid var(--white); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.opt input:focus-visible + .opt__box { outline: 2px solid var(--gold); outline-offset: 2px; }
.opt:active .opt__box { transform: scale(.98); }

.q textarea,
.field input {
  width: 100%; font: inherit; font-size: 16px; 
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--bg-light); color: var(--ink);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.q textarea { resize: vertical; }
.q textarea:focus, .field input:focus { outline: none; border-color: var(--teal-400); background: var(--white); box-shadow: 0 0 0 4px rgba(30,163,200,.15); }
.field input.is-invalid { border-color: #d64545; box-shadow: 0 0 0 4px rgba(214,69,69,.12); }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 6px; font-size: .88rem; font-weight: 600; }
.req { color: var(--orange); }

.consent { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 12px; background: var(--bg-light); border: 1.5px solid transparent; cursor: pointer; font-size: .92rem; color: var(--muted); }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--teal-600); flex-shrink: 0; }
.consent.is-invalid { border-color: rgba(214,69,69,.5); }

.quiz-error { min-height: 1.4em; margin: 0 0 10px; color: #c23a3a; font-size: .92rem; font-weight: 500; }
.quiz-nav { display: flex; justify-content: space-between; gap: 12px; padding-top: 24px; border-top: 1px solid var(--line); }

.btn--outline { border-color: var(--line); color: var(--ink); background: var(--white); }
.btn--outline:hover { border-color: var(--navy-900); }
.btn--outline:hover svg { transform: none; }
.btn--light { background: var(--white); color: var(--navy-900); }
.btn--light:hover { transform: translateY(-2px); }

.result { animation: stepIn .5s ease; }
.result__head { display: grid; grid-template-columns: auto 1fr; gap: 36px; align-items: center; padding-bottom: 34px; border-bottom: 1px solid var(--line); }
.result__head h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
.result__head p { color: var(--muted); margin: 0; }
.level { background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }

.gauge { position: relative; width: 180px; height: 180px; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge__track { fill: none; stroke: var(--bg-light); stroke-width: 10; }
.gauge__fill { fill: none; stroke: url(#gaugeGrad); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1.4s cubic-bezier(.2,.8,.2,1); }
.gauge__value { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-content: center; text-align: center; }
.gauge__value strong { font-family: var(--font-head); font-size: 3rem; font-weight: 800; line-height: 1; color: var(--navy-900); }
.gauge__value small { font-size: 1.1rem; font-weight: 600; color: var(--muted); margin-left: 2px; }

.result__score { display: grid; justify-items: center; gap: 10px; }
.result__index { margin: 0 !important; max-width: 180px; text-align: center; font-size: .78rem !important; line-height: 1.4; color: var(--muted); }
.result__head h2 { margin-bottom: 10px; }

.status {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px;
  padding: 6px 14px; border-radius: 999px;
  font-family: var(--font-head); font-weight: 600; font-size: .88rem;
  color: var(--c); background: var(--bg); border: 1px solid var(--c);
}
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.status--critico { --c: #b8321f; --bg: rgba(184,50,31,.08); }
.status--atencao { --c: #b5651a; --bg: rgba(233,162,59,.14); }
.status--bom { --c: var(--teal-600); --bg: rgba(14,90,122,.08); }
.status--otimo { --c: #1f7a4d; --bg: rgba(31,122,77,.1); }

.result__block { padding: 34px 0; border-bottom: 1px solid var(--line); }
.result__block > h3 { font-size: 1.2rem; margin-bottom: 20px; }

.bars { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 40px; }
.bar__top { display: flex; justify-content: space-between; font-size: .95rem; margin-bottom: 8px; }
.bar__top strong { font-family: var(--font-head); }
.bar__track { height: 10px; border-radius: 99px; background: var(--bg-light); overflow: hidden; }
.bar__track span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--c); transition: width 1.2s cubic-bezier(.2,.8,.2,1) .3s; }
.bar__track span.is-on { width: var(--w); }

.recs { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.rec { display: flex; gap: 18px; align-items: flex-start; padding: 20px; border-radius: 14px; background: var(--bg-light); border: 1px solid var(--line); }
.rec__num {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--navy-900); color: var(--gold-light);
  font-family: var(--font-head); font-weight: 700;
}
.rec h4 { font-size: 1.02rem; margin: 4px 0 4px; }
.rec p { margin: 0; color: var(--muted); font-size: .94rem; }
.opps__intro { color: var(--muted); margin: -8px 0 20px; }
.opps__intro strong { color: var(--ink); }
.opps__more {
  margin: 16px 0 0; padding: 14px 18px; border-radius: 12px;
  border: 1.5px dashed rgba(233,162,59,.6); background: rgba(233,162,59,.08);
  font-weight: 500; color: var(--ink); text-align: center;
}
.rec__link { display: inline-block; margin-top: 8px; font-size: .88rem; font-weight: 600; color: var(--teal-600); }
.rec__link::after { content: " →"; }
.rec__link:hover { color: var(--orange); }
@media print { .rec__link { display: none; } }

.rec__parts { margin: 10px 0 4px; display: grid; gap: 8px; }
.rec__part { display: grid; grid-template-columns: 118px 1fr; gap: 12px; align-items: start; padding: 10px 14px; border-radius: 10px; background: var(--white); border-left: 3px solid var(--c); }
.rec__part dt { margin: 0; font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c); padding-top: 2px; }
.rec__part dd { margin: 0; font-size: .94rem; color: var(--ink); line-height: 1.55; }
.rec__part--problema { --c: #c4501a; }
.rec__part--consequencia { --c: #a4621a; }
.rec__part--caminho { --c: var(--teal-600); }
.rec__part--caminho dd { color: var(--muted); }

.step-panel__dim { display: inline-block; margin-bottom: 8px; font-size: .76rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--teal-600); }

.result__limit {
  margin-top: 12px !important; padding: 12px 14px; border-radius: 10px;
  background: rgba(212,106,28,.08); border-left: 3px solid var(--orange);
  color: var(--ink) !important; font-size: .93rem;
}

.perfil { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.dim { position: relative; padding: 18px 18px 16px; border-radius: 14px; background: var(--bg-light); border: 1px solid var(--line); }
.dim--fraca { border-color: rgba(184,50,31,.45); background: rgba(184,50,31,.04); }
.dim__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px 10px; }
.perfil > .dim, .intro__areas > .area-pill { min-width: 0; } 
.dim h4 { margin: 0 0 2px; font-size: 1.02rem; }
.dim__foco { display: block; font-size: .8rem; color: var(--muted); line-height: 1.35; }
.nivel { flex-shrink: 0; padding: 4px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; color: var(--c); background: var(--bg); border: 1px solid var(--c); white-space: nowrap; }
.nivel--critico { --c: #b8321f; --bg: rgba(184,50,31,.08); }
.nivel--atencao { --c: #b5651a; --bg: rgba(233,162,59,.14); }
.nivel--bom { --c: var(--teal-600); --bg: rgba(14,90,122,.08); }
.nivel--otimo { --c: #1f7a4d; --bg: rgba(31,122,77,.1); }
.dim__escala { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 12px 0 10px; }
.dim__escala span { height: 6px; border-radius: 4px; background: var(--line); }
.dim__escala span.on { background: var(--c); }
.dim__desc { margin: 0 0 6px; font-size: .9rem; color: var(--ink); line-height: 1.5; }
.dim__prox { margin: 0; font-size: .84rem; color: var(--muted); line-height: 1.5; }
.dim__prox strong { color: var(--teal-600); font-weight: 600; }
.dim__tag { position: absolute; top: -9px; right: 14px; padding: 2px 10px; border-radius: 999px; background: #b8321f; color: #fff; font-size: .75rem; font-weight: 700; letter-spacing: .04em; }

.metodo { margin: 26px 0 0; border: 1px solid var(--line); border-radius: 12px; background: var(--white); }
.metodo summary { cursor: pointer; padding: 14px 18px; font-family: var(--font-head); font-weight: 600; font-size: .95rem; color: var(--teal-600); }
.metodo__corpo { padding: 0 18px 8px; }
.metodo__corpo p { margin: 0 0 12px; font-size: .9rem; color: var(--muted); line-height: 1.6; }
.metodo__corpo strong { color: var(--ink); }

.solution__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.solution__list li {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px;
  background: rgba(14,90,122,.06); border: 1px solid rgba(14,90,122,.18);
  font-family: var(--font-head); font-weight: 600; font-size: .96rem;
}
.solution__list svg { width: 24px; height: 24px; padding: 4px; border-radius: 50%; background: var(--teal-600); color: var(--white); stroke-width: 3; }
.solution__note { margin: 16px 0 0; color: var(--muted); font-size: .93rem; }

.result__cta {
  margin: 34px 0 24px; padding: 32px;
  border-radius: 18px; color: var(--white);
  background: radial-gradient(500px 250px at 100% 0%, rgba(14,90,122,.6), transparent 70%), var(--navy-900);
}
.result__cta h3 { font-size: 1.3rem; }
.result__cta p { color: var(--muted-light); }
.result__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.result__status { margin: 14px 0 0; color: var(--gold-light); font-size: .92rem; }
.result__status:empty { display: none; }

.result__footer { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.result__disclaimer { margin: 18px 0 0; text-align: center; font-size: .82rem; color: var(--muted); }

.quiz-em-andamento .diag-hero { padding: calc(var(--header-h) + 28px) 0 120px; }
.quiz-em-andamento .diag-hero p { display: none; }
.quiz-em-andamento .diag-hero h1 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-bottom: 0; }
.quiz-em-andamento .diag-hero .eyebrow { margin-bottom: .6rem; }

.q { scroll-margin-top: calc(var(--header-h) + 24px); }

#stepName { font-family: var(--font-mono, monospace); font-weight: 500; font-size: .78rem; }

.btn.is-pronto { animation: pronto .9s ease-out; }
@keyframes pronto {
  0% { box-shadow: 0 0 0 0 rgba(233, 162, 59, .55); }
  100% { box-shadow: 0 0 0 14px rgba(233, 162, 59, 0); }
}

.retomar {
  margin: 0 0 24px; padding: 18px 20px; border-radius: 14px;
  background: rgba(233, 162, 59, .1); border: 1px solid rgba(233, 162, 59, .45);
}
.retomar p { margin: 0 0 14px; color: var(--ink); font-size: .95rem; }
.retomar__acoes { display: flex; flex-wrap: wrap; gap: 10px; }

.analise { text-align: center; padding: 56px 44px; }
.analise h2 { font-size: 1.4rem; margin: 18px 0 22px; }
.analise ul { list-style: none; margin: 0 auto; padding: 0; display: grid; gap: 12px; max-width: 380px; text-align: left; }
.analise li {
  position: relative; padding-left: 32px; color: var(--muted); font-size: .95rem;
  transition: color .3s;
}
.analise li::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 20px; height: 20px; margin-top: -10px;
  border-radius: 50%; border: 2px solid var(--line); box-sizing: border-box;
  transition: background .3s, border-color .3s;
}
.analise li.is-feito { color: var(--ink); }
.analise li.is-feito::before {
  border-color: #1f9d63; background: #1f9d63 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.analise__spinner {
  display: inline-block; width: 42px; height: 42px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--gold);
  animation: girar-spinner .8s linear infinite;
}
@keyframes girar-spinner { to { transform: rotate(360deg); } }

.result__acao {
  display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap;
  margin: 26px 0 0; padding: 16px 20px; border-radius: 14px;
  background: var(--bg-light); border: 1px solid var(--line);
}
.result__acao .result__status { margin: 0; flex: 1 1 280px; color: var(--muted); font-size: .92rem; display: flex; align-items: center; gap: 10px; }
.result__acao .result__status::before {
  content: ""; flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--teal-600); box-sizing: border-box;
  animation: girar-spinner .8s linear infinite;
}
.result__acao .result__status.is-ok { color: #1f7a4f; font-weight: 500; }
.result__acao .result__status.is-ok::before {
  animation: none; border-color: #1f9d63;
  background: #1f9d63 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 10px no-repeat;
}
.result__acao .result__status.is-erro { color: #b5541a; }
.result__acao .result__status.is-erro::before { animation: none; border-color: var(--orange); background: var(--orange); }

.footer--compact { padding: 0; }
.footer--compact .footer__bottom { align-items: center; border-top: 0; padding: 26px 0; }

@media (max-width: 760px) {
  .quiz-card { padding: 30px 22px; border-radius: 20px; }
  .quiz-card::before { left: 22px; right: 22px; }
  .intro { grid-template-columns: 1fr; }
  .opts:not(.opts--c1) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fields, .bars { grid-template-columns: 1fr; }
  .result__head { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 20px; }
  .gauge { width: 150px; height: 150px; }
  .result__cta { padding: 24px; }
  .result__acao .btn, .retomar__acoes .btn { width: 100%; }
  .analise { padding: 40px 22px; }
  .quiz-em-andamento .diag-hero { padding-bottom: 110px; }
  .result__actions .btn { width: 100%; }
  .solution__list, .perfil { grid-template-columns: 1fr; }
  .rec { padding: 16px 14px; gap: 10px; flex-direction: column; }
  .rec__num { width: 32px; height: 32px; font-size: .9rem; }
  .rec__part { grid-template-columns: 1fr; gap: 4px; padding: 10px 12px; }
}
@media (max-width: 420px) {
  .intro__areas { grid-template-columns: 1fr; }
  .opts:not(.opts--c1) { grid-template-columns: 1fr; }
  .opts--c4, .opts--c5 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } 
  .quiz-nav .btn { padding-inline: 1.1em; }
}

@media print {
  .header, .diag-hero, .footer, .whats-float, .result__cta, .result__acao, .result__footer { display: none !important; }
  .page-diag { background: #fff; }
  .diag-wrap { margin: 0; padding: 0; }
  .quiz-card { box-shadow: none; border: 0; padding: 0; }
  .quiz-card::before { display: none; }
  .result::before {
    content: "4TAL TECH Soluções — Diagnóstico de maturidade digital";
    display: block; margin-bottom: 20px; font-family: var(--font-head); font-weight: 700; color: var(--navy-900);
  }
  .bar__track span { width: var(--w) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rec, .rec__num, .rec__part, .solution__list li, .solution__list svg, .status { -webkit-print-color-adjust: exact; print-color-adjust: exact; break-inside: avoid; }
}
