:root {
  --green: #00cc55;
  --green-dark: #006633;
  --green-dim: rgba(0,200,80,.15);
  --bg: #0a0f0b;
  --surface: rgba(8,24,12,.85);
  --border: rgba(0,200,80,.18);
  --text: #e8f5ee;
  --text-dim: rgba(232,245,238,.55);
  --code-bg: rgba(0,0,0,.5);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: "Segoe UI", system-ui, sans-serif; line-height: 1.65; }

/* ── Fundo ── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(0,180,80,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,180,80,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

/* ── Layout ── */
.wrapper { position: relative; z-index: 1; display: flex; min-height: 100vh; }

/* ── Sidebar ── */
nav.sidebar {
  width: 260px; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: rgba(4,14,7,.92);
  border-right: 1px solid var(--border);
  padding: 32px 0;
  backdrop-filter: blur(12px);
}
.sidebar-brand {
  padding: 0 24px 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.sidebar-brand a { text-decoration: none; }
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.3rem; font-weight: 900; color: #fff;
  letter-spacing: .04em;
}
.sidebar-logo .dot { color: var(--green); }
.sidebar-tag {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; color: var(--green); margin-top: 3px;
  display: block;
}
nav.sidebar ul { list-style: none; padding: 0 12px; }
nav.sidebar ul li a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px; border-radius: 8px;
  color: var(--text-dim); text-decoration: none; font-size: .875rem;
  transition: background .15s, color .15s;
}
nav.sidebar ul li a:hover, nav.sidebar ul li a.active {
  background: var(--green-dim); color: var(--green);
}
nav.sidebar ul li a i { width: 16px; text-align: center; font-size: .8rem; }
.sidebar-section {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; color: rgba(0,200,80,.4);
  padding: 16px 24px 6px;
}
.sidebar-back {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 24px; margin-top: 20px; border-top: 1px solid var(--border);
  color: var(--text-dim); font-size: .82rem; text-decoration: none;
  transition: color .15s;
}
.sidebar-back:hover { color: var(--green); }

/* ── Conteúdo ── */
main { flex: 1; padding: 48px 60px; max-width: 900px; }

.page-header { margin-bottom: 48px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.page-header h1 {
  font-size: 2rem; font-weight: 900; color: #fff;
  text-shadow: 0 0 40px rgba(0,200,80,.3);
  margin-bottom: 10px;
}
.page-header p { color: var(--text-dim); font-size: 1rem; max-width: 600px; }
.badge-oidc {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green-dim); border: 1px solid var(--border);
  color: var(--green); font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  padding: 4px 12px; border-radius: 20px; margin-bottom: 16px;
}

/* seções */
section { margin-bottom: 56px; }
section h2 {
  font-size: 1.25rem; font-weight: 800; color: #fff;
  border-left: 3px solid var(--green); padding-left: 14px;
  margin-bottom: 20px;
}
section h3 {
  font-size: 1rem; font-weight: 700; color: rgba(0,220,100,.9);
  margin: 24px 0 10px;
}
section p { color: var(--text-dim); margin-bottom: 12px; font-size: .94rem; }
section p strong { color: var(--text); }

/* tabelas */
table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: .875rem; }
th { background: rgba(0,180,80,.1); color: var(--green); font-weight: 700; text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
td { padding: 10px 14px; border-bottom: 1px solid rgba(0,200,80,.07); color: var(--text-dim); vertical-align: top; }
td:first-child { color: var(--text); font-family: 'Courier New', monospace; font-size: .82rem; white-space: nowrap; }
tr:last-child td { border-bottom: none; }

/* código */
pre {
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px 24px; overflow-x: auto;
  margin: 14px 0; position: relative;
}
pre code { font-family: 'Courier New', Consolas, monospace; font-size: .83rem; color: #a8e6bf; line-height: 1.6; }
code { font-family: 'Courier New', Consolas, monospace; font-size: .82rem; background: rgba(0,0,0,.4); color: #7dd9a3; padding: 2px 6px; border-radius: 4px; }
pre code { background: none; padding: 0; }

/* copy button */
.code-wrap { position: relative; }
.copy-btn {
  position: absolute; top: 12px; right: 12px;
  background: rgba(0,180,80,.15); border: 1px solid var(--border);
  color: var(--green); font-size: .72rem; font-weight: 700;
  padding: 4px 10px; border-radius: 6px; cursor: pointer;
  transition: background .15s;
}
.copy-btn:hover { background: rgba(0,180,80,.3); }

/* fluxo */
.flow {
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px 28px;
  font-family: 'Courier New', monospace; font-size: .82rem;
  color: #7dd9a3; line-height: 2;
}

/* endpoint cards */
.endpoint-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.endpoint-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 18px;
}
.endpoint-card .method { font-size: .68rem; font-weight: 700; text-transform: uppercase; color: var(--green); letter-spacing: .1em; margin-bottom: 4px; }
.endpoint-card .path { font-family: 'Courier New', monospace; font-size: .82rem; color: var(--text); margin-bottom: 6px; }
.endpoint-card .desc { font-size: .78rem; color: var(--text-dim); }

/* callout */
.callout {
  display: flex; gap: 12px; align-items: flex-start;
  background: rgba(0,180,80,.08); border: 1px solid rgba(0,200,80,.25);
  border-radius: 10px; padding: 14px 18px; margin: 16px 0; font-size: .88rem;
}
.callout i { color: var(--green); margin-top: 2px; flex-shrink: 0; }
.callout p { color: var(--text-dim); margin: 0; }
.callout.warn { background: rgba(220,150,0,.08); border-color: rgba(220,170,0,.25); }
.callout.warn i { color: #f59e0b; }

/* scope pills */
.scope-pill {
  display: inline-block; background: rgba(0,180,80,.12);
  border: 1px solid rgba(0,200,80,.25); color: var(--green);
  font-size: .72rem; font-weight: 700; padding: 3px 10px;
  border-radius: 20px; margin: 2px;
}

/* lang tabs */
.tabs { display: flex; gap: 8px; margin-bottom: -1px; flex-wrap: wrap; }
.tab-btn {
  background: rgba(0,0,0,.3); border: 1px solid var(--border);
  border-bottom: none; color: var(--text-dim); font-size: .8rem;
  font-weight: 600; padding: 8px 16px; border-radius: 8px 8px 0 0;
  cursor: pointer; transition: background .15s, color .15s;
}
.tab-btn.active { background: var(--code-bg); color: var(--green); border-color: var(--border); }
.tab-content { display: none; }
.tab-content.active { display: block; }

@media (max-width: 900px) {
  .wrapper { flex-direction: column; }
  nav.sidebar { width: 100%; height: auto; position: relative; }
  main { padding: 32px 24px; }
  .endpoint-grid { grid-template-columns: 1fr; }
}