/* Magnifit — Base, Tipografia e Grade 12 Colunas (LAY-01 a LAY-04) */

/* KB Magnifit, 5: Inter e Barlow Condensed embarcadas (licença OFL, arquivos em public/fonts) */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/inter-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/inter-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/inter-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/inter-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-style: normal; font-weight: 800; font-display: swap; src: url('/fonts/barlow-condensed-latin-800-normal.woff2') format('woff2'); }

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

html {
  -webkit-text-size-adjust: 100%;
  font-variant-numeric: tabular-nums;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.45;
  font-weight: 400;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--dur-med) var(--ease-out), color var(--dur-med) var(--ease-out);
}

/* 2.3 Tipografia e Escala */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* KB Magnifit, 5: título de tela em Barlow Condensed 800, caixa alta, espaçamento +1% */
h1, .text-display {
  font-family: var(--font-display);
  font-size: 32px;
  line-height: 1.05;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
}

@media (min-width: 901px) {
  h1, .text-display {
    font-size: 40px;
    line-height: 1.05;
  }
}

h2, .text-title {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
}

h3, .text-title-sm {
  font-size: 17px;
  line-height: 1.35;
  font-weight: 700;
}

p, .text-body {
  font-size: 15px;
  line-height: 1.45;
  max-width: 65ch;
}

.text-body-sm, .small {
  font-size: 14px;
  line-height: 20px;
}

.text-caption, .caption {
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.caption-upper {
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}

/* Números de destaque (Barlow Semi Condensed + tabular-nums) */
.metric,
.stat-val {
  font-family: var(--font-metric);
  font-size: 32px;
  line-height: 36px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: var(--text);
}

.metric-xl {
  font-family: var(--font-metric);
  font-size: 48px;
  line-height: 52px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--text);
}

.tabular-nums,
table,
td,
th,
input[type="number"],
.badge,
.timer-display {
  font-variant-numeric: tabular-nums;
}

.muted {
  color: var(--muted);
}

.text-2 {
  color: var(--text-2);
}

.text-brand {
  color: var(--brand);
}

.text-gold {
  color:var(--gold-text);
}

.text-warning {
  color: var(--warning);
}

.text-danger {
  color: var(--danger);
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

a:hover {
  color: var(--brand-hover);
}

/* 2.4 Container e Layout Principal */
.main-container {
  max-width: var(--container-max);
  width: 100%;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
  flex: 1;
}

.form-container-narrow {
  max-width: var(--form-max);
  width: 100%;
  margin: 0 auto;
}

.section-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-12);
}

/* Grade de 12 colunas corrigida (LAY-01 a LAY-04) */
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--space-5);
  align-items: start;
}

.grid > * {
  min-width: 0;
}

.col-1  { grid-column: span 1; }
.col-2  { grid-column: span 2; }
.col-3  { grid-column: span 3; }
.col-4  { grid-column: span 4; }
.col-5  { grid-column: span 5; }
.col-6  { grid-column: span 6; }
.col-7  { grid-column: span 7; }
.col-8  { grid-column: span 8; }
.col-9  { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; }
.col-12 { grid-column: span 12; }

/* Utilitários de Flex e Espaçamento (escala de 4 px) */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-row { display: flex; flex-direction: row; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; min-width: 0; }

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.gap-10 { gap: var(--space-10); }
.gap-12 { gap: var(--space-12); }

.w-full { width: 100%; }
.hidden { display: none !important; }
.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;
}

/* Breakpoints responsivos para garantir blocos >= 280px no desktop e 1 coluna no celular */
@media (max-width: 1100px) and (min-width: 901px) {
  .col-3 {
    grid-column: span 6;
  }
}

@media (max-width: 900px) {
  .main-container {
    padding: var(--space-5) var(--space-4) calc(88px + env(safe-area-inset-bottom, 0px));
  }

  .section-stack {
    gap: var(--space-8);
  }

  .grid {
    gap: var(--space-4);
  }

  .col-1,
  .col-2,
  .col-3,
  .col-4,
  .col-5,
  .col-6,
  .col-7,
  .col-8,
  .col-9,
  .col-10,
  .col-11 {
    grid-column: span 12 !important;
  }

  /* Pares naturais permitidos lado a lado no celular (Seção 3.2: UF com cidade, mín. com máx.) */
  .grid .col-mobile-6 {
    grid-column: span 6 !important;
  }
  .grid .col-mobile-4 {
    grid-column: span 4 !important;
  }
  .grid .col-mobile-8 {
    grid-column: span 8 !important;
  }
}

/* 2.6 Acessibilidade — Redução de Movimento */
@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;
  }
}
