:root {
  --orange: #F37228;
  --orange-soft: rgba(243, 114, 40, 0.12);
  --orange-glow: rgba(243, 114, 40, 0.4);
  --bg: #0a0a0a;
  --bg-soft: #111;
  --bg-card: #161616;
  --border: #232323;
  --text: #f4f4f4;
  --text-dim: #888;
  --text-mute: #666;
  --code-bg: #0d0d0d;
  --code-text: #f8f8f8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: -apple-system, "SF Pro Text", "Inter", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  min-height: 100vh;
}

a { color: var(--orange); text-decoration: none; transition: opacity 0.15s; }
a:hover { opacity: 0.75; }

/* Header */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: 60px;
  display: flex; align-items: center; padding: 0 24px;
}
.topbar-inner {
  max-width: 1400px; width: 100%; margin: 0 auto;
  display: flex; align-items: center; gap: 24px;
}
.brand {
  font-size: 20px; font-weight: 900; color: var(--orange);
  letter-spacing: -0.03em; display: flex; align-items: center; gap: 8px;
}
.brand .badge {
  font-size: 10px; padding: 2px 8px; background: var(--orange);
  color: #000; border-radius: 4px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.nav-tabs {
  display: flex; gap: 4px; flex: 1;
}
.nav-tabs a {
  color: var(--text-dim); font-size: 13px; font-weight: 500;
  padding: 6px 12px; border-radius: 6px;
}
.nav-tabs a:hover { color: var(--text); background: var(--bg-card); opacity: 1; }
.nav-tabs a.active { color: var(--orange); background: var(--orange-soft); }

.lang-toggle {
  display: flex; gap: 0; border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden;
}
.lang-toggle button {
  background: transparent; border: none; color: var(--text-dim);
  padding: 6px 12px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.lang-toggle button.active { background: var(--orange); color: #000; }
.lang-toggle button:hover:not(.active) { color: var(--text); background: var(--bg-card); }

/* Layout principal */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  max-width: 1400px;
  margin: 60px auto 0;
  min-height: calc(100vh - 60px);
}

/* Sidebar */
.sidebar {
  border-right: 1px solid var(--border);
  padding: 32px 16px 32px 24px;
  position: sticky; top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}
.sidebar h4 {
  font-size: 11px; color: var(--text-mute);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin: 18px 0 8px; font-weight: 700;
}
.sidebar h4:first-child { margin-top: 0; }
.sidebar ul { list-style: none; }
.sidebar li a {
  display: block; padding: 6px 10px; font-size: 13px;
  color: var(--text-dim); border-radius: 5px;
  font-weight: 400; transition: all 0.12s;
}
.sidebar li a:hover { color: var(--text); background: var(--bg-card); opacity: 1; }
.sidebar li a.active { color: var(--orange); background: var(--orange-soft); }

/* Conteúdo */
.content {
  padding: 32px 48px 80px;
  max-width: 980px;
}

h1 {
  font-size: 36px; font-weight: 900; letter-spacing: -0.03em;
  margin-bottom: 8px; line-height: 1.1;
}
h1 .tag {
  display: inline-block; font-size: 11px; padding: 4px 10px;
  background: var(--orange); color: #000; border-radius: 4px;
  font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  vertical-align: middle; margin-right: 12px;
}
.subtitle {
  color: var(--text-dim); font-size: 16px; margin-bottom: 36px;
  font-weight: 400;
}

h2 {
  font-size: 24px; font-weight: 800; margin: 48px 0 14px;
  letter-spacing: -0.02em; color: var(--text);
  border-top: 1px solid var(--border); padding-top: 36px;
}
h2:first-of-type { border-top: none; padding-top: 0; }
h3 {
  font-size: 17px; font-weight: 700; margin: 28px 0 10px;
  color: var(--text); letter-spacing: -0.01em;
}
h4 {
  font-size: 14px; font-weight: 600; margin: 18px 0 8px;
  color: var(--orange); text-transform: uppercase; letter-spacing: 0.06em;
}

p { margin: 8px 0 12px; color: var(--text); }
.muted { color: var(--text-dim); }

ul, ol { padding-left: 24px; margin: 8px 0 14px; }
li { margin: 4px 0; color: var(--text); }
li::marker { color: var(--orange); }

/* Code */
code {
  font-family: "SF Mono", Menlo, Monaco, Consolas, monospace;
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.875em;
  color: var(--orange);
  border: 1px solid var(--border);
}
pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 14px 0;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 13px;
  line-height: 1.55;
  border: 1px solid var(--border);
}
pre code {
  background: transparent; padding: 0; border: none; color: inherit;
}

