/* ============================================================
   Base: reset, tipografia, botões, rótulos, a11y, textura
   ============================================================ */

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

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

body {
  margin: 0;
  font-family: var(--ui);
  font-size: var(--fs-16);
  line-height: 1.6;
  color: var(--ink);
  background: var(--c50);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 var(--sp-4);
  color: var(--g900);
  text-wrap: balance;
}

p { margin: 0 0 var(--sp-4); }

a { color: var(--t700); }

::selection { background: var(--g900); color: var(--c50); }

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: var(--radius-sm);
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--g900);
  color: var(--c50);
  padding: var(--sp-3) var(--sp-6);
  border-radius: 0 0 var(--radius-md) 0;
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus-visible { left: 0; }

/* Textura: ruído SVG fractalNoise fixo na página inteira (anti-flat) */
.noise {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Layout */
.container {
  width: min(1200px, 100% - clamp(2rem, 6vw, 6rem));
  margin-inline: auto;
}

.section { padding-block: var(--space-section); }

/* Aterrissagem de âncoras (deep-link de anúncio, ex.: /#cadastro):
   a seção nunca fica escondida atrás da nav fixa */
section[id], aside[id] {
  scroll-margin-top: calc(var(--nav-h) + 8px);
}

/* Caps label — eco do descritor da marca */
.caps-label {
  font-family: var(--ui);
  font-size: var(--fs-12);
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 52px;
  padding: var(--sp-3) var(--sp-8);
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  font-family: var(--ui);
  font-size: var(--fs-16);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              background-color var(--dur) var(--ease),
              color var(--dur) var(--ease);
}
.btn:focus-visible { box-shadow: var(--focus); }

.btn-primary {
  background: var(--t500);
  color: #fff;
}
.btn-primary:hover {
  background: var(--t600);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.btn-primary:active { transform: translateY(-1px); }

/* Shine diagonal em loop 3.6s */
.btn-primary::after {
  content: "";
  position: absolute;
  top: -60%;
  bottom: -60%;
  width: 34%;
  left: -60%;
  transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent);
  animation: btn-shine 3.6s var(--ease) infinite;
}
@keyframes btn-shine {
  0%, 55% { left: -60%; }
  85%, 100% { left: 130%; }
}

.btn-outline {
  background: transparent;
  color: var(--g900);
  border-color: var(--g700);
}
.btn-outline:hover {
  background: var(--g900);
  color: var(--c50);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.btn-light {
  background: var(--c50);
  color: var(--g900);
}
.btn-light:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Sistema de rótulos (nomes explícitos) ---------- */

/* status badge: ponto + texto, nunca pílula pastel */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--g900);
}
.status-badge .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}
.status-badge .meta { color: var(--gray6); font-weight: 400; }
.dot-live { background: var(--success); animation: dot-pulse 1.8s ease-out infinite; }
.dot-transit { background: var(--warning); animation: dot-pulse 1.8s ease-out infinite; }
.dot-consult { background: transparent; border: 2px solid var(--gray3); }
.dot-off { background: var(--error); }
@keyframes dot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(62, 122, 68, .45); }
  70% { box-shadow: 0 0 0 8px rgba(62, 122, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 122, 68, 0); }
}

/* tag de categoria: metadado com ícone */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--g100);
  border-radius: 6px;
  font-size: var(--fs-12);
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--g700);
  background: var(--g50);
}
.tag svg { width: 13px; height: 13px; stroke-width: 2; }

/* carimbo: assinatura de marca — SÓ superfícies de marketing */
.stamp {
  display: inline-block;
  padding: 6px 14px;
  border: 1.5px solid currentColor;
  border-radius: var(--radius-sm);
  position: relative;
  transform: rotate(-2deg);
  font-family: var(--ui);
  font-size: var(--fs-12);
  font-weight: 700;
  letter-spacing: var(--track-stamp);
  text-transform: uppercase;
  color: var(--t600);
}
.stamp::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px dashed currentColor;
  border-radius: 2px;
  opacity: .7;
}
.stamp-green { color: var(--success); }

/* filter chip (interativo) */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: 8px 16px;
  border: 1.5px solid var(--g300);
  border-radius: 999px;
  background: transparent;
  font-family: var(--ui);
  font-size: var(--fs-14);
  font-weight: 500;
  color: var(--g900);
  cursor: pointer;
  transition: background-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}
.chip:hover { border-color: var(--g700); }
.chip[aria-pressed="true"] {
  background: var(--g900);
  border-color: var(--g900);
  color: var(--c50);
}

/* Grifo animado: pincelada terracota que ACOMPANHA a quebra de linha
   (background em vez de ::after; box-decoration-break pinta cada linha) */
.hl {
  background-image: linear-gradient(var(--t100), var(--t100));
  background-repeat: no-repeat;
  background-position: 0 86%;
  background-size: calc(var(--hl, 0) * 100%) .32em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background-size .9s var(--ease);
}
.hl-dark {
  background-image: linear-gradient(
    color-mix(in srgb, var(--t600) 85%, transparent),
    color-mix(in srgb, var(--t600) 85%, transparent));
}
.hl-hero { transition-delay: .75s; }
.hl-hero2 { transition-delay: 1.5s; } /* segunda pincelada, em sequência */

/* Utilidades */
.text-center { text-align: center; }
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Reduced motion: base */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn-primary::after { animation: none; display: none; }
  .dot-live, .dot-transit { animation: none; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
