/* Turron · Documentação da API de Integração
   Tokens de cor baseados no design system do Turron ERP (global.css) */

:root {
  --brand: #C2451C;
  --brand-strong: #A53A16;
  --brand-soft: #FBEDE7;
  --gold: #E0A63B;
  --gold-soft: #FFDC72;

  --ink: #1C1922;
  --ink-2: #23202B;
  --ink-3: #2F2A38;

  --bg: #F7F8FA;
  --surface: #FFFFFF;
  --surface-2: #F2F3F6;
  --line: #E8E9EE;
  --heading: #1C1922;
  --text: #474A57;
  --text-2: #595D6C;
  --muted: #8A8FA4;

  --code-bg: #1C1922;
  --code-bar: #23202B;
  --code-line: #34303D;
  --code-text: #ECEAF1;
  --code-muted: #9793A3;

  --get: #23845B;
  --post: #C2451C;
  --patch: #B7791A;
  --put: #6653C9;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(28, 25, 34, .04), 0 8px 24px rgba(28, 25, 34, .06);
  --topbar-h: 64px;

  --font: "Albert Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-soft: rgba(194, 69, 28, .16);
    --bg: #1A1720;
    --surface: #211E28;
    --surface-2: #29252F;
    --line: #34303D;
    --heading: #F4F2F7;
    --text: #D1D1D1;
    --text-2: #B9B6C2;
    --muted: #8C8C8C;
    --code-bg: #16141B;
    --code-bar: #1C1922;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --get: #3DBA85;
    --patch: #E0A63B;
    --put: #8E7FF0;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --brand-soft: rgba(194, 69, 28, .16);
  --bg: #1A1720;
  --surface: #211E28;
  --surface-2: #29252F;
  --line: #34303D;
  --heading: #F4F2F7;
  --text: #D1D1D1;
  --text-2: #B9B6C2;
  --muted: #8C8C8C;
  --code-bg: #16141B;
  --code-bar: #1C1922;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --get: #3DBA85;
  --patch: #E0A63B;
  --put: #8E7FF0;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

code {
  font-family: var(--mono);
  font-size: .86em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .1em .4em;
  color: var(--heading);
  overflow-wrap: anywhere;
}

h1, h2, h3, h4 { color: var(--heading); line-height: 1.2; margin: 0; }

svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 8px;
}
.skip:focus { left: 16px; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* ---------------------------------------------------------------- marca */

.mark { width: auto; height: 100%; stroke: none; }
.mark .mark__line { fill: currentColor; }
.mark .mark__accent { fill: var(--brand); }

.brand__word {
  font-weight: 700;
  letter-spacing: .34em;
  font-size: 1.05rem;
  margin-right: -.34em;
}

/* ---------------------------------------------------------------- topo */

.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  background: rgba(28, 25, 34, .92);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  color: #fff;
}

.topbar__inner {
  max-width: 1360px; height: 100%; margin: 0 auto;
  padding: 0 24px;
  display: flex; align-items: center; gap: 16px;
}

.brand {
  display: flex; align-items: center; gap: 10px;
  color: #F7F8FA; height: 30px; margin-right: auto;
}
.brand:hover { text-decoration: none; }
.brand .mark { height: 30px; }
.brand__divider { width: 1px; height: 22px; background: rgba(255, 255, 255, .18); margin: 0 4px; }
.brand__product { font-weight: 500; color: #C9C5D3; font-size: .95rem; }

.topbar__links { display: flex; gap: 4px; }
.topbar__links a {
  color: #C9C5D3; font-size: .92rem; font-weight: 500;
  padding: 6px 12px; border-radius: 8px;
}
.topbar__links a:hover { color: #fff; background: rgba(255, 255, 255, .06); text-decoration: none; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .1); background: transparent;
  color: #E4E1EA; cursor: pointer;
}
.icon-btn:hover { background: rgba(255, 255, 255, .08); }
.topbar__menu { display: none; }

/* ---------------------------------------------------------------- botões */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 .95rem/1 var(--font);
  padding: 13px 20px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer;
  transition: background .15s, transform .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px rgba(194, 69, 28, .35); }
