/*
 * indicex — tokens do design system (docs/engenharia-reversa/08 §10).
 * Primária = azul da marca (logo). Razões de contraste WCAG calculadas no §10.2.
 * Redesenho de 2026-10-20: tema claro por padrão (padrão dos portais de mercado), escuro só por escolha no botão: fundo neutro levemente cinza, conteúdo em
 * painéis brancos com borda fina, azul da marca para ação e links, verde e vermelho só para variação.
 */

/* Inter (OFL), auto-hospedada: latin + latin-ext, 400/500/700 (ver assets/fonts/README.md) */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/inter-latin-400-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-weight: 400; font-display: swap; src: url('/assets/fonts/inter-latin-ext-400-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; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/assets/fonts/inter-latin-500-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-weight: 500; font-display: swap; src: url('/assets/fonts/inter-latin-ext-500-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; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('/assets/fonts/inter-latin-700-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-weight: 700; font-display: swap; src: url('/assets/fonts/inter-latin-ext-700-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; }
/* Fallback com métricas próximas da Inter: a troca de fonte quase não desloca o texto (CLS) */
@font-face { font-family: 'Inter Fallback'; src: local('Arial'), local('Helvetica'); size-adjust: 107.12%; ascent-override: 90.44%; descent-override: 22.52%; line-gap-override: 0%; }

:root {
  color-scheme: light;

  /* Cores — claro (contraste WCAG sobre #FFFFFF: text 17,7:1; text-muted 7,7:1; primary 6,3:1; positive 5,7:1; negative 6,6:1) */
  --bg: #F2F4F8;                           /* fundo da página */
  --surface: #FFFFFF;                      /* painéis, cartões, cabeçalho */
  --surface-2: #F6F8FB;                    /* cabeçalho de tabela, áreas recuadas */
  --surface-3: #EAF1FD;                    /* destaque suave da marca */
  --text: #101828;
  --text-muted: #475467;
  --primary: #1A5BC4;
  --primary-strong: #144A9F;
  --brand-glow: rgb(32 104 224 / 0.30);   /* #2068E0, só decorativo, nunca em texto */
  --on-primary: #FFFFFF;
  --positive: #067647;
  --negative: #B42318;
  --warning: #8A5A00;
  --premium: #6B3FA0;
  --border: #E4E7EC;
  --border-strong: #7A8496;
  --focus: var(--primary);
  --positive-bg: #E7F6EC;
  --negative-bg: #FDECEA;
  --topo: #0E2A5C;                         /* faixa do topo da home: azul-marinho da marca */
  --topo-texto: #FFFFFF;
  --topo-suave: #C9D7F2;
  /* Tipografia: Inter auto-hospedada (P11), com fallback de métricas ajustadas */
  --font-sans: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --fs-xs: 0.75rem;   --lh-xs: 1rem;      /* 12/16 */
  --fs-sm: 0.875rem;  --lh-sm: 1.25rem;   /* 14/20 */
  --fs-md: 1rem;      --lh-md: 1.5rem;    /* 16/24 */
  --fs-lg: 1.25rem;   --lh-lg: 1.75rem;   /* 20/28 */
  --fs-xl: 1.5rem;    --lh-xl: 2rem;      /* 24/32 */
  --fs-2xl: 2rem;     --lh-2xl: 2.5rem;   /* 32/40 */
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --tracking-titulo: -0.01em;

  /* Espaçamento (base 4 px) */
  --sp-1: 0.25rem;  /* 4 */
  --sp-2: 0.5rem;   /* 8 */
  --sp-3: 0.75rem;  /* 12 */
  --sp-4: 1rem;     /* 16 */
  --sp-5: 1.5rem;   /* 24 */
  --sp-6: 2rem;     /* 32 */
  --sp-7: 3rem;     /* 48 */
  --sp-8: 4rem;     /* 64 */

  /* Raios, sombras, movimento */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-pill: 999px;
  --shadow-1: 0 1px 2px rgb(16 24 40 / 0.05);
  --shadow-painel: 0 1px 3px rgb(16 24 40 / 0.06), 0 1px 2px rgb(16 24 40 / 0.04);
  --shadow-2: 0 4px 12px rgb(23 32 51 / 0.12), 0 12px 32px rgb(23 32 51 / 0.10);
  --dur: 180ms;
  --ease: ease-out;

  /* Layout */
  --conteiner: 1200px;
  --lateral: 300px;
}

/*
 * Tema escuro OPCIONAL (2026-10-20): só quando o visitante escolhe no botão do cabeçalho (cookie ix_tema=escuro, que o
 * servidor transforma em <html data-theme="escuro"> antes de enviar a página: sem piscar). Nunca automático.
 * Contraste (WCAG) sobre --surface #131B27: text 14,3:1; text-muted 8,2:1; primary 7,4:1; positive 9,2:1; negative 7,6:1.
 */
:root[data-theme="escuro"] {
  color-scheme: dark;
  --bg: #0B111A;
  --surface: #131B27;
  --surface-2: #1A2433;
  --surface-3: #1C2C47;
  --text: #E6EAF0;
  --text-muted: #A9B3C2;
  --primary: #7EAAF7;
  --primary-strong: #A3C2FA;
  --brand-glow: rgb(59 123 234 / 0.35);
  --on-primary: #0B111A;
  --positive: #5FD38D;
  --negative: #FF8A80;
  --warning: #F2C14E;
  --premium: #C3A6F0;
  --border: #273246;
  --border-strong: #6B778A;
  --positive-bg: rgb(95 211 141 / 0.14);
  --negative-bg: rgb(255 138 128 / 0.14);
  --topo: #0A1F45;
  --shadow-1: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-painel: 0 1px 3px rgb(0 0 0 / 0.35);
  --shadow-2: 0 4px 12px rgb(0 0 0 / 0.5), 0 12px 32px rgb(0 0 0 / 0.4);
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur: 0ms; }
}
