:root {
  --font-family-base: 'Geist', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --letter-spacing-tight: -0.15px;

  --color-primary: #C08532;
  --color-primary-strong: #A9741C;
  --color-neutral: #F2F1ED;
  --color-surface: #FFFFFF;
  --color-text-main: #111827;
  --color-text-muted: #9CA3AF;
  --color-border-subtle: #E5E7EB;
  --color-success: #16A34A;
  --color-danger: #DC2626;
  --color-mostarda: #D9A520;
  --color-mostarda-fundo: #FBEFC5;
  --color-mostarda-texto: #6E5200;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.08);

  --z-base: 0;
  --z-sticky: 100;
  --z-overlay: 200;
  --z-modal: 300;
  --z-toast: 500;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-family-base);
  letter-spacing: var(--letter-spacing-tight);
  background-color: var(--color-neutral);
  color: var(--color-text-main);
  min-height: 100dvh;
}

h1, h2, h3, .brand { letter-spacing: -0.15px; }

.container-page {
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/* ---------- Navbar ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  backdrop-filter: blur(10px);
  background: rgba(242, 241, 237, 0.85);
  border-bottom: 1px solid var(--color-border-subtle);
}

.nav-link {
  color: var(--color-text-main);
  font-weight: 500;
  font-size: 0.9rem;
  transition: color .2s ease-out;
}
.nav-link:hover { color: var(--color-primary); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border-radius: var(--radius-md);
  padding: 12px 22px;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all .2s ease-out;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(192, 133, 50, 0.25);
}
.btn-primary:hover {
  background: var(--color-primary-strong);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(192, 133, 50, 0.35);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  border: 1.5px solid var(--color-border-subtle);
  color: var(--color-primary-strong);
}
.btn-ghost:hover { background: rgba(192, 133, 50, 0.08); border-color: var(--color-primary); }

/* ---------- Cards ---------- */
.card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--shadow-soft);
}

/* ---------- Valores: card que vira (hover, toque ou teclado) ---------- */
.value-card { height: 9.5rem; perspective: 1000px; outline: none; cursor: pointer; }
.value-card-inner {
  position: relative;
  height: 100%;
  transition: transform .5s ease-out;
  transform-style: preserve-3d;
}
.value-card:hover .value-card-inner,
.value-card:focus .value-card-inner { transform: rotateY(180deg); }
.value-card:focus-visible .value-face { box-shadow: 0 0 0 3px rgba(192, 133, 50, 0.45); }
.value-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  text-align: center;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.value-back {
  transform: rotateY(180deg);
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  line-height: 1.5;
}
@media (prefers-reduced-motion: reduce) {
  .value-card-inner { transition: none; }
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .42s ease-out, transform .42s ease-out;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Hero visual ---------- */
.hero-visual { position: relative; isolation: isolate; }
/* A mancha decorativa sai 2rem para fora do card e gerava rolagem lateral
   (inclusive a 1280px com barra de rolagem). `clip` corta sem criar área de rolagem. */
.hero { overflow-x: clip; }
.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: .35;
  z-index: -1;
}
.pipeline-card { animation: float-y 6s ease-in-out infinite; }
@keyframes float-y {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}
@media (prefers-reduced-motion: reduce) {
  .pipeline-card { animation: none; }
}

/* ---------- Jornada track (horizontal) ---------- */
.track-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-subtle) transparent;
}
.track-scroll::-webkit-scrollbar { height: 8px; }
.track-scroll::-webkit-scrollbar-thumb { background: var(--color-border-subtle); border-radius: 999px; }
.track-item {
  width: 220px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}
.track-item-down { margin-top: 64px; }
/* Mobile: a trilha horizontal vira linha do tempo vertical (sem rolagem lateral).
   O traçado em JS (drawPathRail) segue os badges, então vira uma linha vertical sozinho. */
@media (max-width: 767px) {
  .track { flex-direction: column; gap: 1rem; }
  .track-item { width: 100%; flex-direction: row; align-items: flex-start; gap: 1rem; }
  .track-item > span { margin-bottom: 0; }
  .track-item > .card { flex: 1; }
  .track-item-down { margin-top: 0; }
}

