/* URBot Developer Portal — dev.css */
:root {
  --bg:       #08080e;
  --surface:  #111118;
  --surface2: #16161f;
  --border:   #1e1e2e;
  --accent:   #6c63ff;
  --accent2:  #3ecfcf;
  --text:     #e8e8f0;
  --muted:    #6b7280;
  --green:    #22c55e;
  --yellow:   #eab308;
  --red:      #ef4444;
  --orange:   #f97316;
}

*, *::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, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace; }

/* ── Nav ─────────────────────────────────────────────────────────────── */
.topnav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(8,8,14,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 20px; height: 58px;
}
.nav-logo { font-weight: 800; font-size: 1.1rem; color: var(--text); }
.nav-logo span { color: var(--accent); }
.nav-badge {
  background: var(--accent); color: #fff;
  font-size: 0.6rem; font-weight: 800; padding: 2px 7px;
  border-radius: 10px; text-transform: uppercase; letter-spacing: 0.08em;
}
.nav-links { margin-left: auto; display: flex; gap: 20px; font-size: 0.88rem; }
.nav-links a { color: var(--muted); }
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ── Layout ──────────────────────────────────────────────────────────── */
.page-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px 80px; }

.portal-layout { display: flex; gap: 40px; align-items: flex-start; margin-top: 20px; }

.sidebar { width: 210px; flex-shrink: 0; }

.main-content { flex: 1; min-width: 0; }

@media (max-width: 768px) {
  .portal-layout { flex-direction: column; }
  .sidebar { width: 100%; }
}

