/* ==========================================================================
   Base: reset, tipografia e utilitários mínimos
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Compensa o header fixo e a navegação flutuante ao rolar até um elemento/foco */
  scroll-padding-top: calc(var(--header-h) + 16px);
  scroll-padding-bottom: 112px;
}

@media (min-width: 1024px) {
  html {
    scroll-padding-bottom: 24px;
  }
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--font);
  font-size: 14px;
  line-height: 20px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overscroll-behavior-y: none;
}

body.is-locked {
  overflow: hidden;
}

::selection {
  background: var(--secondary-fixed);
  color: var(--on-secondary-fixed);
}

h1, h2, h3, h4, p {
  margin: 0;
}

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

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

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
}

:focus-visible {
  outline: 2px solid var(--secondary-container);
  outline-offset: 2px;
}

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

ul,
ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ---- Ícones (Material Symbols Outlined) ---- */
.ms {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  flex-shrink: 0;
  width: 1em;
  height: 1em;
  overflow: hidden;
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  user-select: none;
}

.ms.fill {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ---- Escala tipográfica ---- */
.t-display {
  font-size: 32px;
  line-height: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.t-headline-lg {
  font-size: 28px;
  line-height: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.t-headline-md {
  font-size: 22px;
  line-height: 28px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.t-headline-sm {
  font-size: 18px;
  line-height: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.t-body-lg {
  font-size: 16px;
  line-height: 24px;
  letter-spacing: -0.005em;
}
.t-body-md {
  font-size: 14px;
  line-height: 20px;
}
.t-body-sm {
  font-size: 13px;
  line-height: 18px;
}
.t-label-md {
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.t-label-sm {
  font-size: 11px;
  line-height: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.t-num-lg {
  font-size: 32px;
  line-height: 38px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.t-num-md {
  font-size: 20px;
  line-height: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

@media (min-width: 1024px) {
  .t-display.t-display--grow {
    font-size: 40px;
    line-height: 48px;
    letter-spacing: -0.03em;
  }
}

/* Números financeiros sempre com algarismos tabulares */
.num,
.t-num-lg,
.t-num-md,
.t-display {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

.upper {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.muted {
  color: var(--on-surface-variant);
}

.nowrap {
  white-space: nowrap;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.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;
}

.text-positive { color: var(--positive); }
.text-warning { color: var(--warning-strong); }
.text-negative { color: var(--negative); }
.text-secondary { color: var(--secondary); }

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
