/* ========== RESET & BASE ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: none !important;
}

html { scroll-behavior: smooth; }

html, body {
  font-family: 'Poppins', sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}

body::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

a { text-decoration: none; color: inherit; outline: none; }
button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  outline: none;
}

:root {
  --accent-start: #ff0029;
  --accent-end: #ff0029;
  --green: #22c55e;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-soft: cubic-bezier(0.16, 1, 0.3, 1);
  --theme-speed: 0.5s;
  --sidebar-w: 240px;
  --header-h: 60px;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========== THEMES ========== */
body.light {
  --bg: #e9e2ff;
  --text: #0d0d0d;
  --text-muted: rgba(13,13,13,0.6);
  --card-bg: #ffffff;
  --card-border: rgba(13,13,13,0.08);
  --sidebar-bg: #ffffff;
  --code-bg: #f1eefe;
  --divider: rgba(13,13,13,0.08);
}

body.dark {
  --bg: #0d0d0d;
  --text: #e9e2ff;
  --text-muted: rgba(233,226,255,0.55);
  --card-bg: #17151f;
  --card-border: rgba(233,226,255,0.08);
  --sidebar-bg: #14121c;
  --code-bg: #1c1926;
  --divider: rgba(233,226,255,0.08);
}

body,
.docs-header,
.docs-sidebar,
.nav-link,
.doc-card,
.callout,
code, pre,
.faq-item,
.theme-toggle,
.theme-toggle .dot {
  transition: background-color var(--theme-speed) var(--ease),
              border-color var(--theme-speed) var(--ease),
              color var(--theme-speed) var(--ease);
}

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ========== HEADER ========== */
.docs-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--divider);
  z-index: 100;
}

.docs-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
}

.docs-brand h1 {
  font-size: 15px;
  font-weight: 600;
}

.docs-brand .tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-start);
  background: rgba(255,0,41,0.12);
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 2px;
}

.docs-brand .tag p { margin: 0; }

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.back-link {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  display: none;
  align-items: center;
  gap: 6px;
}

.hamburger {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 16px;
}

.theme-toggle {
  width: 44px;
  height: 25px;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 3px;
  position: relative;
  flex-shrink: 0;
}

.theme-toggle:active { transform: scale(0.94); }

.theme-toggle .dot {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--accent-start);
  position: absolute;
  top: 3px;
  left: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s var(--ease-soft);
}

.theme-toggle .dot i {
  font-size: 9px;
  color: #fff;
}

body.dark .theme-toggle .dot {
  transform: translateX(19px);
}

/* Theme toggle relocated into the sidebar as its own row */
.theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  margin-top: 4px;
}

.theme-row .theme-row-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.theme-row .theme-row-label i { width: 16px; text-align: center; font-size: 13px; }

/* ========== LAYOUT ========== */
.docs-shell {
  display: flex;
  padding-top: var(--header-h);
  min-height: 100vh;
}

/* ---- Sidebar ---- */
.docs-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: fixed;
  top: var(--header-h);
  bottom: 0;
  left: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--divider);
  padding: 22px 14px;
  overflow-y: auto;
  z-index: 90;
  transform: translateX(0);
  transition: transform 0.4s var(--ease);
}

.nav-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 12px;
  margin: 18px 0 8px;
}

.nav-group-label:first-child { margin-top: 0; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.nav-link i { width: 16px; text-align: center; font-size: 13px; }

.nav-link.active {
  background: rgba(255,0,41,0.12);
  color: var(--accent-start);
  font-weight: 600;
}

.nav-link:active { transform: scale(0.98); }

@media (hover: hover) and (pointer: fine) {
  .nav-link:hover:not(.active) {
    background: var(--card-bg);
    color: var(--text);
  }
}

/* Overlay behind the drawer on mobile */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
  z-index: 85;
}

.sidebar-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* ---- Main content ---- */
.docs-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 36px 24px 80px;
  display: flex;
  justify-content: center;
}

.doc-content {
  width: 100%;
  max-width: 700px;
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInUp 0.4s var(--ease-soft) forwards;
}

.doc-eyebrow {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-start);
  margin-bottom: 6px;
}

.doc-content h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin-bottom: 8px;
}

.doc-lead {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 28px;
}

.doc-content h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 32px 0 12px;
}

.doc-content h2:first-of-type { margin-top: 8px; }

.doc-content p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 14px;
}

.doc-content p.muted { color: var(--text-muted); }

.doc-content ul, .doc-content ol {
  margin: 0 0 16px 20px;
  font-size: 14px;
  line-height: 1.8;
}

.doc-content li { margin-bottom: 4px; }

.doc-content strong { font-weight: 700; }

/* ---- Cards / callouts ---- */
.doc-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 14px;
}

.doc-card h3 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.doc-card h3 i { color: var(--accent-start); font-size: 13px; }

.doc-card p { font-size: 13px; color: var(--text-muted); margin-bottom: 0; }

.callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-left: 3px solid var(--accent-start);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 18px 0;
  font-size: 13px;
  line-height: 1.6;
}

.callout i { color: var(--accent-start); margin-top: 2px; }
.callout.warn { border-left-color: #f59e0b; }
.callout.warn i { color: #f59e0b; }

/* ---- Code ---- */
code {
  background: var(--code-bg);
  color: var(--accent-start);
  padding: 2px 6px;
  border-radius: 5px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 12.5px;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  overflow-x: auto;
  margin-bottom: 16px;
}

pre code {
  background: none;
  padding: 0;
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.6;
}

/* ---- Step list ---- */
.step-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.step-list-item {
  display: flex;
  gap: 14px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.step-list-num {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-list-body h4 { font-size: 13.5px; font-weight: 600; margin-bottom: 3px; }
.step-list-body p { font-size: 12.5px; color: var(--text-muted); margin-bottom: 0; }

/* ---- FAQ accordion (same grid-rows technique as the main site) ---- */
.faq-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }

.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.faq-question i {
  color: var(--text-muted);
  transition: transform 0.35s var(--ease);
  flex-shrink: 0;
}

.faq-item.open .faq-question i {
  transform: rotate(180deg);
  color: var(--accent-start);
}

.faq-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s var(--ease);
}

.faq-item.open .faq-wrap { grid-template-rows: 1fr; }

.faq-answer {
  min-height: 0;
  overflow: hidden;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  padding: 0 16px;
  transition: padding 0.35s var(--ease);
}

.faq-item.open .faq-answer { padding: 0 16px 16px; }

/* ---- Prev/Next page footer ---- */
.doc-pagination {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--card-border);
}

.doc-pagination a {
  flex: 1;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 12.5px;
}

.doc-pagination .label { display: block; color: var(--text-muted); font-size: 10.5px; margin-bottom: 3px; }
.doc-pagination .title { font-weight: 600; font-size: 13px; }
.doc-pagination .next { text-align: right; }

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .docs-sidebar {
    transform: translateX(-100%);
    width: 260px;
  }
  .docs-sidebar.show { transform: translateX(0); }
  .docs-main { margin-left: 0; padding: 28px 18px 80px; }
  .hamburger { display: flex; }
}

@media (min-width: 901px) {
  .hamburger { display: none; }
  .sidebar-overlay { display: none; }
  .back-link { display: block; }
}

.site-footer {
  margin: 12px 20px 0;
  padding: 24px 4px 28px;
  border-top: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-logo {
  width: 28px;
  border-radius: 4px;
}

.footer-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.footer-links a {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}

@media (hover: hover) and (pointer: fine) {
  .footer-links a:hover {
    color: var(--accent-start);
  }
}

.footer-copy {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.8;
  max-width: 320px;
  line-height: 1.5;
}