/* ── Sidebar nav ─────────────────────────────────────────────────────── */
.sticky-nav {
  position: sticky; top: 76px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px 16px;
}
.sticky-nav h4 {
  font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--muted); margin-bottom: 10px;
}
.sticky-nav ul { list-style: none; }
.sticky-nav li + li { margin-top: 2px; }
.sticky-nav a {
  color: var(--muted); font-size: 0.875rem;
  display: block; padding: 4px 8px; border-radius: 6px;
}
.sticky-nav a:hover { color: var(--text); text-decoration: none; background: var(--surface2); }
.sticky-nav a.active { color: var(--accent2); background: rgba(62,207,207,0.08); }

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
}
.hero-eyebrow {
  color: var(--accent2); font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: 10px;
}
.hero h1 {
  font-size: clamp(2rem, 4.5vw, 2.8rem); font-weight: 800;
  line-height: 1.15; margin-bottom: 14px;
}
.hero h1 em { font-style: normal; color: var(--accent2); }
.hero-sub { font-size: 1.05rem; color: var(--muted); max-width: 580px; margin-bottom: 28px; }
.hero-stats {
  display: flex; gap: 32px; flex-wrap: wrap; margin-top: 32px;
  padding-top: 24px; border-top: 1px solid var(--border);
}
.hero-stat { display: flex; flex-direction: column; }
.hero-stat strong { font-size: 1.4rem; font-weight: 800; color: var(--accent2); }
.hero-stat span { font-size: 0.8rem; color: var(--muted); }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-primary {
  background: var(--accent); color: #fff;
  padding: 11px 26px; border-radius: 8px;
  font-weight: 700; font-size: 0.9rem; border: none; cursor: pointer;
  transition: background 0.2s;
  display: inline-block;
}
.btn-primary:hover { background: #5955d9; text-decoration: none; color: #fff; }
.btn-secondary {
  background: transparent; color: var(--text);
  padding: 11px 26px; border-radius: 8px;
  font-weight: 600; font-size: 0.9rem;
  border: 1px solid var(--border); cursor: pointer;
  transition: border-color 0.2s;
  display: inline-block;
}
.btn-secondary:hover { border-color: var(--accent2); text-decoration: none; }
.btn-copy {
  background: var(--surface2); color: var(--accent2);
  border: 1px solid var(--border); padding: 6px 14px;
  border-radius: 6px; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.btn-copy:hover { background: var(--border); }

/* ── Sections ────────────────────────────────────────────────────────── */
.portal-section { padding-top: 48px; }
.portal-section h2 {
  font-size: 1.5rem; font-weight: 700; margin-bottom: 8px;
  padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.portal-section h3 {
  font-size: 1rem; font-weight: 700; margin: 24px 0 10px;
}
.section-sub { color: var(--muted); margin-bottom: 24px; margin-top: 8px; }
p + p { margin-top: 10px; }

/* ── Form ────────────────────────────────────────────────────────────── */
.key-form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px 24px;
}
.form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px;
}
.form-field.full { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.form-field small { font-size: 0.75rem; color: var(--muted); }
.req { color: var(--red); }
.opt { color: var(--muted); font-weight: 400; font-size: 0.75rem; }
input[type="text"],
input[type="email"] {
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text); padding: 10px 14px; border-radius: 8px;
  font-size: 0.9rem; outline: none;
  transition: border-color 0.2s;
}
input[type="text"]:focus,
input[type="email"]:focus { border-color: var(--accent2); }

/* Plan radio row */
.plan-select-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.plan-radio {
  display: flex; flex-direction: column;
  background: var(--bg); border: 2px solid var(--border);
  border-radius: 10px; padding: 12px 16px;
  cursor: pointer; min-width: 130px;
  transition: border-color 0.2s;
}
.plan-radio input[type="radio"] { display: none; }
.plan-radio strong { font-size: 0.85rem; }
.plan-radio span { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.plan-radio.selected { border-color: var(--accent2); background: rgba(62,207,207,0.06); }
.plan-radio.selected span { color: var(--accent2); }

/* Key reveal */
.key-reveal {
  background: rgba(34,197,94,0.06); border: 1px solid rgba(34,197,94,0.3);
  border-radius: 12px; padding: 24px; margin-top: 24px;
}
.key-reveal-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.key-reveal-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem; font-weight: 800; flex-shrink: 0;
}
.key-reveal-warning { font-size: 0.85rem; color: var(--muted); margin-bottom: 16px; }
.key-display-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.key-display {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px; font-size: 0.8rem;
  color: var(--accent2); word-break: break-all; min-width: 200px;
  user-select: all;
}
.key-meta { margin-top: 14px; font-size: 0.82rem; color: var(--muted); }
.key-meta span { margin-right: 16px; }

/* Key lookup */
.key-lookup-row { display: flex; gap: 10px; flex-wrap: wrap; }
.key-lookup-row input { flex: 1; min-width: 200px; }

/* Key card list */
.key-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px 20px; margin-bottom: 12px;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start;
}
.key-card-info { flex: 1; min-width: 200px; }
.key-card-name { font-weight: 700; margin-bottom: 4px; }
.key-card-hint { font-family: monospace; font-size: 0.82rem; color: var(--muted); }
.key-card-meta { font-size: 0.78rem; color: var(--muted); margin-top: 6px; }
.key-card-meta span { margin-right: 14px; }
.key-card-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.badge {
  font-size: 0.7rem; font-weight: 700; padding: 2px 8px;
  border-radius: 5px; text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-free      { background: #1a1a2a; color: var(--accent); }
.badge-developer { background: #1a2a1a; color: var(--green); }
.badge-pro       { background: #2a1a0a; color: var(--orange); }
.badge-active    { background: #1a2a1a; color: var(--green); }
.badge-revoked   { background: #2a1a1a; color: var(--red); }
.key-card-actions { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.btn-revoke {
  background: transparent; color: var(--red);
  border: 1px solid rgba(239,68,68,0.3); padding: 6px 14px;
  border-radius: 6px; font-size: 0.8rem; cursor: pointer;
}
.btn-revoke:hover { background: rgba(239,68,68,0.08); }
.btn-rotate {
  background: transparent; color: var(--yellow);
  border: 1px solid rgba(234,179,8,0.3); padding: 6px 14px;
  border-radius: 6px; font-size: 0.8rem; cursor: pointer;
}
.btn-rotate:hover { background: rgba(234,179,8,0.08); }
.btn-usage {
  background: var(--surface2); color: var(--text);
  border: 1px solid var(--border); padding: 6px 14px;
  border-radius: 6px; font-size: 0.8rem; cursor: pointer;
}
.btn-usage:hover { background: var(--border); }

/* Usage panel */
.usage-panel {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px; margin-top: 12px; font-size: 0.85rem;
}
.usage-stats { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 14px; }
.usage-stat { display: flex; flex-direction: column; }
.usage-stat strong { font-size: 1.1rem; font-weight: 700; color: var(--accent2); }
.usage-stat span { font-size: 0.75rem; color: var(--muted); }

/* Rate limit bar inside usage panel */
.usage-rate-limit {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px; margin-top: 12px;
}
.usage-bar-label { font-size: 0.75rem; color: var(--muted); margin-bottom: 6px; display: flex; justify-content: space-between; align-items: center; }
.usage-bar { height: 7px; background: var(--border); border-radius: 4px; overflow: hidden; }
.usage-bar-fill { height: 100%; background: var(--accent2); border-radius: 4px; transition: width 0.4s ease; }

/* ── Pricing ─────────────────────────────────────────────────────────── */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-top: 20px; }
.pricing-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 26px 22px; position: relative;
}
.pricing-card.featured { border-color: var(--accent); }
.plan-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff;
  font-size: 0.7rem; font-weight: 700; padding: 3px 12px; border-radius: 10px;
  text-transform: uppercase; letter-spacing: 0.07em; white-space: nowrap;
}
.plan-name { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 6px; }
.plan-price { font-size: 1.9rem; font-weight: 800; margin-bottom: 2px; }
.plan-price small { font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.plan-calls { font-size: 1.6rem; font-weight: 700; color: var(--accent2); }
.plan-calls-label { font-size: 0.78rem; color: var(--muted); margin-bottom: 18px; }
.plan-features { list-style: none; font-size: 0.85rem; }
.plan-features li { padding: 4px 0; }
.plan-features li::before { content: '✓ '; color: var(--green); font-weight: 700; }

/* ── Code blocks ─────────────────────────────────────────────────────── */
.code-wrap {
  background: #0c0c14; border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; margin: 14px 0;
}
.code-header {
  background: var(--surface); padding: 8px 16px;
  font-size: 0.76rem; color: var(--muted);
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.lang-badge {
  background: var(--border); padding: 2px 8px; border-radius: 4px;
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em;
}
pre { padding: 18px 20px; overflow-x: auto; }
pre code { font-size: 0.83rem; line-height: 1.7; color: #c9d1d9; }

.ic {
  background: var(--surface); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 4px;
  font-family: 'Cascadia Code', 'Fira Code', monospace;
  font-size: 0.85em; color: var(--accent2);
}

/* ── Tabs ────────────────────────────────────────────────────────────── */
.tab-row { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab {
  padding: 8px 16px; background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 0.85rem; border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent2); border-bottom-color: var(--accent2); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Param table ─────────────────────────────────────────────────────── */
.param-table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 0.875rem; }
.param-table th {
  background: var(--surface); text-align: left;
  padding: 10px 14px; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--muted); border-bottom: 2px solid var(--border);
}
.param-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.param-table tr:last-child td { border-bottom: none; }
.tag-req { background: #3b1a1a; color: var(--red); font-size: 0.68rem; padding: 2px 6px; border-radius: 4px; font-weight: 700; }
.tag-opt { background: #1a2a1a; color: var(--green); font-size: 0.68rem; padding: 2px 6px; border-radius: 4px; font-weight: 700; }

/* ── Endpoint rows ───────────────────────────────────────────────────── */
.endpoint-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 16px; margin: 8px 0; font-size: 0.875rem;
}
.path { font-family: 'Cascadia Code', Consolas, monospace; color: var(--text); }
.edesc { color: var(--muted); font-size: 0.82rem; margin-top: 3px; }
.method {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 0.72rem; font-weight: 700; font-family: monospace; margin-right: 8px;
}
.method.post { background: #1a3a2a; color: var(--green); }
.method.get  { background: #1a2a3a; color: var(--accent2); }
.method.del  { background: #3a1a1a; color: var(--red); }

/* ── Status badges ───────────────────────────────────────────────────── */
.status {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 0.72rem; font-weight: 700; font-family: monospace;
}
.status.ok  { background: #1a3a2a; color: var(--green); }
.status.err { background: #3a1a1a; color: var(--red); }

/* ── Steps ───────────────────────────────────────────────────────────── */
.steps { margin: 20px 0; }
.step { display: flex; gap: 18px; margin-bottom: 28px; }
.step-num {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.95rem; flex-shrink: 0; margin-top: 2px;
}
.step-body h3 { margin-top: 4px; margin-bottom: 8px; }

/* ── Alerts ──────────────────────────────────────────────────────────── */
.alert-info {
  background: rgba(108,99,255,0.08); border-left: 3px solid var(--accent);
  padding: 14px 18px; border-radius: 0 8px 8px 0;
  margin: 16px 0; font-size: 0.875rem; color: var(--muted);
}
.alert-info strong { color: var(--text); }
.alert-error {
  background: rgba(239,68,68,0.08); border-left: 3px solid var(--red);
  padding: 12px 16px; border-radius: 0 8px 8px 0;
  margin-top: 12px; font-size: 0.875rem; color: var(--red);
}

/* ── CTA box ─────────────────────────────────────────────────────────── */
.cta-box {
  margin-top: 48px; padding: 32px;
  background: var(--surface); border-radius: 14px;
  border: 1px solid var(--border); text-align: center;
}
.cta-box h3 { margin-bottom: 10px; }
.cta-box p { color: var(--muted); margin-bottom: 24px; }

/* ── Copy toast ──────────────────────────────────────────────────────── */
.copy-toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--green); color: #fff;
  padding: 10px 20px; border-radius: 8px;
  font-size: 0.85rem; font-weight: 600;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
.copy-toast.show { opacity: 1; transform: translateY(0); }

/* ── Loading skeleton ────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 6px; height: 18px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Empty state ─────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 40px 20px;
  color: var(--muted); font-size: 0.9rem;
}
.empty-state svg { margin-bottom: 12px; opacity: 0.35; }

/* ── MCP section ─────────────────────────────────────────────────────── */
.mcp-tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.mcp-tool-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.85rem;
  line-height: 1.5;
}
.mcp-tool-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}
.mcp-tool-card strong { display: block; margin-bottom: 3px; font-size: 0.9rem; }
.mcp-tool-card small { color: var(--muted); }

.btn-copy-small {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s;
  margin-left: auto;
}
.btn-copy-small:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Keep MCP tab content scoped */
#mcp .tab-content { display: none; }
#mcp .tab-content.active { display: block; }
