/* ClicaFala Docs — cores do manual de identidade (índigo = interação; lima = SÓ sucesso; Zinc nos neutros).
   Todas as cores ficam nestes tokens; nada de hex solto nas regras abaixo. */
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url("fontes/poppins-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-display: swap; src: url("fontes/poppins-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url("fontes/inter-latin.woff2") format("woff2"); }

:root {
  --indigo: #4F46E5; --indigo-escuro: #3730A3; --indigo-claro: #818CF8;
  --lima: #84CC16; --lima-700: #4D7C0F; --grafite: #111418;
  --ambar: #F59E0B; --ambar-700: #B45309; --vermelho: #E5484D; --vermelho-700: #B42318; --ceu: #0EA5E9; --ceu-700: #0369A1;
  --fundo: #FFFFFF; --fundo-2: #F4F4F5; --fundo-3: #E4E4E7; --linha: #E4E4E7; --texto: #18181B; --texto-2: #52525B;
  --link: #4338CA; --codigo-fundo: #F4F4F5; --realce: rgba(79, 70, 229, .08); --sombra: 0 8px 30px rgba(0, 0, 0, .10);
  --nota: var(--ceu-700); --dica: var(--lima-700); --atencao: var(--ambar-700); --importante: var(--vermelho-700);
  --futuro: #52525B; --experip: var(--indigo-escuro);
  --fonte: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --fonte-titulo: "Poppins", var(--fonte);
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fundo: #09090B; --fundo-2: #18181B; --fundo-3: #27272A; --linha: #27272A; --texto: #F4F4F5; --texto-2: #A1A1AA;
    --link: #A5B4FC; --codigo-fundo: #18181B; --realce: rgba(129, 140, 248, .12); --sombra: 0 8px 30px rgba(0, 0, 0, .5);
    --nota: #38BDF8; --dica: var(--lima); --atencao: #FBBF24; --importante: #F87171; --futuro: #A1A1AA; --experip: var(--indigo-claro);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fundo: #09090B; --fundo-2: #18181B; --fundo-3: #27272A; --linha: #27272A; --texto: #F4F4F5; --texto-2: #A1A1AA;
  --link: #A5B4FC; --codigo-fundo: #18181B; --realce: rgba(129, 140, 248, .12); --sombra: 0 8px 30px rgba(0, 0, 0, .5);
  --nota: #38BDF8; --dica: var(--lima); --atencao: #FBBF24; --importante: #F87171; --futuro: #A1A1AA; --experip: var(--indigo-claro);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fundo); color: var(--texto); font: 16px/1.65 var(--fonte); overflow-x: hidden; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--indigo); }
:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pular { position: absolute; left: -999px; top: 0; background: var(--indigo); color: #fff; padding: .5rem 1rem; z-index: 100; }
.pular:focus { left: 1rem; top: .5rem; }

/* topo */
.topo { position: sticky; top: 0; z-index: 30; background: var(--fundo); border-bottom: 1px solid var(--linha); }
.topo-int { display: flex; align-items: center; gap: 1rem; max-width: 1440px; margin: 0 auto; padding: .6rem 1rem; }
.marca { display: flex; align-items: center; gap: .5rem; text-decoration: none; flex: none; }
.logo { height: 30px; width: auto; display: block; }
.logo-escuro { display: none; }
:root[data-theme="dark"] .logo-claro { display: none; }
:root[data-theme="dark"] .logo-escuro { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-claro { display: none; }
  :root:not([data-theme="light"]) .logo-escuro { display: block; }
}
.marca-docs { font: 600 .95rem var(--fonte-titulo); color: var(--texto-2); border-left: 1px solid var(--linha); padding-left: .5rem; }
.busca { position: relative; flex: 1; max-width: 520px; margin-left: auto; }
.busca input { width: 100%; font: inherit; font-size: 16px; padding: .45rem .8rem; border-radius: 8px; border: 1px solid var(--linha);
  background: var(--fundo-2); color: var(--texto); }
.busca-resultados { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--fundo); border: 1px solid var(--linha);
  border-radius: 10px; box-shadow: var(--sombra); max-height: 70vh; overflow: auto; padding: .3rem; }
.busca-resultados a { display: block; padding: .5rem .7rem; border-radius: 8px; text-decoration: none; color: var(--texto); }
.busca-resultados a[aria-selected="true"], .busca-resultados a:hover { background: var(--realce); }
.busca-resultados .r-sec { font-size: .78rem; color: var(--texto-2); }
.busca-resultados .r-tit { font-weight: 600; display: block; }
.busca-resultados .r-trecho { font-size: .85rem; color: var(--texto-2); display: block; }
.busca-resultados .vazio { padding: .7rem; color: var(--texto-2); }
.botao-tema, .botao-menu { flex: none; background: none; border: 1px solid var(--linha); border-radius: 8px; color: var(--texto);
  width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer; }
.botao-tema svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.icone-lua { display: none; }
:root[data-theme="dark"] .icone-sol { display: none; }
:root[data-theme="dark"] .icone-lua { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icone-sol { display: none; }
  :root:not([data-theme="light"]) .icone-lua { display: block; }
}
.botao-menu { display: none; gap: 4px; align-content: center; }
.botao-menu span { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }
.faixa-staging { background: var(--fundo-3); color: var(--texto-2); text-align: center; font-size: .82rem; padding: .25rem 1rem; }

/* corpo em 3 colunas: menu · artigo · índice */
.corpo { display: grid; grid-template-columns: 270px minmax(0, 1fr) 220px; max-width: 1440px; margin: 0 auto; }
.lateral { position: sticky; top: 57px; align-self: start; height: calc(100vh - 57px); overflow: auto; padding: 1rem .75rem 3rem 1rem;
  border-right: 1px solid var(--linha); }
.menu-secao { margin-bottom: .15rem; }
.menu-secao summary { cursor: pointer; font: 600 .92rem var(--fonte-titulo); padding: .35rem .5rem; border-radius: 6px; list-style: none; }
.menu-secao summary::-webkit-details-marker { display: none; }
.menu-secao summary::before { content: "▸"; display: inline-block; width: 1em; color: var(--texto-2); transition: transform .15s; }
.menu-secao[open] summary::before { transform: rotate(90deg); }
.menu-secao summary:hover { background: var(--fundo-2); }
.menu ul { list-style: none; margin: .1rem 0 .5rem; padding: 0 0 0 1rem; }
.menu li a { display: block; padding: .22rem .6rem; border-radius: 6px; color: var(--texto-2); text-decoration: none; font-size: .9rem; line-height: 1.4; }
.menu li a:hover { color: var(--texto); background: var(--fundo-2); }
.menu li a[aria-current="page"] { color: var(--link); background: var(--realce); font-weight: 600; }
.principal { min-width: 0; padding: 1.5rem 2.5rem 3rem; }
.artigo { max-width: 780px; }
.toc { position: sticky; top: 57px; align-self: start; max-height: calc(100vh - 57px); overflow: auto; padding: 1.6rem 1rem; font-size: .85rem; }
.toc-titulo { font-weight: 600; margin: 0 0 .4rem; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--linha); }
.toc li a { display: block; padding: .18rem .7rem; color: var(--texto-2); text-decoration: none; }
.toc li.toc-h3 a { padding-left: 1.4rem; }
.toc li a.ativo { color: var(--link); border-left: 2px solid var(--indigo); margin-left: -1px; }

