/* ── Base ─────────────────────────────────────────────────────────── */
:root {
  --primary: #4361ee;
  --primary-dark: #3651d4;
  --secondary: #6c757d;
  --success: #2ec4b6;
  --danger: #e63946;
  --warning: #f4a261;
  --info: #4cc9f0;
  --purple: #7b2d8b;
  --orange: #f77f00;
  --light: #f8f9fa;
  --dark: #1a1d23;
  --font-main: 'Inter', sans-serif;
  --font-heading: 'Space Grotesk', sans-serif;
}

* { box-sizing: border-box; }

body {
  font-family: var(--font-main);
  color: #1a1d23;
  background: #fff;
  line-height: 1.6;
}

h1,h2,h3,h4,h5 { font-family: var(--font-heading); }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.py-6 { padding-top: 5rem; padding-bottom: 5rem; }

/* ── Navbar ──────────────────────────────────────────────────────── */
.navbar { border-bottom: 1px solid #e9ecef; }
.navbar-brand .brand-icon { font-size: 1.4rem; color: var(--primary); }
.navbar-brand .brand-name { font-size: 1.2rem; color: #1a1d23; }
.nav-link { color: #495057 !important; transition: color .2s; }
.nav-link:hover { color: var(--primary) !important; }

/* ── Badge Presta ─────────────────────────────────────────────────── */
.badge-presta {
  background: #eef0ff;
  color: var(--primary);
  font-size: .8rem;
  font-weight: 600;
  padding: .45em 1em;
  border-radius: 20px;
  border: 1px solid #d4d9ff;
}

/* ── Hero ────────────────────────────────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, #f0f4ff 0%, #fff 60%);
  border-bottom: 1px solid #e9ecef;
}
.hero-section .display-4 { font-weight: 800; color: #1a1d23; }
.lh-tight { line-height: 1.15; }

/* ── Hero Code Card ──────────────────────────────────────────────── */
.hero-code-card {
  background: #1a1d23;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(67,97,238,.15);
}
.code-card-header {
  background: #2a2d35;
  padding: .75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot-red { background: #ff5f57; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #28c840; }
.code-card-body { padding: 1.5rem; margin: 0; font-size: .88rem; line-height: 1.8; }
.code-card-body code { font-family: 'Courier New', monospace; }
.json-brace { color: #e2e8f0; }
.json-key { color: #7dd3fc; }
.json-str { color: #86efac; }
.json-num { color: #fde68a; }
.json-bool { color: #f9a8d4; }

/* ── Stats Band ──────────────────────────────────────────────────── */
.stats-band { background: var(--primary) !important; }
.stat-num { font-family: var(--font-heading); font-size: 2rem; font-weight: 700; }
.stat-label { font-size: .85rem; opacity: .85; }

/* ── Section labels ──────────────────────────────────────────────── */
.section-label {
  display: inline-block;
  background: #eef0ff;
  color: var(--primary);
  font-size: .8rem;
  font-weight: 600;
  padding: .35em 1em;
  border-radius: 20px;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: .75rem;
}
.section-title { font-size: 2rem; font-weight: 700; color: #1a1d23; }
.section-sub { color: #6c757d; max-width: 560px; margin: 0 auto; }

/* ── Feature Cards ───────────────────────────────────────────────── */
.feature-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 16px;
  padding: 1.75rem;
  transition: box-shadow .25s, transform .25s;
}
.feature-card:hover { box-shadow: 0 8px 32px rgba(67,97,238,.1); transform: translateY(-3px); }
.feature-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
}
.bg-primary-soft { background: #eef0ff; }
.bg-success-soft { background: #e6faf8; }
.bg-danger-soft  { background: #fde8ea; }
.bg-info-soft    { background: #e3f8ff; }
.bg-warning-soft { background: #fff4e8; }
.bg-purple-soft  { background: #f3e8f9; }
.text-purple { color: var(--purple) !important; }
.text-orange { color: var(--orange) !important; }

/* ── Route Cards ─────────────────────────────────────────────────── */
.route-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: box-shadow .2s, border-color .2s;
}
.route-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); border-color: var(--primary); }
.route-method {
  font-size: .72rem;
  font-weight: 700;
  padding: .3em .7em;
  border-radius: 6px;
  letter-spacing: .05em;
  white-space: nowrap;
}
.route-method.get  { background: #e6faf8; color: #0d9488; }
.route-method.post { background: #fff4e8; color: #c2410c; }
.route-name { font-weight: 600; font-size: .95rem; }

/* ── Steps ───────────────────────────────────────────────────────── */
.step-card { padding: 2rem 1.5rem; }
.step-num {
  width: 56px; height: 56px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  font-family: var(--font-heading);
}

/* ── Security Section ────────────────────────────────────────────── */
.security-section { background: var(--primary) !important; }
.security-list li { padding: .35rem 0; opacity: .92; }
.security-metric-card {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  color: #fff;
}
.security-metric-card i { font-size: 1.5rem; opacity: .7; }
.metric-label { font-size: .75rem; opacity: .75; margin-top: .5rem; }
.metric-value { font-size: 1.25rem; font-weight: 700; }
.metric-sub { font-size: .72rem; opacity: .6; }

/* ── CTA Box ─────────────────────────────────────────────────────── */
.cta-box {
  background: #f0f4ff;
  border-radius: 24px;
  padding: 4rem 2rem;
  border: 1px solid #d4d9ff;
}

/* ── Footer ──────────────────────────────────────────────────────── */
.footer { background: var(--dark) !important; }
.brand-icon-sm { font-size: 1.2rem; color: var(--primary); }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: .4rem; }
.footer-links a { color: rgba(255,255,255,.55); text-decoration: none; font-size: .9rem; transition: color .2s; }
.footer-links a:hover { color: #fff; }
.bg-secondary-dark { background: rgba(255,255,255,.1) !important; }

/* ── Module Page ─────────────────────────────────────────────────── */
.module-hero {
  background: linear-gradient(135deg,#f0f4ff 0%,#fff 60%);
  border-bottom: 1px solid #e9ecef;
}
.toc-sidebar {
  position: sticky;
  top: 80px;
}
.toc-sidebar .nav-link {
  font-size: .88rem;
  padding: .35rem .75rem;
  border-radius: 8px;
  color: #6c757d !important;
}
.toc-sidebar .nav-link:hover,
.toc-sidebar .nav-link.active { background: #eef0ff; color: var(--primary) !important; }
.toc-sidebar .nav-link i { width: 18px; }

.doc-section { scroll-margin-top: 90px; }
.doc-section h2 { font-size: 1.6rem; font-weight: 700; border-bottom: 2px solid #eef0ff; padding-bottom: .5rem; margin-bottom: 1.5rem; }

.endpoint-card { background:#fff; border:1px solid #e9ecef; border-radius:16px; overflow:hidden; margin-bottom:1.5rem; }
.endpoint-header { padding:1rem 1.5rem; display:flex; align-items:center; gap:1rem; background:#fafafa; border-bottom:1px solid #e9ecef; }
.endpoint-body { padding:1.5rem; }

.code-block { background:#1a1d23; border-radius:10px; padding:1.25rem 1.5rem; color:#e2e8f0; font-family:'Courier New',monospace; font-size:.85rem; line-height:1.7; overflow-x:auto; }
.code-block .comment { color:#64748b; }
.code-block .method  { color:#f9a8d4; font-weight:700; }
.code-block .url     { color:#7dd3fc; }
.code-block .header  { color:#86efac; }
.code-block .key     { color:#7dd3fc; }
.code-block .val-str { color:#86efac; }
.code-block .val-num { color:#fde68a; }
.code-block .val-bool{ color:#f9a8d4; }

.param-table th { background:#f8f9fa; font-size:.82rem; }
.param-table td { font-size:.88rem; vertical-align:middle; }
.param-required { background:#fde8ea; color:#c0392b; font-size:.75rem; padding:.2em .5em; border-radius:4px; font-weight:600; }
.param-optional { background:#e8f5e9; color:#27ae60; font-size:.75rem; padding:.2em .5em; border-radius:4px; font-weight:600; }

.config-table th { background:#f8f9fa; font-size:.82rem; }
.config-table td { font-size:.88rem; vertical-align:middle; }

.install-step { display:flex; gap:1rem; margin-bottom:1.5rem; }
.install-step-num { min-width:36px; height:36px; background:var(--primary); color:#fff; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:700; flex-shrink:0; }

/* ── Responsive ──────────────────────────────────────────────────── */
@media(max-width:768px){
  .py-6{padding-top:3rem;padding-bottom:3rem;}
  .section-title{font-size:1.5rem;}
  .hero-section .display-4{font-size:2rem;}
}
