/* The Bridge — fontes auto-hospedadas (SIL OFL 1.1). Sem CDN: o Agent roda on-premises. */
@font-face { font-family: "Archivo"; src: url("/static/ds/assets/fonts/archivo-variable.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url("/static/ds/assets/fonts/dm-mono-400-latin.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; 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: "DM Mono"; src: url("/static/ds/assets/fonts/dm-mono-400-latin-ext.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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: "DM Mono"; src: url("/static/ds/assets/fonts/dm-mono-500-latin.woff2") format("woff2"); font-weight: 500 900; font-style: normal; font-display: swap; 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: "DM Mono"; src: url("/static/ds/assets/fonts/dm-mono-500-latin-ext.woff2") format("woff2"); font-weight: 500 900; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, 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; }

/* PGIntegra Cloud Consoles — Design System Base
 * Reset minimalista moderno + body/heading/link defaults.
 * Spec: MASTER.md secao 2 (Typography) + secao 4 (Motion).
 * Issue: #158 (epico #175).
 *
 * Fontes self-hosted (woff2) em /static/ds/assets/fonts/ — o Agent roda
 * offline/on-prem, sem acesso a CDN externo.
 */

/* ============================================================
 * Fontes self-hosted — Archivo (sans) + DM Mono (mono)
 * Subset local, font-display: swap; sem CDN externo.
 * ============================================================ */

/* ============================================================
 * Reset minimalista (Andy Bell / modern-reset approach)
 * ============================================================ */

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

* {
  margin: 0;
  padding: 0;
}

html {
  color-scheme: light dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  hanging-punctuation: first last;
  /* Densidade unificada (#342): root 100% (16px) nos dois consoles. A
   * densidade dual anterior (CP 87.5% via .density-compact) foi aposentada
   * na convergência de tabelas/densidade (G1/AG3). */
  font-size: 100%;
}

html:focus-within {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-primary);
  background: var(--surface-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

button {
  background: none;
  border: none;
  cursor: pointer;
}

p,
li,
figcaption {
  text-wrap: pretty;
  max-width: 65ch;
}

/* ============================================================
 * Headings — fallback por papel, sem a segunda escala legada.
 * Componentes podem ter hierarquia própria (card, estado, métrica, marca).
 * ============================================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-primary);
  line-height: var(--lh-heading);
  letter-spacing: var(--display-tracking-sm);
  text-wrap: balance;
  font-weight: var(--fw-semibold);
  overflow-wrap: anywhere;
}

h1 {
  font-size: var(--fs-title);
  font-weight: var(--fw-display);
  line-height: var(--lh-title);
  font-stretch: var(--stretch-display);
  letter-spacing: var(--display-tracking);
}

h2 {
  font-size: var(--fs-subhead);
  font-weight: var(--fw-semibold);
  font-stretch: var(--stretch-figure);
  letter-spacing: var(--display-tracking);
}

h3 {
  font-size: var(--fs-heading);
  font-weight: var(--fw-semibold);
}

h4 {
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
}

h5 {
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
}

h6 {
  font-size: var(--fs-small);
  font-weight: var(--fw-semibold);
}

/* ============================================================
 * Links — accent + focus-visible mandatório
 * ============================================================ */

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color var(--motion-fast) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  a:hover {
    color: var(--accent-ink);
  }
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ============================================================
 * Code / pre / kbd — monospace stack
 * ============================================================ */

code,
pre,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
}

code {
  background: var(--surface-elevated);
  padding: 0.1em 0.35em;
  border-radius: 0.25rem;
}

pre {
  background: var(--surface-elevated);
  padding: var(--space-3) var(--space-4);
  border-radius: 0.375rem;
  overflow-x: auto;
  line-height: var(--lh-body);
}

pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

kbd {
  background: var(--surface-elevated);
  border: 1px solid var(--border-default);
  border-radius: 0.25rem;
  padding: 0.1em 0.4em;
  font-size: var(--fs-caption);
}

/* ============================================================
 * Form elements baseline — sem opiniao visual alem do necessario
 * ============================================================ */

input,
textarea,
select {
  border: 1px solid var(--border-default);
  border-radius: 0.375rem;
  background: var(--surface-overlay);
  color: var(--text-primary);
  padding: var(--space-2) var(--space-3);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================================
 * Tabular numerics utility — colunas de numero/data/ID
 * ============================================================ */

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* ============================================================
 * Reduced motion — MANDATORIO (MASTER.md secao 4.3)
 * ============================================================ */

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

/* #683: suspensão somente durante a troca de tema dos consoles migrados. */
.no-motion *, .no-motion *::before, .no-motion *::after { transition: none !important; }
