/* Avaliação do aluno — estrutura de app: barra no topo, conteúdo que rola por dentro e botão fixo embaixo.
   No celular ocupa a tela toda; no computador vira uma janela de app centralizada. Depende de base.css. */
html, body.aluno { height: 100%; }
body.aluno { background: var(--surface); overflow: hidden; overscroll-behavior: none; }

/* top/right/bottom/left em vez de inset: iPhones com iOS 14 ou anterior não entendem inset e a tela inteira encolheria. */
.shell { position: fixed; top: 0; right: 0; bottom: 0; left: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--surface); }

/* ---------- Barra do topo ---------- */
.appbar { position: relative; z-index: 3; background: var(--surface); padding-top: env(safe-area-inset-top); transition: box-shadow var(--t-2) linear; }
.appbar.scrolled { box-shadow: 0 1px 0 var(--line); }
.ab-row { height: 56px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 0 20px; padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); }
.ab-left { display: flex; align-items: center; min-width: 0; }
.ab-logo { height: 24px; width: auto; }
.ab-back { flex: none; display: inline-flex; align-items: center; gap: 0; min-width: 44px; min-height: 44px; margin-left: -14px; padding: 0 10px 0 4px; border: 0; border-radius: 12px; background: none; color: var(--ink); font-weight: 600; font-size: 16px; }
.ab-back:focus-visible { outline-offset: -3px; } /* o anel não sai da tela em celular estreito */
.ab-back .ico { width: 24px; height: 24px; transition: transform var(--t-2) var(--e-out); }
.ab-back:active { background: rgba(20, 20, 23, .06); }
.ab-title { pointer-events: none; font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: min(52vw, 320px); opacity: 0; transform: translateY(4px); transition: opacity var(--t-2) linear, transform var(--t-2) var(--e-out); }
.appbar.compact .ab-title { opacity: 1; transform: none; }
.ab-right { justify-self: stretch; display: flex; justify-content: flex-end; align-items: center; min-width: 0; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; }
/* "n de 6" só aparece junto com o título pequeno (no topo da etapa já existe "Etapa n de 6"). */
.ab-right .count { opacity: 0; transition: opacity var(--t-2) linear; }
.appbar.compact .ab-right .count { opacity: 1; }
.ab-right .unit { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; transition: opacity var(--t-2) linear; }
.appbar.compact .ab-right .unit { opacity: 0; } /* com o título pequeno à vista, a unidade sai para não apertar a barra */
.ab-right .unit .ico { width: 16px; height: 16px; color: var(--ev-cta); }
.ab-right .unit span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ab-progress { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 0 20px 10px; padding: 0 max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left)); }
.ab-progress span { position: relative; display: block; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.ab-progress span::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: inherit; background: var(--ev); transform-origin: left center; transform: scaleX(0); transition: transform var(--t-4) var(--e-out); }
.ab-progress span.on::after { transform: scaleX(1); }
.ab-progress span.cur::after { transform: scaleX(max(.06, var(--p, 0))); }

/* ---------- Área que rola ---------- */
.screen { position: relative; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scroll-padding: 8px 0 40px; } /* o Tab não deixa o campo atrás do degradê do rodapé */
.wrap { max-width: 600px; margin: 0 auto; padding: 4px 20px 40px; padding: 4px max(20px, env(safe-area-inset-right)) 40px max(20px, env(safe-area-inset-left)); }
/* Abertura do app: a marca no centro da tela e uma barrinha que corre (como a tela de abertura de um app). */
.splash { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-content: center; justify-items: center; gap: 22px; padding: 0 20px 64px; animation: ev-fade-in var(--t-2) linear both; }
.splash img { width: 172px; height: auto; }
.splash-bar { position: relative; display: block; width: 112px; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.splash-bar::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 40%; border-radius: inherit; background: var(--ev); animation: ev-splash 1.1s var(--e-move) infinite; }
@keyframes ev-splash { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) { .splash-bar::after { animation-duration: 2.4s !important; animation-iteration-count: infinite !important; } }
/* Botão "Instalar app" na barra do topo (só aparece quando o Android oferece a instalação). */
.ab-install { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px 0 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14px; }
.ab-install .ico { width: 16px; height: 16px; }
/* "Carregando…" só aparece se demorar (em rede boa não pisca). */
.loading { display: flex; align-items: center; gap: 10px; max-width: 600px; margin: 48px auto; padding: 0 20px; color: var(--muted); animation: ev-fade-in var(--t-2) linear 400ms both; }
.loading .spin { width: 16px; height: 16px; border-width: 2px; }
.demo-banner { background: var(--warn-soft); color: var(--warn); font-size: 14px; font-weight: 600; text-align: center; padding: 8px 16px; }