/* ---------- Mobile menu ---------- */
[data-nav-menu].hidden { display: none; }
.nav-link[aria-current="page"] { color: var(--color-primary-strong); }
@media (max-width: 767px) {
  [data-nav-toggle] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
  }
  /* Alvos de toque de ~44px no menu aberto */
  [data-nav-menu] .nav-link { display: block; padding: .6rem 0; font-size: 1rem; }
  [data-nav-menu] .nav-link[aria-current="page"] {
    border-left: 3px solid var(--color-primary);
    padding-left: .75rem;
  }
}

/* Botões longos quebram linha em telas estreitas em vez de estourar a largura */
@media (max-width: 480px) {
  .btn { white-space: normal; text-align: center; }
}

/* ---------- Journey map (Trilha de Formação) ---------- */
.journey-map { overflow-x: auto; padding-bottom: 6px; }
.journey-map-track { min-width: 680px; }
.journey-curve { margin-left: 140px; margin-bottom: 6px; }
.journey-curve svg { width: 100%; height: 48px; display: block; }
.journey-curve-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.journey-curve-labels span:nth-child(2) { text-align: center; }
.journey-curve-labels span:nth-child(3) { text-align: right; }

.journey-row { display: grid; grid-template-columns: 140px repeat(3, 1fr); gap: 12px; align-items: stretch; }
.journey-row + .journey-row { margin-top: 12px; }
.journey-row-label {
  align-self: center;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
}
.journey-cell {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.journey-cell-highlight {
  border-color: var(--color-primary);
  border-width: 1.5px;
  background: rgba(192, 133, 50, 0.04);
}
.journey-row-cta .journey-cell { background: transparent; border: none; padding: 8px 0 0; }
.journey-phase-note { display: none; }

/* Mobile: em vez de uma tabela de 760px com rolagem lateral, cada estágio vira
   um bloco vertical (cabeçalho + linhas + botão). As linhas são reordenadas por
   coluna via `order`, e o rótulo da linha aparece dentro de cada célula (data-label). */
@media (max-width: 767px) {
  .journey-map { overflow: visible; }
  .journey-map-track { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
  .journey-curve { display: none; }
  .journey-row { display: contents; }
  .journey-row > :first-child { display: none; }
  .journey-row > :nth-child(2) { order: 1; }
  .journey-row > :nth-child(3) { order: 2; }
  .journey-row > :nth-child(4) { order: 3; }
  .journey-phases > :nth-child(n+3) { margin-top: 1.75rem; }
  .journey-phase-note { display: block; }
  .journey-cell[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-muted);
  }
}

/* ---------- "Veja também" cross-link card ---------- */
.veja-tambem-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  background: #FEFCE8;
  border: 1.5px solid #FDE047;
  animation: veja-pulse 2.2s ease-in-out infinite;
  transition: transform .2s ease-out, box-shadow .2s ease-out, border-color .2s ease-out;
}
.veja-tambem-card:hover {
  transform: translateY(-3px);
  border-color: #EAB308;
  box-shadow: 0 14px 30px rgba(234, 179, 8, 0.28);
  animation-play-state: paused;
}
.veja-tambem-arrow {
  margin-left: auto;
  font-weight: 700;
  color: #CA8A04;
  flex: none;
  transition: transform .2s ease-out;
}
.veja-tambem-card:hover .veja-tambem-arrow { transform: translateX(5px); }
@keyframes veja-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.4); }
  50% { box-shadow: 0 0 0 9px rgba(250, 204, 21, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .veja-tambem-card { animation: none; }
}

/* ---------- Stage modal rich content ---------- */
.stage-modal-body > * + * { margin-top: 0.9rem; }
.stage-modal-body h4 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-primary-strong);
  padding-top: 0.6rem;
  border-top: 1px solid var(--color-border-subtle);
}
.stage-modal-body > h4:first-child { border-top: none; padding-top: 0; }
.stage-modal-body p { line-height: 1.6; }
.stage-modal-body strong { color: var(--color-text-main); font-weight: 600; }
.stage-modal-body blockquote {
  border-left: 3px solid var(--color-primary);
  padding-left: 1rem;
  font-style: italic;
  color: var(--color-text-main);
}
.stage-modal-body ul { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.stage-modal-body ul li { display: flex; gap: 0.5rem; align-items: flex-start; }
.stage-modal-body ul li svg { flex: none; margin-top: 0.15rem; color: var(--color-success); }
.stage-modal-body .stage-flow {
  background: var(--color-neutral);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  font-size: 0.8rem;
  line-height: 1.9;
}
.stage-modal-body .stage-flow b { color: var(--color-primary-strong); }

/* ---------- Guias Rápidos: item de checklist (toque de 44px, marcado fica riscado) ---------- */
.guia-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  min-height: 44px;
  padding: .6rem 0;
  font-size: .9rem;
  color: rgba(17, 24, 39, .8);
  cursor: pointer;
  border-top: 1px solid var(--color-border-subtle);
}
.guia-item:first-of-type { border-top: none; }
.guia-item input {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: .1rem;
  accent-color: var(--color-success);
}
.guia-item input:checked + span { text-decoration: line-through; opacity: .55; }
.qr-url { display: none; }

