/* ==========================================================================
   MOA Gestão — reset + base
   ========================================================================== */

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

  * { margin: 0; }

  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    tab-size: 2;
  }

  body {
    min-height: 100dvh;
    font-family: var(--font-ui);
    font-size: var(--fs-md);
    line-height: var(--lh-normal);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
  }

  img, picture, svg, video, canvas {
    display: block;
    max-width: 100%;
  }

  img, video { height: auto; }

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

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

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

  p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

  ul[role='list'], ol[role='list'] { list-style: none; padding: 0; }

  table { border-collapse: collapse; width: 100%; }

  :focus-visible {
    outline: 3px solid var(--brand-500);
    outline-offset: 2px;
    border-radius: var(--r-xs);
  }

  ::selection {
    background: var(--brand-500);
    color: var(--ink-900);
  }

  ::-webkit-scrollbar { width: 12px; height: 12px; }
  ::-webkit-scrollbar-track { background: var(--surface-2); }
  ::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: var(--r-full);
    border: 3px solid var(--surface-2);
  }
  ::-webkit-scrollbar-thumb:hover { background: var(--brand-600); }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
      animation-duration: .01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: .01ms !important;
      scroll-behavior: auto !important;
    }
  }
}

@layer base {
  h1, h2, h3, h4 {
    line-height: var(--lh-snug);
    font-weight: 800;
    letter-spacing: -.02em;
  }

  .display {
    font-family: var(--font-display);
    letter-spacing: -.015em;
    line-height: var(--lh-tight);
    text-transform: uppercase;
  }

  strong, b { font-weight: 700; }

  small { font-size: var(--fs-sm); }

  code, kbd, samp {
    font-family: var(--font-mono);
    font-size: .92em;
    background: var(--surface-2);
    padding: .12em .4em;
    border-radius: var(--r-xs);
  }

  hr {
    border: 0;
    border-top: var(--border);
    margin-block: var(--sp-6);
  }

  /* ---------- utilidades estruturais ---------- */
  .container {
    width: min(100% - 2.5rem, var(--container));
    margin-inline: auto;
  }

  .container--narrow { width: min(100% - 2.5rem, var(--container-narrow)); }

  .stack > * + * { margin-top: var(--flow, var(--sp-4)); }

  .cluster {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap, var(--sp-3));
    align-items: center;
  }

  .sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .skip-link {
    position: absolute;
    inset-inline-start: var(--sp-4);
    inset-block-start: -100px;
    z-index: var(--z-max);
    padding: var(--sp-3) var(--sp-5);
    background: var(--brand-500);
    color: var(--ink-900);
    border-radius: var(--r-sm);
    font-weight: 700;
    transition: inset-block-start var(--t-fast) var(--ease-out);

    &:focus { inset-block-start: var(--sp-4); }
  }

  [hidden] { display: none !important; }

  .text-brand { color: var(--brand-500); }
  .text-soft  { color: var(--text-soft); }
  .text-mute  { color: var(--text-mute); }
  .text-ok    { color: var(--ok-500); }
  .text-warn  { color: var(--warn-500); }
  .text-danger{ color: var(--danger-500); }
  .text-center{ text-align: center; }
  .text-right { text-align: right; }
  .nowrap     { white-space: nowrap; }
  .mono       { font-family: var(--font-mono); }

  .mt-0 { margin-top: 0 } .mt-2 { margin-top: var(--sp-2) }
  .mt-4 { margin-top: var(--sp-4) } .mt-6 { margin-top: var(--sp-6) }
  .mt-8 { margin-top: var(--sp-8) }
  .mb-0 { margin-bottom: 0 } .mb-2 { margin-bottom: var(--sp-2) }
  .mb-4 { margin-bottom: var(--sp-4) } .mb-6 { margin-bottom: var(--sp-6) }

  .grid { display: grid; gap: var(--gap, var(--sp-5)); }
  .grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
  .grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
  .grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }

  .flex { display: flex; gap: var(--gap, var(--sp-3)); }
  .flex--between { justify-content: space-between; align-items: center; }
  .flex--center { justify-content: center; align-items: center; }
  .flex--end { justify-content: flex-end; align-items: center; }
  .flex--col { flex-direction: column; }
  .flex-1 { flex: 1; }
  .wrap { flex-wrap: wrap; }
}