/* Tabelas */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 14px;
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
th, td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th {
  background: var(--bg-soft);
  font-weight: 600;
  color: var(--orange);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(243, 114, 40, 0.04); }

/* Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.kpi {
  background: linear-gradient(135deg, var(--orange-soft), transparent);
  border: 1px solid var(--orange);
  border-radius: 10px;
  padding: 18px;
  text-align: center;
}
.kpi .num {
  font-size: 32px; font-weight: 900; color: var(--orange);
  line-height: 1; letter-spacing: -0.03em;
}
.kpi .lbl {
  font-size: 11px; color: var(--text-dim);
  margin-top: 8px; text-transform: uppercase; letter-spacing: 0.06em;
}

.feature {
  background: var(--bg-card);
  border-left: 3px solid var(--orange);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin: 12px 0;
}
.feature h4 {
  margin: 0 0 4px; color: var(--orange);
  text-transform: none; letter-spacing: -0.01em; font-size: 15px;
}
.feature p { margin: 0; color: var(--text-dim); font-size: 14px; }

.alert {
  background: rgba(249, 168, 37, 0.08);
  border-left: 3px solid #f9a825;
  padding: 12px 16px;
  margin: 14px 0;
  border-radius: 0 6px 6px 0;
  font-size: 14px;
}
.alert.success {
  background: rgba(46, 125, 50, 0.08);
  border-left-color: #2e7d32;
}
.alert.danger {
  background: rgba(198, 40, 40, 0.08);
  border-left-color: #c62828;
}
.alert strong { color: var(--orange); }

.hero {
  background: radial-gradient(circle at 70% 30%, var(--orange-soft), transparent 60%),
              linear-gradient(135deg, var(--bg-soft), var(--bg-card));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 48px 36px;
  margin: 0 0 36px;
  position: relative;
  overflow: hidden;
}
.hero h1 {
  font-size: 56px; line-height: 1; margin-bottom: 12px;
}
.hero .subtitle {
  font-size: 18px; max-width: 600px; margin-bottom: 24px;
}
.cta-row {
  display: flex; flex-wrap: wrap; gap: 12px;
}
.btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600; font-size: 14px;
  transition: all 0.15s;
  border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text);
}
.btn:hover { border-color: var(--orange); background: var(--orange-soft); opacity: 1; }
.btn.primary {
  background: var(--orange); color: #000; border-color: var(--orange);
}
.btn.primary:hover { background: #ff8a40; opacity: 1; }

/* Steps tutorial */
.step {
  display: flex; gap: 18px; margin: 18px 0;
  padding: 18px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 10px;
}
.step-num {
  flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--orange); color: #000;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 16px;
}
.step-body { flex: 1; }
.step-body h3 { margin-top: 0; }
.step-body p { margin-bottom: 0; }

/* API endpoint blocks */
.endpoint {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 16px 0;
  overflow: hidden;
}
.endpoint-header {
  padding: 12px 16px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  font-family: "SF Mono", Menlo, monospace;
  font-size: 14px;
}
.method {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.method.get { background: #1e3a8a; color: #93c5fd; }
.method.post { background: #14532d; color: #86efac; }
.method.patch { background: #78350f; color: #fcd34d; }
.method.delete { background: #7f1d1d; color: #fca5a5; }
.endpoint-path {
  color: var(--text); font-weight: 500; flex: 1;
}
.endpoint-body { padding: 16px; }
.endpoint-body p:first-child { margin-top: 0; }

/* Badges */
.badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 10px; font-size: 11px; font-weight: 600;
  background: var(--bg-card); color: var(--text-dim);
  border: 1px solid var(--border);
}
.badge.ok { color: #4ade80; border-color: rgba(74, 222, 128, 0.3); }
.badge.warn { color: #fbbf24; border-color: rgba(251, 191, 36, 0.3); }
.badge.brand { background: var(--orange); color: #000; border-color: var(--orange); }

/* Mobile */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static; height: auto;
    border-right: none; border-bottom: 1px solid var(--border);
    padding: 16px;
  }
  .content { padding: 24px 20px 60px; }
  .hero { padding: 32px 20px; }
  .hero h1 { font-size: 36px; }
  .nav-tabs { display: none; }
  .topbar { padding: 0 16px; }
  h1 { font-size: 28px; }
  h2 { font-size: 20px; }
}

/* Print */
@media print {
  .topbar, .sidebar { display: none; }
  .layout { grid-template-columns: 1fr; }
  .content { padding: 0; }
}

/* i18n hide */
[data-lang]:not(.show) { display: none; }
