/* Documentação da API (/docs): por cima do site.css.
   Base preto e branco do DS Uneway; vidro só na navegação (header e índice lateral).
   Conteúdo em superfície lisa, código em bloco escuro com realce discreto,
   avisos com ícone + palavra. */

@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/docs/JetBrainsMono-latin-400.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
:root {
  --font-mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --code-bg: #0b0c0e;
  --code-head: #131418;
  --code-line: rgba(255, 255, 255, .08);
  --code-text: #e8eaed;
  --tk-com: #7d8590;
  --tk-str: #a8d8b9;
  --tk-num: #f2c18d;
  --tk-key: #9ec5ff;
  --tk-kw: #ffffff;
  --tk-flag: #c9b6ff;
  --info: #5b9dff; --info-bg: rgba(91, 157, 255, .09);
  --tip: #34c26a; --tip-bg: rgba(52, 194, 106, .09);
  --warn: #f59a2a; --warn-bg: rgba(245, 154, 42, .10);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --info: #1f6fe0; --info-bg: rgba(31, 111, 224, .07);
    --tip: #18884a; --tip-bg: rgba(24, 136, 74, .07);
    --warn: #b86400; --warn-bg: rgba(184, 100, 0, .08);
  }
}
:root[data-theme="light"] {
  --info: #1f6fe0; --info-bg: rgba(31, 111, 224, .07);
  --tip: #18884a; --tip-bg: rgba(24, 136, 74, .07);
  --warn: #b86400; --warn-bg: rgba(184, 100, 0, .08);
}

/* ---------- moldura ---------- */
.docs-head { padding: 40px 0 8px; }
@media (min-width: 720px) { .docs-head { padding: 64px 0 12px; } }
.docs-head .eyebrow { display: inline-flex; align-items: center; height: 26px; padding: 0 12px; border: 1px solid var(--hairline); border-radius: 999px; font-size: 12px; font-weight: 500; letter-spacing: .02em; text-transform: none; color: var(--text-2); }
.docs-head h1 { font-family: var(--font-display); font-weight: 500; font-size: clamp(32px, 4.6vw, 52px); line-height: 1.04; letter-spacing: -.03em; margin-top: 16px !important; max-width: 820px; text-wrap: balance; }
.docs-layout { gap: 24px; }
@media (min-width: 960px) { .docs-layout { grid-template-columns: 232px minmax(0, 1fr); gap: 40px; } }
@media (min-width: 1240px) { .docs-layout.has-toc { grid-template-columns: 232px minmax(0, 1fr) 200px; } }
.docs-nav a { font-size: 14.5px; min-height: 40px; }
.docs-nav a[aria-current="page"] { font-weight: 600; }

.docs-content { max-width: 780px; padding: 0; background: none; border: 0; box-shadow: none; }
.docs-content > p:first-child { font-size: 18px; line-height: 1.6; color: var(--text-2); }
.docs-content p, .docs-content li { font-size: 16px; line-height: 1.7; color: var(--text-2); }
.docs-content strong { color: var(--text); font-weight: 600; }
.docs-content h2 { font-family: var(--font-display); font-weight: 500; font-size: 26px; letter-spacing: -.02em; margin: 56px 0 14px; padding-top: 28px; border-top: 1px solid var(--divider); }
.docs-content h2:first-child { border-top: 0; padding-top: 0; }
.docs-content h3 { font-size: 18px; font-weight: 600; margin: 32px 0 10px; scroll-margin-top: 96px; }
.docs-content ol, .docs-content ul { padding-left: 22px; margin: 12px 0; }
.docs-content li + li { margin-top: 6px; }
.docs-content a { color: var(--text); text-decoration: underline; text-decoration-color: var(--hairline); text-underline-offset: 3px; }
.docs-content a:hover { text-decoration-color: currentColor; }
.docs-content a.btn { text-decoration: none; }
.docs-content p code, .docs-content li code, .docs-content td code, .docs-content h3 code { font-size: 13px; padding: 2px 6px; border-radius: 6px; background: var(--fill); border: 1px solid var(--divider); }
.docs-content .caption { font-size: 13px; color: var(--text-3); margin-top: 14px; }