.btn--primary:hover { background: var(--brand-strong); }
.btn--ghost { color: #F4F2F7; border-color: rgba(255, 255, 255, .2); }
.btn--ghost:hover { background: rgba(255, 255, 255, .06); }
.btn--sm { padding: 9px 14px; font-size: .88rem; box-shadow: none; }

/* ---------------------------------------------------------------- hero */

.hero {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--ink) 0%, var(--ink-2) 55%, #2A1A18 100%);
  color: #D9D6E0;
}

.hero__glow {
  position: absolute; inset: auto -10% -60% auto;
  width: 720px; height: 720px; border-radius: 50%;
  background: radial-gradient(circle, rgba(194, 69, 28, .35), rgba(194, 69, 28, 0) 65%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  max-width: 1360px; margin: 0 auto;
  padding: 72px 24px 80px;
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  gap: 48px; align-items: center;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 14px;
  margin: 0 0 18px;
  font-size: .82rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold-soft);
}
.eyebrow span { display: block; width: 34px; height: 2px; background: var(--gold-soft); border-radius: 2px; }

.hero h1 {
  color: #fff;
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  font-weight: 800; letter-spacing: -.02em;
  max-width: 17ch;
}
.hero h1 em { font-style: normal; color: var(--brand); background: linear-gradient(90deg, #E0643A, var(--gold)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.hero__lead { font-size: 1.1rem; max-width: 60ch; margin: 20px 0 30px; color: #C9C5D3; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 32px; }

.baseurl {
  display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap;
  max-width: 100%;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px; padding: 8px 8px 8px 16px;
}
.baseurl__label { font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #9793A3; }
.baseurl__value { background: none; border: 0; padding: 0; color: #fff; font-size: .95rem; }

.hero__art { display: grid; justify-items: center; gap: 24px; }
.hero__mark {
  width: min(300px, 100%); aspect-ratio: 1;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 70%);
  border: 1px solid rgba(255, 255, 255, .06);
  color: #F4F2F7;
}
.hero__mark .mark { height: 62%; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .35)); }
.hero__chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.hero__chips span {
  font: 500 .8rem/1 var(--mono);
  color: #E4E1EA;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .04);
  border-radius: 999px; padding: 8px 12px;
}

/* ---------------------------------------------------------------- layout */

.layout {
  max-width: 1360px; margin: 0 auto;
  display: grid; grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  padding: 32px 16px 48px 24px;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
}

.nav-group + .nav-group { margin-top: 26px; }
.nav-group__title {
  margin: 0 0 8px 10px;
  font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.nav-link {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 8px;
  color: var(--text-2); font-size: .9rem; line-height: 1.35;
  border-left: 2px solid transparent;
  overflow-wrap: anywhere;
}
.nav-link:hover { background: var(--surface-2); color: var(--heading); text-decoration: none; }
.nav-link.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

.nav-method {
  font: 700 .62rem/1 var(--mono); letter-spacing: .02em;
  min-width: 40px; text-align: center;
  padding: 4px 0; border-radius: 4px; color: #fff;
}
.nav-method--get { background: var(--get); }
.nav-method--post { background: var(--post); }
.nav-method--patch { background: var(--patch); }
.nav-method--put { background: var(--put); }

.content { min-width: 0; padding: 40px 48px 64px; }

/* ---------------------------------------------------------------- destaques */

.features {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px;
  margin: -84px 0 56px; position: relative;
}
.feature {
  display: flex; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.feature svg { color: var(--brand); width: 22px; height: 22px; margin-top: 2px; }
.feature strong { color: var(--heading); font-size: .98rem; }
.feature p { margin: 4px 0 0; font-size: .88rem; line-height: 1.5; color: var(--text-2); }

/* ---------------------------------------------------------------- seções */

.doc-section { padding: 8px 0 48px; border-bottom: 1px solid var(--line); margin-bottom: 48px; }
.doc-section:last-of-type { border-bottom: 0; }
.doc-section > p { max-width: 72ch; }

.kicker {
  margin: 0 0 6px;
  font-size: .78rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand);
}
.doc-section h2 { font-size: clamp(1.6rem, 2.6vw, 2rem); font-weight: 800; letter-spacing: -.01em; margin-bottom: 12px; }
.doc-section h3 { font-size: 1.15rem; font-weight: 700; margin: 28px 0 8px; }

/* passos */
.steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 8px; }
.step { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 18px; }
.step__num {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand); color: #fff; font-weight: 800;
  box-shadow: 0 0 0 6px var(--brand-soft);
}
.step__body { padding-bottom: 20px; min-width: 0; }
.step__body h3 { margin: 6px 0 6px; }
.step__body p { margin: 0 0 14px; max-width: 70ch; }

