/* ══════════════════════════════════════════════════════════════════════════
   base.css — reset, tipografia, botões, formulários, utilitários de layout.
   Depende de tokens.css. Não conhece nenhum componente.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;   /* header fixo não cobre a âncora */
}

body {
  font-family: var(--f-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink-2);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-synthesis-weight: none;
}

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
ul, ol { list-style: none; padding: 0; }

/* ── Tipografia ─────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: var(--f-display);
  color: var(--ink);
  line-height: var(--lh-head);
  text-wrap: balance;
  font-weight: 700;
}
h1 { font-size: var(--fs-h1); letter-spacing: var(--tr-head); }
h2 { font-size: var(--fs-h2); letter-spacing: var(--tr-head); }
h3 { font-size: var(--fs-h3); letter-spacing: -0.014em; }
h4 { font-size: var(--fs-h4); }

p { text-wrap: pretty; }

a { color: var(--green-800); text-decoration: none; }
a:hover { color: var(--forest); }

strong, b { font-weight: 700; color: var(--ink); }

/* Numerais alinhados sempre que houver dinheiro ou contagem em coluna */
.tnum, .money, td, .stat-n { font-variant-numeric: tabular-nums; }

/* ── Foco — visível, sempre, em tudo ────────────────────────────────────── */
:focus-visible {
  outline: 2.5px solid var(--green-800);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}
:focus:not(:focus-visible) { outline: none; }

/* Pular para o conteúdo — primeiro tab de qualquer página */
.skip-link {
  position: absolute; top: -100px; left: var(--gutter); z-index: 999;
  background: var(--forest); color: var(--white);
  padding: var(--sp-3) var(--sp-5); border-radius: 0 0 var(--r-sm) var(--r-sm);
  font-weight: 700; font-size: var(--fs-sm);
  transition: top var(--d-fast) var(--ease);
}
.skip-link:focus { top: 0; color: var(--white); }

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

/* ── Layout ─────────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--sec-y); }
.section--tight { padding-block: var(--sec-y-sm); }
.section--wash { background: var(--wash); }
.section--dark { background: var(--forest); color: var(--glow-50); }
.section--dark h1, .section--dark h2, .section--dark h3 { color: var(--white); }
.section--dark .eyebrow { color: var(--lime-300); }

.prose { max-width: var(--measure); }

/* Pilha vertical — espaçamento vem do gap, nunca de margin solta */
.stack   { display: flex; flex-direction: column; gap: var(--sp-4); }
.stack-6 { display: flex; flex-direction: column; gap: var(--sp-6); }
.stack-8 { display: flex; flex-direction: column; gap: var(--sp-8); }

/* ── Cabeçalho de seção — padrão único em todo o site ───────────────────── */
.sec-head {
  display: flex; flex-direction: column; gap: var(--sp-3);
  max-width: 62ch; margin-bottom: var(--sp-10);
}
.sec-head--center { margin-inline: auto; text-align: center; align-items: center; }

.eyebrow {
  font-family: var(--f-body);
  font-size: var(--fs-eyebrow);
  font-weight: 700;
  letter-spacing: var(--tr-eyebrow);
  text-transform: uppercase;
  color: var(--green-800);
  display: flex; align-items: center; gap: var(--sp-2);
}
.eyebrow::before {
  content: ""; width: 18px; height: 2px; border-radius: 2px;
  background: var(--lime-500); flex: 0 0 auto;
}
.sec-head--center .eyebrow { justify-content: center; }

.sec-sub { color: var(--muted); font-size: var(--fs-lg); max-width: 56ch; }

/* ── Botões ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2);
  font-family: var(--f-body); font-weight: 700; font-size: var(--fs-sm);
  padding: 0.8125rem 1.5rem;
  border-radius: var(--r-pill);
  border: 1.5px solid transparent;
  cursor: pointer; white-space: nowrap; text-align: center;
  transition: background var(--d-fast) var(--ease),
              border-color var(--d-fast) var(--ease),
              color var(--d-fast) var(--ease),
              transform var(--d-fast) var(--ease),
              box-shadow var(--d-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn svg { flex: 0 0 auto; }

/* Primário — o verde dos morros: 6,9:1 contra texto branco */
.btn--primary { background: var(--green-800); color: var(--white); box-shadow: var(--sh-sm); }
.btn--primary:hover { background: var(--forest); color: var(--white); box-shadow: var(--sh-md); transform: translateY(-1px); }

.btn--ghost { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--green-500); background: var(--glow-50); color: var(--forest); }

.btn--light { background: var(--white); color: var(--forest); }
.btn--light:hover { background: var(--glow-50); color: var(--forest); transform: translateY(-1px); }

.btn--outline-light { background: transparent; color: var(--white); border-color: rgba(255,255,255,.4); }
.btn--outline-light:hover { background: rgba(255,255,255,.12); color: var(--white); border-color: rgba(255,255,255,.7); }

.btn--lg { font-size: var(--fs-lg); padding: 1rem 1.875rem; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }

/* Link com seta que abre no hover */
.link-arrow {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-weight: 700; font-size: var(--fs-sm); color: var(--green-800);
  transition: gap var(--d-fast) var(--ease), color var(--d-fast) var(--ease);
}
.link-arrow:hover { gap: var(--sp-3); color: var(--forest); }

/* ── Formulários ────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: var(--sp-2); }
.field > label { font-size: var(--fs-sm); font-weight: 700; color: var(--ink); }
.field-hint { font-size: var(--fs-xs); color: var(--muted); }
.field-error { font-size: var(--fs-xs); color: var(--danger); font-weight: 600; }

.input, .textarea, .select {
  width: 100%;
  padding: 0.8125rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--white);
  color: var(--ink);
  font-size: var(--fs-sm);
  transition: border-color var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--subtle); }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--green-500); box-shadow: var(--sh-ring);
}
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.select { appearance: none; padding-right: 2.5rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B8177' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.875rem center; background-size: 16px;
}

/* ── Movimento — estados iniciais ───────────────────────────────────────── */
/* .reveal entra uma vez; motion.js adiciona .is-in e desconecta o observer */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--d-slow) var(--ease), transform var(--d-slow) var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; }

/* Sem JS, nada fica invisível */
.no-js .reveal { opacity: 1; transform: none; }

/* ── Reduced motion — o site inteiro funciona parado ────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