/* ---------- índice "nesta página" ---------- */
.docs-toc { display: none; }
@media (min-width: 1240px) {
  .docs-toc { display: block; position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow-y: auto; font-size: 13px; }
  .docs-toc p { margin: 0 0 10px; font-weight: 600; color: var(--text); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
  .docs-toc ul { list-style: none; margin: 0; padding: 0 0 0 12px; border-left: 1px solid var(--divider); display: grid; gap: 8px; }
  .docs-toc a { color: var(--text-3); text-decoration: none; line-height: 1.4; display: block; }
  .docs-toc a:hover, .docs-toc a.is-active { color: var(--text); }
}

/* ---------- blocos de código ---------- */
.cb { margin: 18px 0; border-radius: 14px; background: var(--code-bg); border: 1px solid var(--code-line); overflow: hidden; color-scheme: dark; }
.cb-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 0 8px 0 14px; background: var(--code-head); border-bottom: 1px solid var(--code-line); }
.cb-lang { font: 500 12px var(--font-sans); color: #9aa1a9; letter-spacing: .02em; }
.copy-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; background: transparent; color: #c9ced4; font: 500 12px var(--font-sans); cursor: pointer; }
.copy-btn:hover { background: rgba(255,255,255,.06); color: #fff; }
.copy-btn svg { width: 14px; height: 14px; }
.copy-btn.is-done { color: #7fe0a3; border-color: rgba(127,224,163,.4); }
.docs-content .cb pre.code, .cb pre.code { margin: 0; border: 0; border-radius: 0; background: none; padding: 16px 18px; font-size: 13px; line-height: 1.65; color: var(--code-text); overflow-x: auto; white-space: pre; tab-size: 2; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
.tk-c { color: var(--tk-com); font-style: italic; }
.tk-s { color: var(--tk-str); }
.tk-n { color: var(--tk-num); }
.tk-k { color: var(--tk-key); }
.tk-w { color: var(--tk-kw); font-weight: 600; }
.tk-f { color: var(--tk-flag); }

/* abas de código (Node / PHP / curl) */
.code-tabs { margin: 18px 0; display: block; }
.code-tabs details { background: none; border-radius: 0; }
.code-tabs.is-tabbed { border-radius: 14px; border: 1px solid var(--code-line); background: var(--code-bg); overflow: hidden; color-scheme: dark; }
.code-tabs.is-tabbed details { display: none; }
.code-tabs.is-tabbed details.is-on { display: block; }
.code-tabs.is-tabbed summary { display: none; }
.code-tabs.is-tabbed .cb { margin: 0; border: 0; border-radius: 0; }
.code-tabs.is-tabbed .cb-lang { display: none; }
.code-tabs.is-tabbed .cb-head { position: absolute; right: 0; top: 0; background: none; border: 0; }
.code-tabs.is-tabbed { position: relative; }
.ct-list { display: flex; gap: 2px; padding: 6px 110px 0 8px; background: var(--code-head); border-bottom: 1px solid var(--code-line); overflow-x: auto; }
.ct-list button { height: 34px; padding: 0 12px; border: 0; background: none; color: #9aa1a9; font: 500 13px var(--font-sans); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.ct-list button[aria-selected="true"] { color: #fff; border-bottom-color: #fff; }
.code-tabs:not(.is-tabbed) details { margin-bottom: 8px; }
.code-tabs:not(.is-tabbed) summary { font-size: 13px; color: var(--text-2); min-height: 32px; padding: 0; }

/* ---------- avisos ---------- */
.callout { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 12px; margin: 20px 0; padding: 14px 16px; border-radius: 12px; border: 1px solid transparent; }
.callout > svg { width: 20px; height: 20px; margin-top: 3px; }
.callout p, .callout li { font-size: 15px; line-height: 1.6; margin: 0; }
.callout p + p { margin-top: 6px; }
.callout .callout-word { font-weight: 600; margin-right: 4px; }
.callout-info { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.callout-info > svg, .callout-info .callout-word { color: var(--info); }
.callout-tip { background: var(--tip-bg); border-color: color-mix(in srgb, var(--tip) 25%, transparent); }
.callout-tip > svg, .callout-tip .callout-word { color: var(--tip); }
.callout-warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 28%, transparent); }
.callout-warn > svg, .callout-warn .callout-word { color: var(--warn); }

/* ---------- passos numerados ---------- */
ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 24px 0; display: grid; gap: 0; }
ol.steps > li { counter-increment: step; position: relative; padding: 0 0 28px 52px; margin: 0; }
ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--cta-bg); color: var(--cta-text); font: 600 14px var(--font-sans); }
ol.steps > li::after { content: ""; position: absolute; left: 15.5px; top: 38px; bottom: 6px; width: 1px; background: var(--hairline); }
ol.steps > li:last-child { padding-bottom: 0; }
ol.steps > li:last-child::after { display: none; }
ol.steps > li > strong:first-child { display: block; font-size: 17px; color: var(--text); margin: 4px 0 4px; }

/* ---------- 3 palavras (definições) ---------- */
.terms { display: grid; gap: 10px; margin: 18px 0; }
@media (min-width: 720px) { .terms { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.terms > div { padding: 16px; border-radius: 12px; border: 1px solid var(--divider); background: var(--fill); }
.terms h3 { margin: 0 0 6px !important; font-size: 15px !important; }
.terms p { font-size: 14px !important; line-height: 1.55 !important; margin: 0; }

/* ---------- fluxo (diagrama simples) ---------- */
.flow { display: grid; gap: 8px; margin: 22px 0; padding: 0; list-style: none; }
@media (min-width: 720px) { .flow { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.flow li { margin: 0 !important; padding: 14px; border-radius: 12px; border: 1px solid var(--divider); font-size: 14px !important; line-height: 1.45 !important; position: relative; }
.flow li b { display: block; font-size: 12px; color: var(--text-3); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 4px; }
.flow li strong { display: block; }

/* ---------- caixa do prompt para a IA ---------- */
.ai-prompt { margin: 20px 0; border-radius: 16px; border: 1px solid var(--hairline); background: var(--surface); overflow: hidden; }
.ai-prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--divider); }
.ai-prompt-head span { font-weight: 600; font-size: 14px; color: var(--text); }
.ai-prompt .copy-btn { background: var(--cta-bg); color: var(--cta-text); border-color: transparent; height: 32px; padding: 0 14px; font-size: 13px; }
.ai-prompt .copy-btn:hover { opacity: .88; background: var(--cta-bg); color: var(--cta-text); }
.ai-prompt .copy-btn.is-done { color: var(--cta-text); }
.ai-prompt pre { margin: 0; padding: 16px; font: 14px/1.65 var(--font-sans); white-space: pre-wrap; color: var(--text-2); background: none; }

/* ---------- integrações ---------- */
.integ { display: grid; gap: 10px; margin: 18px 0; }
@media (min-width: 720px) { .integ { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.integ > div { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: start; padding: 16px; border-radius: 12px; border: 1px solid var(--divider); }
.integ img, .integ .integ-mark { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--fill); }
.integ .integ-mark svg { width: 22px; height: 22px; color: var(--text-2); }
.integ h3 { margin: 0 0 4px !important; font-size: 16px !important; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.integ p { font-size: 14px !important; margin: 0; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--fill-strong); color: var(--text-2); }
.pill-ok { background: var(--tip-bg); color: var(--tip); }

/* listas especiais sem o recuo padrão do .docs-content */
.docs-content ol.flow, .docs-content ol.steps { padding-left: 0; }
.flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .flow { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* tabelas */
.docs-content .table-wrap { border: 1px solid var(--divider); border-radius: 12px; overflow-x: auto; }
.docs-content table.dtable th { background: var(--fill); }
.docs-content table.dtable tr:last-child td { border-bottom: 0; }