/* cartões */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 24px 0 8px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; display: grid; gap: 2px;
}
.card__value { font-size: 1.35rem; font-weight: 800; color: var(--heading); }
.card__label { font-size: .88rem; color: var(--muted); }

/* listas */
.checklist { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 10px; max-width: 76ch; }
.checklist li { position: relative; padding-left: 30px; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .3em;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23C2451C' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 12px no-repeat;
}

.callout {
  margin: 28px 0 0; padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  background: var(--surface);
}
.callout strong { color: var(--heading); }
.callout p { margin: 4px 0 0; }

/* tabelas */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 16px 0; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { white-space: nowrap; }

/* ---------------------------------------------------------------- postman */

.postman {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px;
  margin: 24px 0 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 24px; box-shadow: var(--shadow);
}
.postman__downloads { display: grid; gap: 12px; align-content: start; }
.download {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; border-radius: var(--radius);
  background: var(--ink); color: #fff;
  border: 1px solid var(--ink);
  transition: transform .15s, box-shadow .15s;
}
.download:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 10px 24px rgba(28, 25, 34, .25); }
.download strong { display: block; font-size: 1rem; }
.download small { display: block; color: #B9B6C2; font-family: var(--mono); font-size: .74rem; overflow-wrap: anywhere; }
.download__icon {
  width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; background: var(--brand); color: #fff;
}
.download--alt { background: var(--surface-2); color: var(--heading); border-color: var(--line); }
.download--alt small { color: var(--muted); }
.download--alt .download__icon { background: var(--surface); color: var(--brand); border: 1px solid var(--line); }

.postman__steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 14px; }
.postman__steps li { counter-increment: step; position: relative; padding-left: 40px; }
.postman__steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: .8rem; font-weight: 800;
  background: var(--brand-soft); color: var(--brand);
}

/* ---------------------------------------------------------------- endpoints */

.endpoint {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  margin-top: 24px;
  box-shadow: var(--shadow);
}
.endpoint__head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.endpoint__path { font-size: 1rem; font-weight: 500; background: none; border: 0; padding: 0; }
.endpoint__title { font-size: 1.25rem; font-weight: 700; margin: 14px 0 4px; }
.endpoint__desc { margin: 4px 0 0; color: var(--text-2); max-width: 76ch; }

.method {
  font: 700 .74rem/1 var(--mono); letter-spacing: .04em;
  padding: 7px 10px; border-radius: 6px; color: #fff;
}
.method--get { background: var(--get); }
.method--post { background: var(--post); }
.method--patch { background: var(--patch); }
.method--put { background: var(--put); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 .76rem/1 var(--mono);
  padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text-2); background: var(--surface-2);
}
.badge svg { width: 13px; height: 13px; }
.badge--scope { color: var(--brand); background: var(--brand-soft); border-color: transparent; }
.badge--open { color: var(--get); }
.badge--idem { color: var(--patch); }

.notes { margin: 14px 0 0; padding-left: 20px; color: var(--text-2); max-width: 80ch; }
.notes li + li { margin-top: 4px; }

.endpoint__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; margin-top: 22px; }
.endpoint__code { display: grid; gap: 14px; align-content: start; min-width: 0; }

