/* =========================================================================
   base.css — Reset leve + tipografia + defaults mobile-first
   ========================================================================= */

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

* {
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100svh;           /* small viewport = mais estável no mobile */
  overscroll-behavior-y: none;  /* evita bounce estranho no iOS */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Imagens responsivas por padrão */
img, picture, video, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Inputs herdam fonte do sistema — crítico no mobile */
input, button, textarea, select {
  font: inherit;
  color: inherit;
}

/* Evita zoom iOS em inputs (font >= 16px) */
input, textarea, select {
  font-size: var(--fs-md);
}

/* Botões sem aparência default */
button {
  background: none;
  border: none;
  cursor: pointer;
  -webkit-appearance: none;
}

/* Links */
a {
  color: inherit;
  text-decoration: none;
}

/* Listas sem bullets */
ul, ol {
  list-style: none;
}

/* Headings herdam tamanho — vamos controlar por classe/componente */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--fw-semi);
  line-height: var(--lh-tight);
}

h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }
h6 { font-size: var(--fs-sm); }

/* Foco acessível */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Reduce motion — respeita preferência do usuário */
@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;
  }
}

/* Seleção de texto com cor da marca */
::selection {
  background: var(--color-primary-soft);
  color: var(--color-text);
}
