/* Sistema de Frequência — estilos próprios (acessibilidade e responsividade) */
:root {
    --cor-primaria: #1d3a6e;      /* contraste 11:1 com branco */
    --escala-fonte: 1;
}
html { font-size: calc(100% * var(--escala-fonte)); }
body { background: #f4f6fa; color: #1b1f24; }

.bg-primary-dark { background-color: var(--cor-primaria) !important; }
.btn-primary { --bs-btn-bg: #1d4ed8; --bs-btn-border-color: #1d4ed8; --bs-btn-hover-bg: #1e40af; --bs-btn-hover-border-color: #1e40af; }
a { color: #1d4ed8; }

/* Pular para o conteúdo */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 2000; background: #ffd60a; color: #000; padding: .6rem 1rem; font-weight: 700; }
.skip-link:focus { left: .5rem; top: .5rem; }

/* Foco sempre visível (WCAG 2.4.7) */
:focus-visible { outline: 3px solid #ffbf47 !important; outline-offset: 2px !important; box-shadow: 0 0 0 5px #0b0c0c !important; }

.a11y-bar { background: #e9edf5; border-bottom: 1px solid #d4dae6; }
.a11y-bar .btn { min-width: 2.5rem; }

.auth-bg { background: linear-gradient(160deg, #1d3a6e 0%, #2f5aa8 100%); min-height: 100vh; }
.auth-bg footer a { color: #fff; }
.auth-card { max-width: 420px; }
.instalar-card { max-width: 760px; }
.form-estreito { max-width: 680px; }
.texto-legal { max-width: 860px; }

.stat .stat-label { margin: 0; font-size: .875rem; color: #4a5568; }
.stat .stat-value { margin: 0; font-size: 1.9rem; font-weight: 700; color: var(--cor-primaria); }
a.stat:hover { border-color: #1d4ed8; }

/* Chamada: alvos de toque grandes no celular (WCAG 2.5.5) */
.chamada .presenca { display: flex; gap: .4rem; border: 0; margin: 0; padding: 0; }
.chamada .presenca .btn { min-width: 5.5rem; min-height: 2.5rem; }
.sticky-salvar { position: sticky; bottom: 0; background: rgba(244, 246, 250, .95); padding: .75rem 0; }

meter { height: 1rem; }

@media (max-width: 576px) {
    .stat .stat-value { font-size: 1.5rem; }
    .chamada .presenca .btn { min-width: 4.6rem; }
}

/* ---------- Alto contraste ---------- */
html.alto-contraste body, html.alto-contraste .card, html.alto-contraste .list-group-item,
html.alto-contraste .table, html.alto-contraste .a11y-bar, html.alto-contraste .dropdown-menu,
html.alto-contraste .sticky-salvar, html.alto-contraste footer, html.alto-contraste .auth-bg {
    background: #000 !important; color: #fff !important; border-color: #fff !important;
}
html.alto-contraste .table { --bs-table-bg: #000; --bs-table-color: #fff; --bs-table-striped-bg: #111; --bs-table-striped-color: #fff; }
html.alto-contraste a, html.alto-contraste .dropdown-item, html.alto-contraste .nav-link { color: #ffff00 !important; text-decoration: underline; }
html.alto-contraste .btn { background: #000 !important; color: #ffff00 !important; border: 2px solid #ffff00 !important; }
html.alto-contraste .btn-check:checked + .btn { background: #ffff00 !important; color: #000 !important; }
html.alto-contraste .form-control, html.alto-contraste .form-select { background: #000; color: #fff; border: 2px solid #fff; }
html.alto-contraste .text-muted, html.alto-contraste .form-text, html.alto-contraste .stat-label { color: #ddd !important; }
html.alto-contraste .stat .stat-value { color: #ffff00; }
html.alto-contraste .badge, html.alto-contraste .alert { background: #000 !important; color: #fff !important; border: 2px solid #fff !important; }
html.alto-contraste .navbar { background: #000 !important; border-bottom: 2px solid #fff; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .a11y-bar, nav.navbar, footer, form.filtro, .btn { display: none !important; } }

/* Contraste mínimo 4.5:1 nos links do menu (WCAG 1.4.3) */
.navbar-dark { --bs-navbar-color: rgba(255, 255, 255, .9); --bs-navbar-hover-color: #fff; --bs-navbar-active-color: #fff; }
.navbar-dark .nav-link.active { text-decoration: underline; text-underline-offset: .35rem; }
html.alto-contraste ::placeholder { color: #bbb !important; opacity: 1; }
html.alto-contraste code { color: #ffff00; }
html.alto-contraste .card-header { background: #000 !important; border-bottom: 2px solid #fff; }
html.alto-contraste caption, html.alto-contraste .table caption { color: #fff !important; }