.fields__title {
  font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 8px;
}
.fields__title:not(:first-child) { margin-top: 22px; }
.fields { border-top: 1px solid var(--line); }
.field { padding: 12px 0; border-bottom: 1px solid var(--line); }
.field__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.field__name { background: none; border: 0; padding: 0; font-weight: 500; color: var(--heading); font-size: .9rem; }
.field__type { font: .8rem var(--mono); color: var(--muted); }
.field__req { font-size: .72rem; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .06em; }
.field__desc { margin: 4px 0 0; font-size: .9rem; color: var(--text-2); }
.field__rules { margin: 4px 0 0; font-size: .84rem; color: var(--muted); }
.field__rules code { font-size: .78rem; }

/* ---------------------------------------------------------------- código */

.code {
  background: var(--code-bg);
  border: 1px solid var(--code-line);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
}
.code__bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--code-bar);
  border-bottom: 1px solid var(--code-line);
  padding: 8px 8px 8px 16px;
  min-height: 44px;
}
.code__label { font: 500 .78rem/1.3 var(--mono); color: var(--code-muted); margin-right: auto; overflow-wrap: anywhere; }

.tabs { display: flex; gap: 2px; background: rgba(255, 255, 255, .04); border-radius: 8px; padding: 2px; }
.tab {
  font: 600 .76rem/1 var(--font); color: var(--code-muted);
  background: none; border: 0; border-radius: 6px;
  padding: 7px 10px; cursor: pointer;
}
.tab:hover { color: #fff; }
.tab.is-active { background: var(--brand); color: #fff; }

.copy {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 .76rem/1 var(--font);
  color: var(--code-muted); background: transparent;
  border: 1px solid var(--code-line); border-radius: 8px;
  padding: 7px 10px; cursor: pointer;
}
.copy svg { width: 14px; height: 14px; }
.copy:hover { color: #fff; border-color: #4A4555; }
.copy.is-copied { color: var(--gold-soft); border-color: var(--gold); }
.copy--light { color: #E4E1EA; border-color: rgba(255, 255, 255, .15); }

.code pre {
  margin: 0; padding: 16px 18px;
  overflow-x: auto;
  font: .84rem/1.7 var(--mono);
  color: var(--code-text);
  tab-size: 2;
}
.code pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; overflow-wrap: normal; }

.tk-str { color: #F2B37B; }
.tk-key { color: #FFDC72; }
.tk-num { color: #E88A6A; }
.tk-kw { color: #F07C55; font-weight: 500; }
.tk-com { color: #7E7A8C; font-style: italic; }

/* ---------------------------------------------------------------- rodapé */

.footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  padding-top: 28px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .9rem;
}
.footer p { margin: 0; }
.footer__brand { display: flex; align-items: center; gap: 10px; height: 26px; color: var(--heading); }
.footer__brand .mark { height: 26px; }
.footer__brand .brand__word { font-size: .9rem; }

/* ---------------------------------------------------------------- responsivo */

@media (max-width: 1200px) {
  .endpoint__grid { grid-template-columns: minmax(0, 1fr); }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .topbar__links { display: none; }
  .topbar__menu { display: inline-grid; }
  .brand__divider, .brand__product { display: none; }

  .layout { grid-template-columns: minmax(0, 1fr); }

  .sidebar {
    position: fixed; z-index: 40;
    top: var(--topbar-h); left: 0; bottom: 0;
    width: min(320px, 86vw); height: auto;
    background: var(--surface);
    border-right: 1px solid var(--line);
    box-shadow: 12px 0 40px rgba(0, 0, 0, .18);
    transform: translateX(-102%);
    transition: transform .22s ease;
  }
  body.menu-open .sidebar { transform: none; }
  body.menu-open::after {
    content: ""; position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 30;
    background: rgba(12, 10, 16, .45);
  }

  .hero__inner { grid-template-columns: minmax(0, 1fr); padding: 48px 16px 104px; }
  .hero__art { display: none; }
  .content { padding: 32px 16px 56px; }
  .postman { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .topbar__inner { padding: 0 12px; gap: 10px; }
  .topbar__cta span { display: none; }
  .topbar__cta { padding: 9px 11px; }
  .features, .cards { grid-template-columns: minmax(0, 1fr); }
  .endpoint { padding: 20px 16px; }
  .code__bar { flex-wrap: wrap; }
  .baseurl { width: 100%; }
  .baseurl__value { width: 100%; order: 3; }
  .hero__actions .btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
