/* public/css/docs.css — Public /docs/api reference page.
   Server-rendered reference for the productionised /api/b2b/verify endpoint.
   Reads live tier rates, quotas, and SLA flags from db/api-keys.js via
   routes/docs.js, then renders a copyable markdown-style page that mirrors
   the partners-landing marketing layout. No JS portal / no client hydration —
   static enough that grep on the response is a useful smoke test. */

.docs-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Hero ──────────────────────────────────────────────── */
.docs-hero {
  background: var(--bg);
  padding: 4.5rem 0 3rem;
  border-bottom: 1px solid var(--border);
}
.docs-eyebrow {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 1rem;
}
.docs-headline {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 1.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.docs-sub {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-muted);
  max-width: 70ch;
}

/* ── Sections ───────────────────────────────────────────── */
.docs-section {
  background: var(--bg);
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--border);
}
.docs-section-title {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}
.docs-section--stamp {
  background: var(--surface);
  border-bottom: none;
}

.docs-prose {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 1rem;
  max-width: 70ch;
}
.docs-prose--muted {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.docs-inline-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--surface-2);
  color: var(--accent);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* ── Code blocks ────────────────────────────────────────── */
.docs-pre-wrap {
  position: relative;
  margin: 0.75rem 0 1.25rem;
}
.docs-pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text);
  white-space: pre;
  margin: 0;
}
.docs-pre code {
  font-family: inherit;
  color: inherit;
  background: transparent;
  padding: 0;
  border: none;
}

.docs-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.docs-copy-btn:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Tables ─────────────────────────────────────────────── */
.docs-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin: 0.75rem 0 1.25rem;
}
.docs-table th,
.docs-table td {
  text-align: left;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
  vertical-align: top;
}
.docs-table thead th {
  background: var(--surface-2);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}
.docs-table tbody tr:last-child td {
  border-bottom: none;
}
.docs-tier-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}
.docs-tier-id {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ── Examples ───────────────────────────────────────────── */
.docs-example-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 1.5rem 0 0.5rem;
}
.docs-example-title:first-of-type {
  margin-top: 0.25rem;
}

/* ── Last reviewed stamp ─────────────────────────────────── */
.docs-last-reviewed {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
  letter-spacing: 0.04em;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .docs-hero { padding: 3rem 0 2rem; }
  .docs-section { padding: 2.5rem 0; }
  .docs-table th,
  .docs-table td { padding: 0.6rem 0.75rem; font-size: 0.8rem; }
  .docs-pre { font-size: 0.78rem; padding: 1rem; }
}

/* ── /status page (uptime + p95) ────────────────────────── */
.status-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 0.5rem 0 1.5rem;
}
.status-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem 1.5rem;
}
.status-stat-num {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.4rem;
}
.status-stat-unit {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 0.25rem;
}
.status-stat-label {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 0.2rem;
}
.status-stat-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.status-timeline {
  width: 100%;
  height: auto;
  display: block;
  margin-top: 1rem;
}
.status-timeline-axis { stroke: var(--border); stroke-width: 1; }
.status-timeline-guide { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 4; }
.status-timeline-tick {
  fill: var(--text-muted);
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.status-timeline-tick-y {
  fill: var(--text-muted);
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.status-timeline-bar { opacity: 0.95; }
.status-timeline-bar--ok { fill: var(--green); }
.status-timeline-bar--degraded { fill: var(--amber); }
.status-timeline-bar--outage { fill: var(--red); }
.status-timeline-bar--quiet { fill: var(--border); opacity: 0.6; }

@media (max-width: 768px) {
  .status-stat-row { grid-template-columns: 1fr; }
}