/* cabeçalho da página */
.migalhas ol { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; padding: 0; margin: 0 0 .6rem; font-size: .85rem; color: var(--texto-2); }
.migalhas li + li::before { content: "›"; margin-right: .3rem; }
.migalhas a { color: var(--texto-2); }
.pag-cab { max-width: 780px; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--linha); }
h1, h2, h3, h4 { font-family: var(--fonte-titulo); font-weight: 600; line-height: 1.25; scroll-margin-top: 5rem; }
h1 { font-size: 2.05rem; margin: 0 0 .4rem; font-weight: 700; }
.pag-desc { font-size: 1.1rem; color: var(--texto-2); margin: 0 0 .7rem; }
.nivel { display: inline-block; font-size: .78rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; border: 1px solid var(--linha);
  color: var(--texto-2); background: var(--fundo-2); }
.nivel-avancado { color: var(--nota); border-color: currentColor; background: transparent; }
.nivel-tecnico { color: var(--texto); border-color: var(--texto-2); background: var(--fundo-3); }
.artigo h2 { font-size: 1.45rem; margin: 2.2rem 0 .7rem; padding-top: .3rem; }
.artigo h3 { font-size: 1.15rem; margin: 1.6rem 0 .5rem; }
.ancora { opacity: 0; text-decoration: none; margin-left: .3rem; color: var(--texto-2); font-weight: 400; }
h2:hover .ancora, h3:hover .ancora, .ancora:focus { opacity: 1; }
.artigo p, .artigo li { max-width: 72ch; }
.artigo ul, .artigo ol { padding-left: 1.4rem; }
.artigo li { margin: .2rem 0; }
.artigo hr { border: 0; border-top: 1px solid var(--linha); margin: 2rem 0; }
.artigo img { border: 1px solid var(--linha); border-radius: 10px; margin: .5rem 0; box-shadow: var(--sombra); }
code { font-family: var(--mono); font-size: .88em; background: var(--codigo-fundo); padding: .1em .35em; border-radius: 5px; border: 1px solid var(--linha);
  overflow-wrap: anywhere; }
