/* Acessibilidade — carregado por último. WCAG 2.1 AA / eMAG. */

/* ---------- base: sempre ligado ---------- */
:focus-visible { outline: 3px solid #1a5fd0; outline-offset: 2px; border-radius: 4px; }
.pagina-aluno .topo :focus-visible, .abas-aluno :focus-visible, .ag-escuro :focus-visible { outline-color: #ffd23f; }
.a11y-pular { position: fixed; left: .5rem; top: -4rem; z-index: 10000; background: #fff; color: #0b3b70; border: 3px solid #0b3b70; border-radius: 10px;
  padding: .7rem 1rem; font-weight: 800; text-decoration: none; transition: top .15s; }
.a11y-pular:focus { top: .5rem; }
main:focus, #vista:focus { outline: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- contrastes corrigidos (auditoria axe) ---------- */
.bd-cat { color: #7a5520; }
.tag-feito, .tag.tag-feito { color: #1b5e20; }
.lp-bt { background-image: linear-gradient(rgba(0,0,0,.32), rgba(0,0,0,.32)); }
.cd-tabela tbody td.cd-total.atencao, .cd-tabela tbody td.nota-final.atencao, .cd-sit.atencao { color: #8f4500; }
.cd-num.laranja, .cd-num.laranja small { color: #8f4500; }

/* ---------- botão e painel ---------- */
.a11y-bt { position: fixed; left: .8rem; bottom: .8rem; z-index: 300; display: inline-flex; align-items: center; gap: .45rem; min-height: 48px; min-width: 48px;
  padding: .55rem .9rem; border-radius: 999px; border: 2px solid #fff; background: #0b3b70; color: #fff; font: 700 .9rem/1 "Inter", system-ui, sans-serif;
  box-shadow: 0 6px 20px rgba(8,20,40,.35); cursor: pointer; }
.a11y-ic { width: 22px; height: 22px; display: inline-block; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a2 2 0 110 4 2 2 0 010-4zm8 6.5v2l-5.5-.6V13l2.6 7-1.9.7-2.4-6.2h-1.6L8.9 20.7 7 20l2.6-7v-3.1L4 10.5v-2l8 1 8-1z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a2 2 0 110 4 2 2 0 010-4zm8 6.5v2l-5.5-.6V13l2.6 7-1.9.7-2.4-6.2h-1.6L8.9 20.7 7 20l2.6-7v-3.1L4 10.5v-2l8 1 8-1z'/%3E%3C/svg%3E") center/contain no-repeat; }
.a11y-painel { position: fixed; z-index: 10001; left: .8rem; bottom: 4.6rem; width: min(380px, calc(100vw - 1.6rem)); max-height: min(78dvh, 640px); overflow-y: auto;
  background: #fff; color: #111418; border: 2px solid #0b3b70; border-radius: 18px; box-shadow: 0 18px 60px rgba(8,20,40,.45); padding: 1rem; font-family: "Inter", system-ui, sans-serif; }
.a11y-painel[hidden] { display: none; }
.a11y-cab { display: flex; justify-content: space-between; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.a11y-cab h2 { margin: 0; font-size: 1.2rem; color: #0b3b70; }
.a11y-painel button { font: inherit; cursor: pointer; }
.a11y-fechar { min-width: 44px; min-height: 44px; border-radius: 10px; border: 1px solid #98a3b3; background: #fff; color: #111418; font-size: 1.1rem; }
.a11y-linha { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; padding: .5rem 0; border-bottom: 1px solid #d9e0ea; }
.a11y-rot { flex: 1 1 100%; font-weight: 700; }
.a11y-linha button, .a11y-ferr button { min-height: 44px; padding: .5rem .9rem; border-radius: 10px; border: 1.5px solid #0b3b70; background: #eef4fb; color: #0b3b70; font-weight: 700; }
.a11y-op { display: flex; gap: .7rem; align-items: flex-start; padding: .65rem 0; border-bottom: 1px solid #d9e0ea; cursor: pointer; min-height: 48px; }
.a11y-op input { width: 24px; height: 24px; margin-top: .1rem; flex: none; accent-color: #0b3b70; }
.a11y-op strong { display: block; font-size: .95rem; }
.a11y-op small { display: block; color: #3d4756; font-size: .82rem; line-height: 1.35; }
.a11y-ferr { display: flex; flex-direction: column; gap: .5rem; margin: .8rem 0 .4rem; }
.a11y-ferr button { text-align: left; }
.a11y-nota, .a11y-aviso { font-size: .8rem; color: #3d4756; margin: .3rem 0; }
.a11y-aviso { min-height: 1.2em; font-weight: 700; color: #0b3b70; }
.a11y-limpar { width: 100%; min-height: 46px; border-radius: 10px; border: 1.5px solid #8a1f1f; background: #fff; color: #8a1f1f; font-weight: 700; margin-top: .4rem; }
.a11y-decl { display: block; margin-top: .7rem; color: #0b3b70; font-weight: 700; min-height: 44px; display: flex; align-items: center; }

@media (max-width: 700px) {
  /* acima da barra de baixo (aluno e professor) e à esquerda do robô */
  .a11y-bt { bottom: calc(76px + env(safe-area-inset-bottom)); left: .6rem; padding: .55rem; }
  .a11y-bt-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .a11y-painel { left: .5rem; right: .5rem; width: auto; bottom: calc(132px + env(safe-area-inset-bottom)); max-height: 70dvh; }
}
@media print { .a11y-bt, .a11y-painel, .a11y-pular { display: none !important; } }

/* ---------- recursos ligados pelo painel ---------- */
html.a11y-fonte body, html.a11y-fonte button, html.a11y-fonte input, html.a11y-fonte select, html.a11y-fonte textarea,
html.a11y-fonte h1, html.a11y-fonte h2, html.a11y-fonte h3, html.a11y-fonte h4 { font-family: Verdana, "DejaVu Sans", Tahoma, "Trebuchet MS", sans-serif !important; }
html.a11y-espaco body * { letter-spacing: .06em !important; word-spacing: .16em !important; }
html.a11y-espaco p, html.a11y-espaco li, html.a11y-espaco td, html.a11y-espaco label, html.a11y-espaco small { line-height: 1.8 !important; }
html.a11y-espaco p { margin-bottom: 2em; }
html.a11y-links a { text-decoration: underline !important; text-underline-offset: .18em; text-decoration-thickness: 2px; }
html.a11y-links button, html.a11y-links .btn { outline: 2px solid currentColor; outline-offset: -2px; }
html.a11y-foco :focus, html.a11y-foco :focus-visible { outline: 5px solid #ff8a00 !important; outline-offset: 3px !important; box-shadow: 0 0 0 8px #000 !important; }
html.a11y-cursor, html.a11y-cursor * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l15 9-6.5 1.5L9 19z' fill='%23000' stroke='%23fff' stroke-width='1.6' stroke-linejoin='round'/%3E%3C/svg%3E") 4 2, auto !important; }
html.a11y-movimento *, html.a11y-movimento *::before, html.a11y-movimento *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html.a11y-movimento video[autoplay] { display: none; }

/* alto contraste: preto, branco e amarelo; tudo com borda */
html.a11y-contraste, html.a11y-contraste body { background: #000 !important; color: #fff !important; }
html.a11y-contraste body *:not(img):not(svg):not(video):not(canvas):not(iframe):not(path):not(.a11y-painel):not(.a11y-painel *):not(.a11y-bt):not(.a11y-bt *) {
  background-color: #000 !important; background-image: none !important; color: #fff !important; border-color: #fff !important; text-shadow: none !important; box-shadow: none !important; }
html.a11y-contraste a, html.a11y-contraste a * { color: #ffeb3b !important; text-decoration: underline !important; }
html.a11y-contraste button, html.a11y-contraste .btn, html.a11y-contraste input, html.a11y-contraste select, html.a11y-contraste textarea { border: 2px solid #fff !important; }
html.a11y-contraste.a11y-contraste.a11y-contraste.a11y-contraste.a11y-contraste body button:hover, html.a11y-contraste.a11y-contraste.a11y-contraste.a11y-contraste.a11y-contraste body .btn:hover, html.a11y-contraste.a11y-contraste.a11y-contraste.a11y-contraste.a11y-contraste body .abas-aluno a.ativo, html.a11y-contraste.a11y-contraste.a11y-contraste.a11y-contraste.a11y-contraste body .ct-filtro.ativo, html.a11y-contraste.a11y-contraste.a11y-contraste.a11y-contraste.a11y-contraste body .ni-item.ativo {
  background-color: #ffeb3b !important; color: #000 !important; }
html.a11y-contraste.a11y-contraste.a11y-contraste.a11y-contraste.a11y-contraste body .abas-aluno a.ativo *, html.a11y-contraste.a11y-contraste.a11y-contraste.a11y-contraste.a11y-contraste body .ct-filtro.ativo *, html.a11y-contraste.a11y-contraste.a11y-contraste.a11y-contraste.a11y-contraste body button:hover *, html.a11y-contraste.a11y-contraste.a11y-contraste.a11y-contraste.a11y-contraste body .ni-item.ativo * { color: #000 !important; }
html.a11y-contraste :focus-visible { outline: 4px solid #ffeb3b !important; outline-offset: 2px !important; }
html.a11y-contraste svg { color: #fff; }
html.a11y-contraste .ag-ic svg { stroke: currentColor; }
html.a11y-contraste ::placeholder { color: #ddd !important; }
html.a11y-contraste img { filter: none; }
html.a11y-contraste .a11y-bt { background: #ffeb3b !important; color: #000 !important; border-color: #000 !important; }
html.a11y-contraste.a11y-contraste.a11y-contraste.a11y-contraste.a11y-contraste body .ag-ic, html.a11y-contraste.a11y-contraste.a11y-contraste.a11y-contraste.a11y-contraste body .ag-ic * { background-color: transparent !important; }
.cd-num.verde, .cd-num.verde small, .otimo, .otimo small { color: #0f5c2c; }
.cd-num.azul, .cd-num.azul small { color: #0d5189; }
.cd-num.vermelho, .cd-num.vermelho small { color: #9c1b21; }

.a11y-linha [aria-pressed="true"] { background: #0b3b70; color: #fff; }
.a11y-bt-txt { white-space: nowrap; }

/* Só a bolinha, um pouco acima do rodapé (o aviso de cookies fica embaixo, sem sobrepor). */
.a11y-bt { bottom: calc(3.4rem + env(safe-area-inset-bottom, 0px)); padding: .55rem; border-radius: 50%; width: 48px; height: 48px; justify-content: center; }
.a11y-bt-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 760px) { .a11y-bt { bottom: calc(76px + env(safe-area-inset-bottom)); } }
