/* ════════════════════════════════════════════════════════════════════════
   base.css — reset + estilos globais + a11y.
   ════════════════════════════════════════════════════════════════════════ */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; background: none; border: none; }

h1, h2, h3, h4 { font-weight: var(--fw-semibold); letter-spacing: var(--tracking-tight); line-height: 1.2; }
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }

ul, ol { list-style: none; }

/* ════════ Ícones Lucide ════════ */
.icon       { width: 20px; height: 20px; stroke-width: 2; flex-shrink: 0; }
.icon-sm    { width: 16px; height: 16px; }
.icon-lg    { width: 24px; height: 24px; }

/* ════════ Foco visível (a11y obrigatório) ════════ */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ════════ Skip link ════════ */
.u-skip-link {
  position: absolute;
  top: -100px; left: var(--space-4);
  z-index: var(--z-toast);
  padding: var(--space-2) var(--space-4);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: top var(--duration-fast) var(--ease);
}
.u-skip-link:focus { top: var(--space-4); }

/* ════════ Container raiz ════════ */
#app-root { display: block; min-height: 60vh; }

/* ════════ Utilitários ════════ */
.u-sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.u-mono   { font-family: var(--font-mono); }
.u-center { text-align: center; }
.u-hidden { display: none !important; }

/* ════════ Reduced motion (a11y) ════════ */
@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;
  }
}

/* ════════ Scrollbar discreta ════════ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-subtle); }