.codigo { border: 1px solid var(--linha); border-radius: 10px; margin: 1rem 0; overflow: hidden; background: var(--codigo-fundo); }
.codigo-cab { display: flex; justify-content: space-between; align-items: center; padding: .3rem .4rem .3rem .8rem; font-size: .75rem;
  color: var(--texto-2); border-bottom: 1px solid var(--linha); }
.copiar { font: inherit; font-size: .75rem; background: var(--fundo); color: var(--texto); border: 1px solid var(--linha); border-radius: 6px;
  padding: .15rem .55rem; cursor: pointer; }
.copiar.ok { color: var(--dica); border-color: currentColor; }
.codigo pre { margin: 0; padding: .8rem 1rem; overflow-x: auto; font-size: .85rem; line-height: 1.55; }
.codigo pre code { background: none; border: 0; padding: 0; font-size: inherit; overflow-wrap: normal; }
.tabela { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--linha); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; padding: .5rem .75rem; border-bottom: 1px solid var(--linha); vertical-align: top; }
th { background: var(--fundo-2); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

/* callouts */
.callout { border: 1px solid var(--linha); border-left: 4px solid var(--c, var(--nota)); background: var(--fundo-2); border-radius: 8px;
  padding: .7rem 1rem; margin: 1.1rem 0; }
.callout > :last-child { margin-bottom: 0; }
.callout > p { margin: .35rem 0; }
.callout-titulo { font-weight: 700; color: var(--c, var(--nota)); margin: 0 0 .2rem !important; font-size: .88rem; text-transform: uppercase; letter-spacing: .03em; }
.callout-nota { --c: var(--nota); } .callout-dica { --c: var(--dica); } .callout-atencao { --c: var(--atencao); }
.callout-importante { --c: var(--importante); } .callout-futuro { --c: var(--futuro); border-left-style: dashed; }
.callout-confirmar { --c: var(--atencao); border-left-style: dashed; } .callout-experip { --c: var(--experip); }

/* fluxos (diagramas simples) */
.fluxo { display: flex; flex-wrap: wrap; align-items: stretch; gap: .4rem; margin: 1.2rem 0; }
.fluxo-passo { flex: 1 1 130px; border: 1px solid var(--linha); background: var(--fundo-2); border-radius: 10px; padding: .6rem .7rem;
  display: flex; flex-direction: column; justify-content: center; text-align: center; min-width: 120px; }
.fluxo-passo.destaque { border-color: var(--indigo); background: var(--realce); }
.fluxo-titulo { font-weight: 600; font-size: .93rem; }
.fluxo-detalhe { font-size: .78rem; color: var(--texto-2); margin-top: .15rem; }
.fluxo-seta { flex: 0 0 18px; align-self: center; height: 2px; background: var(--texto-2); position: relative; }
.fluxo-seta::after { content: ""; position: absolute; right: -1px; top: -4px; border: 5px solid transparent; border-left-color: var(--texto-2); border-right: 0; }

/* cartões (home e índices) */
.cartoes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem; margin: 1rem 0 1.5rem; padding: 0; list-style: none; }
.artigo ul.cartoes { padding: 0; }
.cartoes li { max-width: none; margin: 0; }
.cartoes a { display: block; height: 100%; border: 1px solid var(--linha); border-radius: 12px; padding: .9rem 1rem; text-decoration: none; color: var(--texto);
  background: var(--fundo); transition: border-color .15s, transform .15s; }
