/* ==========================================================================
   CHECKPLACE DS — BASE
   Reset mínimo, tipografia, foco, utilitários de layout.
   Carregue depois de tokens.css.
   Regras de elemento usam :where(.cp-body) de propósito: especificidade zero, para nunca vencer um componente. Prefixo de tudo que é componente/utilitário: cp-
   (o prefixo evita colisão com as classes antigas durante a migração tela a tela).
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body.cp-body, .cp-body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: var(--leading-normal);
  font-weight: var(--weight-regular);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  font-feature-settings: 'cv11' 1, 'ss03' 0;
}

:where(.cp-body) :is(button, input, select, textarea) { font-family: inherit; font-size: inherit; color: inherit; }
:where(.cp-body) button { cursor: pointer; }
:where(.cp-body) :is(h1, h2, h3, h4, p, figure, ul, ol) { margin: 0; }
:where(.cp-body) ::selection { background: var(--color-primary-soft-2); }

/* Foco visível: um padrão só, em tudo que é interativo */
:where(.cp-body) :focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--radius-sm); }
:where(.cp-body) :focus:not(:focus-visible) { outline: none; }

:where(.cp-body) a { color: var(--color-text-link); text-underline-offset: 3px; }
:where(.cp-body) a:hover { color: var(--color-primary-pressed); }

/* ---------- Tipografia (papéis, não tamanhos soltos) ---------- */
.cp-display   { font-family: var(--font-display); letter-spacing: var(--tracking-tight); }
.cp-h1 { font-family: var(--font-display); font-size: var(--text-page-title); font-weight: var(--weight-semibold);
         line-height: var(--leading-tight); letter-spacing: var(--tracking-tight); text-wrap: balance; }
.cp-h2 { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: var(--weight-semibold);
         line-height: var(--leading-tight); letter-spacing: var(--tracking-tight); text-wrap: balance; }
.cp-h3 { font-family: var(--font-display); font-size: var(--text-xl); font-weight: var(--weight-semibold);
         line-height: var(--leading-tight); }
.cp-h4 { font-size: var(--text-lg); font-weight: var(--weight-semibold); line-height: var(--leading-snug); }
.cp-body-text { font-size: var(--text-body); line-height: var(--leading-normal); max-width: var(--measure); text-wrap: pretty; }
.cp-small     { font-size: var(--text-sm); line-height: var(--leading-snug); }
.cp-caption   { font-size: var(--text-xs); line-height: var(--leading-snug); }
.cp-label-text{ font-size: var(--text-sm); font-weight: var(--weight-semibold); line-height: var(--leading-snug); }
.cp-eyebrow   { font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: .04em; text-transform: uppercase; color: var(--color-text-tertiary); }
.cp-secondary { color: var(--color-text-secondary); }
.cp-tertiary  { color: var(--color-text-tertiary); }

/* Números: sempre alinhados em coluna (valores, datas, horas, quantidades) */
.cp-num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }

.cp-wordmark { font-family: var(--font-display); font-weight: var(--weight-bold); letter-spacing: var(--tracking-tight); white-space: nowrap; color: var(--color-text); }
.cp-wordmark b { font-weight: inherit; color: var(--color-primary); }

/* ---------- Texto longo ---------- */
.cp-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cp-clamp-2  { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cp-break    { overflow-wrap: anywhere; }

/* ---------- Layout ---------- */
.cp-stack   { display: flex; flex-direction: column; gap: var(--gap, var(--space-md)); min-width: 0; }
.cp-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap, var(--space-xs)); min-width: 0; }
.cp-split   { display: flex; align-items: center; justify-content: space-between; gap: var(--gap, var(--space-md)); min-width: 0; }
.cp-grow    { flex: 1 1 0; min-width: 0; }
.cp-grid    { display: grid; gap: var(--gap, var(--space-md)); grid-template-columns: repeat(auto-fit, minmax(min(var(--min, 240px), 100%), 1fr)); }
.cp-page    { width: 100%; max-width: var(--content-max); margin-inline: auto; padding: var(--space-lg) var(--page-gutter) var(--space-3xl); }
.cp-page--wide  { max-width: var(--content-max-wide); }
.cp-page--fluid { max-width: none; }
.cp-section + .cp-section { margin-top: var(--space-xl); }

.cp-sr-only {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.cp-skip-link { position: absolute; left: var(--space-md); top: -64px; z-index: var(--z-tooltip); background: var(--color-surface);
  padding: var(--space-xs) var(--space-md); border-radius: var(--radius-md); box-shadow: none; }
.cp-skip-link:focus { top: var(--space-xs); box-shadow: var(--shadow-md), var(--shadow-focus); }

/* ---------- Ícones ---------- */
.cp-icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75;
           stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.cp-icon--16 { width: 16px; height: 16px; }
.cp-icon--18 { width: 18px; height: 18px; }
.cp-icon--24 { width: 24px; height: 24px; }

/* ---------- Movimento ---------- */
@keyframes cp-spin { to { transform: rotate(360deg); } }
@keyframes cp-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cp-rise-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes cp-shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}
