/**
 * Base global — reset, tipografia, utilidades e regras de acessibilidade.
 * Importado primeiro pelo app.css.
 */

/* ==================== Reset ==================== */

*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; padding: 0; }

body {
    font-family: var(--font-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-default);
    background: var(--bg-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--brand-secondary); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; cursor: pointer; }

img { max-width: 100%; display: block; }

/* ==================== Tipografia ==================== */

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    margin: 0 0 0.5em;
    font-weight: 700;
}

/* Tipografia — escala por tiers definida em variables.css */
h1 { font-size: var(--sigefc-fs-2xl); }
h2 { font-size: var(--sigefc-fs-xl); }
h3 { font-size: var(--sigefc-fs-lg); }

.text-muted { color: var(--text-muted); }
.small { font-size: var(--sigefc-fs-sm); }

/* ==================== Utilities ==================== */

.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }

/* ==================== Acessibilidade / Touch ==================== */

/* Indicador de foco visivel SO em navegacao por teclado (nao polui mouse).
   Concentra todos os clicaveis num so lugar — laranja Concremat por contraste. */
.btn:focus-visible,
.modal-close:focus-visible,
.sidebar-menu a:focus-visible,
.sidebar-toggle:focus-visible {
    outline: 2px solid var(--brand-accent);
    outline-offset: 2px;
}

/* Touch targets — Apple HIG / Google Material recomendam >= 44px em telas tactil */
@media (hover: none) and (pointer: coarse) {
    .btn { min-height: 44px; }
    .modal-close { width: 44px; height: 44px; }
}

/* Respeita preferencia de "reduzir animacoes" do sistema operacional */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