/* ---------- Impressão (folha de QR Codes dos Guias) ---------- */
@media print {
  .site-nav, .restrito-nav, footer, .no-print { display: none !important; }
  body { background: #fff; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .card { box-shadow: none; }
  .qr-card { break-inside: avoid; }
  .qr-url { display: block; margin-top: .5rem; }
}

/* Google Tradutor: esconde a barra que ele injeta no topo */
body > .skiptranslate, .goog-te-banner-frame, #goog-gt-tt { display: none !important; }
body { top: 0 !important; }

/* Jornada: etapa final em destaque com borda pulsante */
.track-destaque {
  border: 2px solid var(--color-primary);
  background: rgba(192, 133, 50, 0.08);
  animation: pulso-borda 2s ease-in-out infinite;
}
@keyframes pulso-borda {
  0%, 100% { box-shadow: 0 0 0 0 rgba(192, 133, 50, 0.55); }
  50% { box-shadow: 0 0 0 8px rgba(192, 133, 50, 0); }
}
@media (prefers-reduced-motion: reduce) { .track-destaque { animation: none; } }

/* ---------- Área Restrita: ambiente próprio (cabeçalho escuro, fundo diferente) ---------- */
body.restrito { background: #EAE7E0; }
.restrito-nav { position: sticky; top: 0; z-index: var(--z-sticky); background: var(--color-text-main); color: #fff; }
.restrito-link { color: rgba(255,255,255,.72); font-weight: 500; font-size: .9rem; padding: .45rem .8rem; border-radius: var(--radius-sm); transition: background .2s, color .2s; }
.restrito-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.restrito-link[aria-current="page"] { color: #fff; background: rgba(192,133,50,.28); }
.restrito-nav [data-nav-menu] .restrito-link { display: block; padding: .7rem .8rem; font-size: 1rem; }
.stat-tile { background: var(--color-surface); border: 1px solid var(--color-border-subtle); border-radius: var(--radius-md); padding: 1.25rem; }

/* Usuários: campo sem preenchimento fica mostarda (tabela e ficha) */
.vazio { background: var(--color-mostarda-fundo) !important; color: var(--color-mostarda-texto); }
input.vazio, select.vazio { border-color: var(--color-mostarda) !important; }

/* Tabela larga de usuários: rola na horizontal com a coluna do nome congelada */
.tabela-larga th, .tabela-larga td { white-space: nowrap; padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--color-border-subtle); }
.tabela-larga th:first-child, .tabela-larga td:first-child {
  position: sticky; left: 0; z-index: 1; background: var(--color-surface);
  box-shadow: 1px 0 0 var(--color-border-subtle);
}
.tabela-larga thead th { background: var(--color-surface); }

/* ---------- Aviso de login obrigatório (main.js) ---------- */
.trava-login { width: calc(100% - 32px); margin: auto; }
.trava-login::backdrop { background: rgba(17, 24, 39, 0.6); backdrop-filter: blur(6px); }
