/* ==========================================================================
   LicitaMais — Base: fontes, reset, tipografia, foco, layout e utilitários.
   Depende de tokens.css.
   ========================================================================== */

/* Inter auto-hospedada (variável 100–900). Evita enviar o IP do usuário ao
   Google (LGPD), funciona com CSP restrita e fica em cache no WebView. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2-variations"),
       url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations"),
       url("/assets/fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

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

html {
  /* Impede o Safari/WebView de aumentar a fonte sozinho em paisagem,
     sem bloquear o zoom do usuário. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Campos focados não ficam escondidos atrás do cabeçalho fixo. */
  scroll-padding-top: calc(var(--header-h) + var(--safe-top) + var(--sp-4));
  scroll-padding-bottom: var(--sp-8);
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: no-preference) {
  html:focus-within {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  font-feature-settings: "cv11", "ss01"; /* "a" e "l" mais legíveis na Inter */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  overflow-wrap: break-word;
}

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

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

button {
  cursor: pointer;
}

h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd {
  margin: 0;
}

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

[hidden] {
  display: none !important;
}

/* ---- Tipografia --------------------------------------------------------- */
h1, h2, h3, h4,
.h1, .h2, .h3, .h4, .display {
  color: var(--color-heading);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  text-wrap: balance;
}
h1, .h1 { font-size: var(--fs-2xl); }
h2, .h2 { font-size: var(--fs-xl); }
h3, .h3 { font-size: var(--fs-lg); letter-spacing: var(--ls-snug); }
h4, .h4 { font-size: var(--fs-md); letter-spacing: var(--ls-snug); font-weight: var(--fw-semibold); }
.display { font-size: var(--fs-3xl); font-weight: var(--fw-extrabold); }

p {
  text-wrap: pretty;
}

.text-sm { font-size: var(--fs-sm); line-height: var(--lh-snug); }
.text-xs { font-size: var(--fs-xs); line-height: var(--lh-snug); }
.text-lg { font-size: var(--fs-md); }
.text-muted { color: var(--color-text-muted); }
.text-strong { font-weight: var(--fw-semibold); color: var(--color-heading); }
.num { font-variant-numeric: tabular-nums; }
.eyebrow {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

a {
  color: var(--color-link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover {
  color: var(--color-link-hover);
  text-decoration-thickness: 2px;
}

strong, b { font-weight: var(--fw-semibold); }

code, kbd {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

hr {
  border: 0;
  border-top: var(--border-w) solid var(--color-border);
  margin: var(--sp-6) 0;
}

::selection {
  background: var(--lm-green-light);
  color: var(--lm-navy);
}

/* ---- Foco visível (teclado) --------------------------------------------- */
:focus {
  outline: none;
}
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
/* Títulos recebem foco por código (para o leitor de tela anunciar o novo estado),
   não por navegação: sem contorno. */
:is(h1, h2, h3)[tabindex="-1"]:focus-visible {
  outline: none;
}

/* ---- Layout ------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: max(var(--gutter), var(--safe-left)) max(var(--gutter), var(--safe-right));
}

.stack { display: flex; flex-direction: column; gap: var(--stack-gap, var(--sp-4)); }
.stack-sm { --stack-gap: var(--sp-2); }
.stack-lg { --stack-gap: var(--sp-8); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cluster-gap, var(--sp-3)); }
.cluster-between { justify-content: space-between; }
.grid-auto {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--grid-min, 16rem)), 1fr));
}

/* ---- Acessibilidade ----------------------------------------------------- */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: calc(var(--safe-top) + var(--sp-2));
  left: var(--sp-2);
  z-index: var(--z-tooltip);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: var(--fw-semibold);
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: none;
  color: var(--color-on-primary);
}

/* ---- Ícones (sprite SVG) ------------------------------------------------ */
.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
.icon-sm { width: 1rem; height: 1rem; }
.icon-lg { width: 1.5rem; height: 1.5rem; }
.icon-xl { width: 2rem; height: 2rem; stroke-width: 1.75; }

/* ---- Logo --------------------------------------------------------------- */
.logo {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  border-radius: var(--radius-sm);
}
.logo img {
  height: var(--logo-h, 2.25rem);
  width: auto;
}
/* Troca para a versão clara da logo no tema escuro. */
.logo .logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo .logo-dark { display: block; }
}
:root[data-theme="dark"] .logo .logo-light { display: none; }
:root[data-theme="dark"] .logo .logo-dark { display: block; }