/* ---------- Títulos ---------- */
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.t { font-family: var(--display); font-weight: 800; text-transform: uppercase; font-size: 36px; line-height: 1.04; letter-spacing: .005em; margin: 6px 0 12px; text-wrap: balance; }
.t:focus { outline: none; }
.home .t { font-size: 48px; margin-top: 10px; }
.lead { font-size: 17px; color: var(--ink-2); line-height: 1.5; }
.wrap { text-wrap: pretty; }
.meta-line, .eyebrow, .err-sum h2, .termo-card h2, .steps-list li, .tk-dl dd { text-wrap: balance; }
.stepk { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ev-text); }

/* ---------- Perguntas ---------- */
.qs { display: grid; gap: 32px; margin-top: 28px; }
.q { min-width: 0; margin: 0; padding: 0; border: 0; }
.q legend, .q .lbl { display: block; padding: 0; font-weight: 600; font-size: 17px; line-height: 1.4; color: var(--ink); }
.q .hint { margin-top: 4px; color: var(--muted); font-size: 15px; line-height: 1.45; }
/* Pergunta extra: uma linha-guia a liga à resposta que a abriu (laranja ao nascer, depois assenta no cinza). */
.q.sub { position: relative; margin-top: -12px; padding-left: 18px; }
.q.sub::before { content: ''; position: absolute; left: 0; top: 2px; bottom: 2px; width: 2px; border-radius: 2px; background: var(--line); transform-origin: top; }
.q.sub.ev-reveal::before { animation: ev-grow-y 460ms var(--e-out) both, ev-settle 700ms ease both; animation-delay: calc(var(--i, 0) * 50ms), calc(900ms + var(--i, 0) * 50ms); }
@keyframes ev-settle { from { background-color: var(--ev); } }
.q.has-error { padding-left: 15px; border-left: 3px solid var(--err); }
.q.sub.has-error { padding-left: 18px; border-left: 0; }
.q.sub.has-error::before { width: 3px; background: var(--err); }
/* Destino de um link de erro: acende uma vez. */
.q.flash { animation: ev-q-flash 1200ms ease-out; } /* sem border-radius: curvaria a barra de erro e o cartão da autorização */
@keyframes ev-q-flash { 0%, 25% { background-color: var(--err-soft); box-shadow: 0 0 0 10px var(--err-soft); } 100% { background-color: transparent; box-shadow: 0 0 0 10px transparent; } }
.err { display: flex; align-items: flex-start; gap: 6px; margin-top: 8px; color: var(--err); font-weight: 600; font-size: 15px; line-height: 1.4; }
.err .ico { width: 18px; height: 18px; margin-top: 1px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
/* Peso e Altura: rótulo, dica, erro e campo nas mesmas linhas, mesmo quando a dica de um lado quebra. */
.pair > .q { display: grid; grid-row: span 4; grid-template-rows: subgrid; }
.pair .lbl { grid-row: 1; } .pair .hint { grid-row: 2; } .pair .err { grid-row: 3; } .pair .inp-wrap { grid-row: 4; }
/* Título de grupo dentro da etapa (ex.: "Seus dados de contato" depois das medidas). */
.q-group { margin-bottom: -16px; padding-top: 24px; border-top: 1px solid var(--line); font: 700 20px/1.1 var(--display); text-transform: uppercase; letter-spacing: .03em; }

.opts { display: grid; gap: 8px; margin-top: 12px; }
.opt { position: relative; display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 12px 16px; border: 1px solid #d0d0d8; border-radius: 14px; background: var(--surface); cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: border-color var(--t-1) linear, background-color var(--t-1) linear, box-shadow var(--t-1) linear, transform var(--t-1) var(--e-out); }
.opt:active { transform: scale(.985); }
.opt input { appearance: none; -webkit-appearance: none; flex: none; width: 22px; height: 22px; margin: 0; border: 1.5px solid var(--line-strong); border-radius: 50%; background: var(--surface); display: grid; place-content: center; cursor: pointer;
  transition: background-color var(--t-1) linear, border-color var(--t-1) linear; }
.opt input[type="checkbox"] { border-radius: 7px; }
.opt input::after { content: ''; width: 10px; height: 5px; border: solid #fff; border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg) scale(0); transition: transform var(--t-2) var(--e-spring); }
.opt input:checked { background: var(--ink); border-color: var(--ink); }
.opt input:checked::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
.opt input:focus-visible { outline: none; }
.opt:has(input:focus-visible) { outline: 3px solid var(--ev-cta); outline-offset: 2px; }
@supports not selector(:has(*)) { .opt input:focus-visible { outline: 3px solid var(--ev-cta); outline-offset: 2px; } }
/* .on vem do JS (em vez de :has), para funcionar também em celulares com navegador antigo. */
.opt.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: #fafafb; }
.opt-t { display: grid; gap: 2px; font-size: 16px; font-weight: 500; line-height: 1.35; }
.opt-t small { color: var(--muted); font-size: 14px; font-weight: 400; }
@media (hover: hover) and (pointer: fine) { .opt:hover { border-color: var(--line-strong); } }
/* Listas longas viram duas colunas quando há espaço; "ou" e a opção "nenhuma" ocupam a linha toda. */
@media (min-width: 520px) {
  .opts.cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opts.cols .or, .opts.cols .opt.none { grid-column: 1 / -1; }
}

/* Segmentado: trilho cinza com uma pílula escura que desliza até a opção escolhida. */
.opts.seg { position: relative; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 16px; background: #efeff3; box-shadow: inset 0 0 0 1px rgba(20, 20, 23, .07); transition: background-color var(--t-2) linear, box-shadow var(--t-2) linear; }
.seg-pill { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px - (var(--n, 2) - 1) * 4px) / var(--n, 2)); border-radius: 12px; background: var(--ink); box-shadow: 0 1px 2px rgba(20, 20, 23, .2), 0 6px 14px -6px rgba(20, 20, 23, .45);
  opacity: 0; transform: translateX(calc(var(--sel, 0) * (100% + 4px))); transition: transform var(--t-3) var(--e-out), opacity var(--t-2) linear; pointer-events: none; }
.opts.seg[data-sel] .seg-pill { opacity: 1; }
.seg .opt { padding: 0; min-height: 48px; border: 0; border-radius: 12px; background: none; box-shadow: none !important; }
.seg .opt input { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; border-radius: 12px; background: none; opacity: 0; }
.seg .opt-t { position: relative; width: 100%; height: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; text-align: center; text-wrap: balance; padding: 6px; border-radius: 12px; font-weight: 600; font-size: 15px; line-height: 1.2; color: var(--ink);
  transition: color var(--t-2) linear, background-color var(--t-1) linear; }
.seg .opt:active { transform: scale(.96); }
.seg .opt:active input:not(:checked) + .opt-t { background: rgba(20, 20, 23, .06); }
.seg input:checked + .opt-t { color: #fff; }
/* Foco dentro do trilho. Com :focus + :not(:focus-visible), navegador antigo (sem :focus-visible) também mostra. */
.seg input:focus + .opt-t { outline: 3px solid var(--ev-cta); outline-offset: -3px; }
.seg input:focus:not(:focus-visible) + .opt-t { outline: none; }
.seg .opt:has(input:focus-visible) { outline: none; } /* um anel só (o de dentro do trilho) */
.q.has-error .opts.seg { background: var(--err-soft); box-shadow: inset 0 0 0 1.5px var(--err); }
@media (hover: hover) and (pointer: fine) { .seg .opt:hover .opt-t { color: var(--ink); } .seg .opt:hover input:checked + .opt-t { color: #fff; } }
@media (forced-colors: active) { .seg-pill { display: none; } .seg input:checked + .opt-t { outline: 2px solid CanvasText; outline-offset: -2px; } }

.or { display: flex; align-items: center; gap: 12px; margin: 4px 0; color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.inp { width: 100%; min-height: 54px; margin-top: 10px; padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); font-size: 17px; line-height: 1.3; text-overflow: ellipsis; transition: border-color var(--t-1) linear, box-shadow var(--t-2) linear; }
/* Foco do campo: anel suave na cor da marca (no toque também aparece, e um contorno afastado pesaria). */
.inp:focus { outline: 2px solid var(--ev-cta); outline-offset: 0; border-color: var(--ev-cta); box-shadow: 0 0 0 5px rgba(255, 77, 0, .14); } /* campo de texto sempre mostra o foco */
.q.has-error .inp { border: 2px solid var(--err); }
.q.has-error .inp:focus { outline-color: var(--err); box-shadow: 0 0 0 5px rgba(179, 38, 30, .12); }
select.inp { -webkit-appearance: none; appearance: none; padding-right: 44px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23141417' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-position: right 14px center; background-size: 20px 20px; background-repeat: no-repeat; }
select.inp:invalid { color: #74747e; }
select.inp option { color: var(--ink); }
.date { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr); gap: 10px; margin-top: 10px; }
@media (min-width: 560px) { .date { max-width: 320px; } }
.date label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); font-weight: 500; }
.date .inp { margin-top: 0; width: 100%; min-width: 0; padding-left: 6px; padding-right: 6px; text-align: center; color: var(--ink); font-weight: 400; }
.ok-line { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 15px; color: var(--ink-2); }
.ok-line .ico { width: 18px; height: 18px; color: var(--ok); }
.inp::placeholder { color: #74747e; opacity: 1; } /* 4,6:1 no branco: o exemplo de formato precisa ser legível */
/* Campo com unidade (kg, m) ou com o selo de CPF válido do lado direito. */
.inp-wrap { position: relative; margin-top: 10px; }
.inp-wrap .inp { display: block; margin-top: 0; padding-right: 52px; }
.suffix { position: absolute; top: 0; bottom: 0; right: 16px; display: flex; align-items: center; color: var(--muted); font-weight: 600; font-size: 16px; pointer-events: none; }
.valid { position: absolute; top: 0; bottom: 0; right: 12px; width: 28px; height: 28px; margin: auto 0; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; pointer-events: none; }
.valid .ico { width: 16px; height: 16px; stroke-width: 2.6; }
.qnum { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ev-text); }

/* ---------- Início ---------- */
.unit-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; margin-top: 12px; padding: 6px 14px 6px 10px; border-radius: 999px; background: var(--bg); font-size: 14px; font-weight: 600; color: var(--ink); }
.unit-chip .ico { flex: none; width: 16px; height: 16px; color: var(--ev-cta); }
.unit-chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unit-chip .link { position: relative; flex: none; margin-left: 4px; padding: 0 0 0 10px; border-left: 1px solid var(--line-strong); font-size: 14px; line-height: 1.2; text-decoration: none; }
.unit-chip .link::after { content: ''; position: absolute; top: -12px; right: -10px; bottom: -12px; left: 0; } /* área de toque maior que o texto */
.accent-line { display: block; width: 44px; height: 4px; margin-top: 28px; border-radius: 2px; background: var(--ev); transform-origin: left center; }
.home .accent-line + .t { margin-top: 14px; }
.meta-line { margin-top: 10px; font-size: 14px; font-weight: 500; color: var(--muted); }
/* Sem QR code: desenho de um QR com uma linha de leitura passando. */
.scan { position: relative; width: 136px; height: 136px; margin: 28px 0 20px; color: var(--ink); }
.scan svg { position: absolute; top: 24px; left: 24px; width: 88px; height: 88px; fill: currentColor; }
.scan .c { position: absolute; width: 30px; height: 30px; border: 3px solid var(--ev); }
.scan .c1 { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.scan .c2 { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; }
.scan .c3 { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; }
.scan .c4 { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
.scan .beam { position: absolute; left: 12px; right: 12px; top: 16px; height: 2px; border-radius: 1px; background: var(--ev); box-shadow: 0 0 10px 1px rgba(255, 77, 0, .5); animation: ev-scan 2.2s var(--e-move) infinite alternate; }
@keyframes ev-scan { to { transform: translateY(102px); } }
@media (prefers-reduced-motion: reduce) { .scan .beam { animation: none; top: 50%; } }

/* ---------- IMC calculado na hora ---------- */
.imc { padding: 18px 20px 16px; border-radius: 20px; background: var(--ink); color: #fff; display: grid; gap: 12px; }
.imc-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.imc-k { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .72); }
.imc-chip { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: rgba(255, 255, 255, .12); color: #fff; transition: background-color var(--t-2) linear; }
.imc-chip.t-ok { background: #12b76a; color: #04130b; }
.imc-chip.t-warn { background: #f79009; color: #1f1100; }
.imc-chip.t-alert { background: #d92d20; color: #fff; } /* 4,8:1 com o texto branco */
.imc-v { font-family: var(--display); font-weight: 800; font-size: 56px; line-height: .9; font-variant-numeric: tabular-nums; }
/* A régua recorta o marcador (que é uma faixa da largura da régua, deslocada) e sobra espaço para a bolinha nas pontas. */
.imc-bar { position: relative; margin: -3px -16px -7px; padding: 7px 16px; overflow: hidden; }
.imc-seg { display: flex; gap: 3px; height: 10px; }
.imc-seg span { display: block; height: 100%; border-radius: 3px; opacity: .9; }
.imc-seg span.t-ok { background: #12b76a; }
.imc-seg span.t-warn { background: #f79009; }
.imc-seg span.t-alert { background: #f04438; }
.imc-mk { position: absolute; top: 2px; left: 16px; right: 16px; height: 20px; transform: translateX(calc(var(--pos, .5) * 100%)); transition: transform var(--t-4) var(--e-out); pointer-events: none; }
.imc-mk::before { content: ''; position: absolute; left: -10px; top: 0; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px var(--ink), 0 2px 6px rgba(0, 0, 0, .4); }
.imc-ticks { position: relative; height: 16px; font-size: 12px; color: rgba(255, 255, 255, .6); font-variant-numeric: tabular-nums; }
.imc-ticks span { position: absolute; top: 0; transform: translateX(-50%); }
.imc-d { font-size: 14px; line-height: 1.45; color: rgba(255, 255, 255, .82); }

/* ---------- Consentimento e Termo ---------- */
.consent { border: 1px solid var(--line); background: #fafafb; border-radius: 20px; padding: 20px; display: grid; gap: 14px; }
.consent .opt, .termo-q .opt { align-items: flex-start; }
.consent .opt input, .termo-q .opt input { margin-top: 1px; }
.fine { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; color: var(--muted); line-height: 1.45; }
.consent .link { justify-self: start; text-align: left; font-size: 15px; padding: 10px 0; margin: -6px 0; }
.nw { white-space: nowrap; }
.termo-card { border-radius: 20px; border: 1px solid var(--line); background: #fafafb; padding: 20px; display: grid; gap: 12px; }
.termo-card h2 { font-size: 18px; line-height: 1.3; }
.termo-card .termo-intro { font-size: 15px; color: var(--ink-2); line-height: 1.5; }
.termo-txt { margin: 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--ink); font-size: 15px; line-height: 1.55; display: grid; gap: 8px; }

/* ---------- Resumo de erros e avisos ---------- */
.err-sum { margin-top: 24px; padding: 16px 18px; border-radius: 4px 14px 14px 4px; background: var(--err-soft); border-left: 4px solid var(--err); }
.err-sum li::marker { color: var(--err); }
.err-sum:focus { outline: 3px solid var(--ev-cta); outline-offset: 2px; }
.err-sum h2 { font-size: 16px; color: var(--err); }
.err-sum ul { margin: 4px 0 0; padding-left: 20px; display: grid; gap: 0; }
.err-sum a { display: block; padding: 7px 0; color: var(--err); font-weight: 600; }
.err-sum a b { font-weight: 700; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: #f6f6f8; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.note .ico { margin-top: 1px; color: var(--muted); }
.note.alert { background: var(--err-soft); color: #7a1a14; }
.note.alert .ico { color: var(--err); }
.note.warn { background: var(--warn-soft); color: #6b2a0a; }
.note.warn .ico { color: var(--warn-mark); }
.note strong { display: block; color: inherit; }
/* Aviso de privacidade logo abaixo da apresentação: a pessoa lê antes de digitar o CPF. */
.safe { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; font-size: 14px; color: var(--muted); line-height: 1.45; }
.safe .ico { width: 16px; height: 16px; margin-top: 2px; flex: none; }

/* ---------- Rodapé com a ação principal ---------- */
.dock { position: relative; z-index: 3; display: grid; gap: 8px; padding: 8px 20px 12px; padding: 8px max(20px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); background: var(--surface); }
/* O conteúdo some suavemente atrás do botão, em vez de ser cortado por uma linha. */
.dock::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 28px; background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--surface)); pointer-events: none; }
.dock:empty { display: none; }
.dock > * { max-width: 560px; width: 100%; margin: 0 auto; }
.go { position: relative; overflow: hidden; isolation: isolate; min-height: 56px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 999px; background: var(--ev-cta); color: #fff; font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: .04em; text-transform: uppercase;
  transition: background-color var(--t-1) linear, transform var(--t-1) var(--e-out); }
.go:active { transform: scale(.98); }
.go .ico { width: 20px; height: 20px; transition: transform var(--t-2) var(--e-out); }
.go[aria-busy="true"] { cursor: progress; }
/* Etapa completa: um brilho atravessa o botão uma vez (fica dentro dele). */
.go::after { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .24) 50%, transparent 65%); transform: translateX(-100%); pointer-events: none; }
.go.ready::after { animation: ev-sheen 900ms var(--e-move) 120ms both; }
@keyframes ev-sheen { to { transform: translateX(100%); } }
.go.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line-strong); font-family: var(--font); font-weight: 600; font-size: 16px; letter-spacing: 0; text-transform: none; min-height: 50px; }
.go.danger-confirm { border-color: var(--err); color: var(--err); }
/* Segundo botão do rodapé: discreto e mais baixo, para sobrar tela em celular pequeno. */
.dock > .go + .go.ghost { min-height: 44px; border-color: transparent; text-decoration: underline; text-underline-offset: 3px; }
.dock > .go + .go.ghost.danger-confirm { border-color: var(--err); text-decoration: none; }
/* Aviso "Mais perguntas abaixo": flutua acima do botão, some na primeira rolagem. */
.more { position: absolute; left: 50%; z-index: 4; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px 0 12px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; white-space: nowrap; box-shadow: 0 8px 24px rgba(20, 20, 23, .22);
  opacity: 0; transform: translate(-50%, 8px); pointer-events: none; transition: opacity var(--t-2) linear, transform var(--t-3) var(--e-out); }
.more .ico { width: 18px; height: 18px; }
.more.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
@media (hover: hover) and (pointer: fine) {
  .go:hover { background: var(--ev-cta-hover); }
  .go.ghost:hover { background: rgba(20, 20, 23, .04); border-color: var(--ink); }
  .go:hover .ico { transform: translateX(3px); }
  .ab-back:hover .ico { transform: translateX(-2px); }
}

/* ---------- Revisão ---------- */
.rv { position: relative; isolation: isolate; margin-top: 36px; }
.rv-head { display: flex; align-items: center; gap: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--ink); }
.rv-head h2 { flex: 1; min-width: 0; font: 700 20px/1.1 var(--display); text-transform: uppercase; letter-spacing: .03em; }
.rv-head h2:focus { outline: none; }
.rv-head .n { margin-right: 4px; color: var(--ev-text); font-variant-numeric: tabular-nums; }
.rv-head .link { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; margin: -8px -12px -8px 0; border-radius: 999px; font: 600 15px/1 var(--font); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .rv-head .link:hover { background: var(--ev-tint); } }
.rv-head .link:focus-visible { outline-offset: -3px; } /* o anel não sai da tela em celular estreito */
.rv dl { margin: 0; }
.rv dl div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rv dt { color: var(--muted); font-size: 15px; }
.rv dd { margin: 0; font-weight: 600; font-size: 15px; overflow-wrap: break-word; overflow-wrap: anywhere; }
/* Celular: pergunta em cima e resposta embaixo (em duas colunas a pergunta quebrava em 4 ou 5 linhas). */
@media (max-width: 479px) {
  .rv dl div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .rv dt { font-size: 14px; }
  .rv dd { font-size: 16px; }
}
/* Volta da edição: a seção alterada acende e apaga devagar. */
.rv.ev-back::before { content: ''; position: absolute; top: -8px; right: -12px; bottom: -8px; left: -12px; z-index: -1; border-radius: 14px; background: var(--ev-tint); animation: ev-fade-out 1400ms var(--e-out) 250ms both; }
.send-err { margin-top: 16px; }

/* ---------- Final ---------- */
.done-ico { position: relative; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--ev); color: #fff; margin: 16px 0 22px; }
.done-check { width: 34px; height: 34px; stroke-width: 2.8; }
.done-check path { stroke-dasharray: 1; stroke-dashoffset: 0; }
.steps-list { margin: 24px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; counter-reset: s; }
.steps-list li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; font-size: 16px; line-height: 1.5; counter-increment: s; }
.steps-list li::before { content: counter(s); width: 32px; height: 32px; margin-top: -4px; border-radius: 50%; border: 1.5px solid var(--ink); display: grid; place-items: center; font-weight: 700; font-size: 14px; line-height: 1; }
.findings { display: grid; gap: 8px; margin-top: 20px; }
/* Cuidados que o professor vai ter: lista calma, sem caixa de alerta. */
.done-care { margin-top: 28px; }
.done-care h2 { margin-bottom: 10px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.done-care ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.done-care li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; font-size: 16px; line-height: 1.45; color: var(--ink-2); }
.done-care li::before { content: ''; width: 8px; height: 8px; margin: 8px 0 0 12px; border-radius: 50%; background: var(--ev); }
/* Comprovante em forma de ticket, com os recortes na linha pontilhada. */
.ticket { margin-top: 24px; padding: 16px 20px 18px; border-radius: 20px; background: var(--bg); }
.tk-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1.5px dashed #c9c9d1; }
.tk-top::before, .tk-top::after { content: ''; position: absolute; bottom: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); }
.tk-top::before { left: -30px; }
.tk-top::after { right: -30px; }
.tk-k { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ticket .chip .ico { width: 14px; height: 14px; stroke-width: 2.6; }
.tk-dl { margin: 14px 0 0; display: grid; gap: 10px; }
.tk-dl div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.tk-dl dt { flex: none; color: var(--muted); font-size: 14px; }
.tk-dl dd { margin: 0; min-width: 0; font-weight: 600; font-size: 15px; text-align: right; overflow-wrap: break-word; overflow-wrap: anywhere; }
.tk-ref { font-variant-numeric: tabular-nums; letter-spacing: .06em; }

/* ---------- Movimento (só nasce de uma ação; nunca de um redesenho) ---------- */
#app { overflow-x: clip; }
.ev-enter { animation: ev-in-x var(--t-3) var(--e-out) both; animation-delay: calc(var(--base, 0ms) + var(--i, 0) * var(--stagger)); }
[data-enter="back"] .ev-enter { --dir: -1; }
[data-enter="up"] .ev-enter { animation-name: ev-in-up; }
/* O traço da marca se desenha da esquerda para a direita em vez de deslizar como bloco. */
.accent-line.ev-enter { animation: ev-grow-x 640ms var(--e-out) both; animation-delay: calc(var(--base, 0ms) + var(--i, 0) * var(--stagger)); }
.ev-reveal { --rise: 8px; animation: ev-in-up var(--t-3) var(--e-out) both; animation-delay: calc(var(--i, 0) * 50ms); }
.ev-celebrate .done-ico { animation: ev-pop var(--t-4) var(--e-spring) both; }
.ev-celebrate .done-ico::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--ev); opacity: 0; animation: ev-ring 800ms var(--e-out) 180ms both; }
.ev-celebrate .done-check path { animation: ev-draw 420ms var(--e-out) 220ms both; }
@keyframes ev-ring { from { opacity: .45; transform: scale(1); } to { opacity: 0; transform: scale(1.4); } }

/* ---------- Computador e tablet: janela de app centralizada ----------
   Só com altura de sobra: celular deitado continua em tela cheia. */
@media (min-width: 760px) and (min-height: 600px) {
  /* Centraliza com grid no body (margem no .shell vazava para fora e deixava a página rolar 24 px). */
  body.aluno { display: grid; place-items: center; background: var(--bg); }
  .shell { position: relative; width: min(600px, calc(100vw - 48px)); height: min(920px, calc(100vh - 48px)); height: min(920px, calc(100dvh - 48px)); margin: 0; border-radius: 28px; overflow: hidden; overflow: clip; border: 1px solid var(--line); box-shadow: 0 24px 64px rgba(20, 20, 23, .12), 0 2px 8px rgba(20, 20, 23, .06); }
  .ab-row { height: 64px; padding: 0 32px; }
  .ab-logo { height: 26px; }
  .ab-progress { padding: 0 32px 12px; }
  .wrap { padding: 8px 32px 48px; }
  .loading { padding: 0 32px; }
  .dock { padding: 16px 32px 20px; }
  .t { font-size: 40px; }
  .home .t { font-size: 56px; }
}
/* Telas baixas: celular deitado ou com o teclado aberto (no Android a tela encolhe junto com o teclado). */
@media (max-height: 540px) {
  .ab-row { height: 48px; }
  .ab-progress { padding-bottom: 8px; }
  .dock { gap: 6px; padding-top: 6px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .dock::before { height: 20px; }
  .go { min-height: 48px; font-size: 18px; }
  .go.ghost { min-height: 44px; font-size: 15px; }
  .t { font-size: 30px; }
  .home .t { font-size: 38px; }
  .accent-line { margin-top: 16px; }
  .scan { width: 104px; height: 104px; margin: 16px 0 12px; }
  .scan svg { top: 18px; left: 18px; width: 68px; height: 68px; }
  .scan .c { width: 24px; height: 24px; }
  @keyframes ev-scan { to { transform: translateY(72px); } }
}
@media (max-height: 540px) and (min-width: 560px) {
  .dock { display: flex; justify-content: center; gap: 12px; }
  .dock > * { flex: 1 1 0; max-width: 274px; margin: 0; }
  .dock > .go + .go.ghost { border-color: var(--line-strong); text-decoration: none; }
}
@media (max-height: 600px) {
  .scan { width: 104px; height: 104px; margin: 16px 0 12px; }
  .scan svg { top: 18px; left: 18px; width: 68px; height: 68px; }
  .scan .c { width: 24px; height: 24px; }
  @keyframes ev-scan { to { transform: translateY(72px); } }
}
@media (max-width: 380px) {
  .seg .opt-t { font-size: 14px; }
  .imc-v { font-size: 48px; }
}
/* Só em tela alta: com o teclado aberto vale o título menor das telas baixas. */
@media (max-width: 380px) and (min-height: 541px) {
  .t { font-size: 32px; }
  .home .t { font-size: 42px; }
}
/* Deitado com o teclado aberto (no Android sobram uns 80 a 150 px): enquanto digita, saem a barra de progresso e o rodapé. */
@media (max-height: 200px) {
  .shell.typing .ab-progress, .shell.typing .dock { display: none; }
  .shell.typing .ab-row { height: 40px; }
}
/* Abaixo de 360 px o título pequeno da barra encostaria no "Voltar": fica só a seta. */
@media (max-width: 359px) {
  .appbar.compact .ab-back span { display: none; }
}
/* Celulares estreitos (SE de 1ª geração, Androids pequenos, letra grande ligada no aparelho). */
@media (max-width: 340px) {
  .ab-row { padding: 0 16px; }
  .ab-progress { padding: 0 16px 8px; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .dock { padding-left: 16px; padding-right: 16px; }
  .t { font-size: 30px; }
  .home .t { font-size: 38px; }
  .lead { font-size: 16px; }
  .go { font-size: 18px; letter-spacing: .02em; }
  .opt { gap: 12px; padding: 12px 14px; }
  .seg .opt-t { font-size: 13px; padding: 4px; }
  .imc { padding: 16px; }
  .imc-v { font-size: 44px; }
  .date { gap: 8px; }
  .consent, .termo-card { padding: 14px 12px; }
  .consent .opt, .termo-q .opt { padding: 12px; gap: 10px; }
  .tk-dl div { display: grid; gap: 0; }
  .tk-dl dd { text-align: left; }
  .tk-top::before { left: -26px; }
  .tk-top::after { right: -26px; }
  .ticket { padding-left: 16px; padding-right: 16px; }
}
/* Tela de capa dos dobráveis (280 px). */
@media (max-width: 300px) {
  .ab-row { padding: 0 14px; }
  .ab-progress { padding: 0 14px 8px; }
  .ab-title { font-size: 15px; }
  .wrap { padding-left: 14px; padding-right: 14px; }
  .dock { padding-left: 14px; padding-right: 14px; }
  .t { font-size: 28px; }
  .home .t { font-size: 34px; }
  .pair { grid-template-columns: minmax(0, 1fr); row-gap: 32px; }
  .pair > .q { display: block; grid-row: auto; }
  .rv-head h2 { font-size: 18px; }
  .ab-right { font-size: 13px; }
  .go { font-size: 17px; }
}

/* iOS 12 a 14.4 e Chrome abaixo do 84 não têm gap em flex (ele chegou junto com inset): margens fazem o mesmo papel. */
@supports not (inset: 0) {
  .opt > input { margin-right: 14px; }
  .err > .ico, .ok-line > .ico, .unit-chip > .ico, .more > .ico, .ab-right .unit > .ico { margin-right: 6px; }
  .note > .ico { margin-right: 10px; }
  .safe > .ico { margin-right: 8px; }
  .chip > .ico { margin-right: 5px; }
  .go:not([data-act=pdf]) > .ico { margin-left: 10px; }
  .go[data-act=pdf] > .ico, .go > .spin, .loading > .spin { margin-right: 10px; }
  .or::before { margin-right: 12px; }
  .or::after { margin-left: 12px; }
  .rv-head h2, .imc-k, .tk-dl dt { margin-right: 12px; }
  .tk-top > .chip { margin-left: 12px; }
  .unit-chip .link { margin-left: 10px; }
  @media (max-width: 340px) { .opt > input { margin-right: 12px; } }
  @media (max-height: 540px) and (min-width: 560px) { .dock > * + * { margin-left: 12px; } }
}

/* ---------- Comprovante em PDF: na impressão só a ficha aparece ---------- */
#printArea { display: none; }
@media print {
  html, body.aluno { height: auto; overflow: visible; background: #fff; }
  body.aluno.printing > *:not(#printArea) { display: none !important; }
  body.aluno.printing #printArea { display: block; }
}