.cartoes a:hover { border-color: var(--indigo); transform: translateY(-1px); }
.cartoes strong { display: block; font-family: var(--fonte-titulo); font-weight: 600; margin-bottom: .2rem; color: var(--link); }
.cartoes span { font-size: .88rem; color: var(--texto-2); }

/* home */
.home .artigo { max-width: 1020px; }
.heroi { padding: 1.2rem 0 1.4rem; display: grid; grid-template-columns: 1fr 200px; gap: 2rem; align-items: center; }
.heroi h2 { font-size: 2.2rem; font-weight: 700; margin: 0 0 .6rem; padding: 0; }
.heroi h2 .ancora { display: none; }
.heroi p { font-size: 1.12rem; color: var(--texto-2); }
.heroi img { border: 0; box-shadow: none; }

.navpag { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; max-width: 780px; margin-top: 3rem; }
.navpag a { border: 1px solid var(--linha); border-radius: 10px; padding: .7rem 1rem; text-decoration: none; color: var(--link); font-weight: 600; }
.navpag a span { display: block; font-size: .78rem; color: var(--texto-2); font-weight: 400; }
.navpag .prox { text-align: right; grid-column: 2; }
.navpag a:hover { border-color: var(--indigo); }
.rodape { max-width: 780px; margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--linha); font-size: .82rem; color: var(--texto-2); }
.rodape p { margin: .2rem 0; }

/* telas médias: some o índice lateral */
@media (max-width: 1180px) { .corpo { grid-template-columns: 250px minmax(0, 1fr); } .toc { display: none; } }
/* celular: menu vira gaveta */
@media (max-width: 860px) {
  .corpo { display: block; }
  .botao-menu { display: grid; }
  .marca-docs { display: none; }
  .logo { height: 26px; }
  .lateral { position: fixed; top: 55px; left: 0; bottom: 0; width: min(86vw, 320px); height: auto; align-self: stretch; z-index: 40; background: var(--fundo);
    transform: translateX(-105%); transition: transform .2s; box-shadow: var(--sombra); }
  body.menu-aberto .lateral { transform: none; }
  body.menu-aberto::after { content: ""; position: fixed; inset: 55px 0 0 0; background: rgba(0, 0, 0, .35); z-index: 35; }
  .principal { padding: 1rem 16px 2.5rem; }
  h1 { font-size: 1.6rem; }
  .heroi { grid-template-columns: 1fr; }
  .heroi img { display: none; }
  .heroi h2 { font-size: 1.6rem; }
  .navpag { grid-template-columns: 1fr; }
  .navpag .prox { grid-column: 1; }
  .topo-int { gap: .5rem; padding: .5rem 16px; }
}
@media (max-width: 420px) { .marca .logo { height: 22px; } }
@media print { .topo, .lateral, .toc, .navpag, .faixa-staging { display: none; } .corpo { display: block; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
