/* ==========================================================================
   Rocket Indexer Enterprise — shared design system
   Dark, premium fintech aesthetic used across landing, dashboard, checkout
   and docs so the whole product feels like one cohesive piece of software.
   ========================================================================== */

:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Sora", var(--font-sans);
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --bg: #070a10;
  --bg-elev: #0a0e16;
  --surface: #0f1420;
  --surface-2: #141b29;
  --surface-3: #1a2334;
  --border: #212b3d;
  --border-soft: #1a2233;

  --ink: #eef2f8;
  --ink-soft: #c4cddb;
  --muted: #8b95ab;
  --faint: #5a647a;

  --brand: #1fd8a4;
  --brand-ink: #04140f;
  --brand-strong: #17b98d;
  --brand-soft: rgba(31, 216, 164, 0.12);
  --indigo: #7c7ff2;
  --indigo-soft: rgba(124, 127, 242, 0.14);

  --ok: #1fd8a4;
  --ok-bg: rgba(31, 216, 164, 0.12);
  --ok-line: rgba(31, 216, 164, 0.35);
  --warn: #f5b954;
  --warn-bg: rgba(245, 185, 84, 0.12);
  --warn-line: rgba(245, 185, 84, 0.35);
  --bad: #f2617a;
  --bad-bg: rgba(242, 97, 122, 0.12);
  --bad-line: rgba(242, 97, 122, 0.35);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 24px 64px -12px rgba(0, 0, 0, 0.65);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { color-scheme: dark; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
a { color: inherit; }
code, pre, .mono { font-family: var(--font-mono); }

::selection { background: var(--brand-soft); color: var(--ink); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--border); }

/* ---- layout helpers ---- */
.container { width: min(1160px, calc(100% - 2.5rem)); margin: 0 auto; }
.flex { display: flex; }
.grid { display: grid; }
.center { display: grid; place-items: center; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.brand-text { color: var(--brand); }

/* ---- brand mark ---- */
.brandmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
}
.brandmark .logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--brand) 0%, var(--indigo) 130%);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 6px 18px -6px rgba(31, 216, 164, 0.55);
}
.brandmark .logo svg { width: 18px; height: 18px; }
.brandmark .word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.brandmark .word small {
  display: block;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.68rem;
  color: var(--faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: -0.005em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 0.65rem 1.05rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), opacity 0.15s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
  color: var(--brand-ink);
  box-shadow: 0 8px 20px -6px rgba(31, 216, 164, 0.45);
}
.btn-primary:hover { box-shadow: 0 10px 26px -6px rgba(31, 216, 164, 0.6); transform: translateY(-1px); }
.btn-secondary {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--border);
}
.btn-secondary:hover { background: var(--surface-3); border-color: #2c384e; }
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-danger { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.btn-danger:hover { background: rgba(242, 97, 122, 0.2); }
.btn-block { width: 100%; }
.btn-sm { padding: 0.42rem 0.7rem; font-size: 0.8rem; border-radius: 7px; }
.btn-icon { padding: 0.55rem; }

/* ---- form fields ---- */
label.field {
  display: grid;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}
label.field .hint { color: var(--faint); font-weight: 400; }
input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  width: 100%;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  background: var(--surface-3);
}
textarea { resize: vertical; font-family: var(--font-mono); font-size: 0.82rem; }

/* ---- surfaces ---- */
.card {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg-elev) 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 1.25rem; }
.glass {
  background: rgba(15, 20, 32, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ---- badges / status pills ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.SUCCESS, .badge-ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.badge.PENDING, .badge-warn { color: var(--warn); background: var(--warn-bg); border-color: var(--warn-line); }
.badge.FAILED, .badge-bad { color: var(--bad); background: var(--bad-bg); border-color: var(--bad-line); }

/* ---- misc ---- */
.divider { height: 1px; background: var(--border-soft); border: 0; margin: 1.1rem 0; }
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { 0% { transform: scale(0.6); opacity: 0; } 65% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
.rise { animation: riseIn 0.5s var(--ease) both; }

.callout {
  border-radius: var(--radius-sm);
  border: 1px solid var(--warn-line);
  background: var(--warn-bg);
  color: #ffdca6;
  padding: 0.8rem 0.95rem;
  font-size: 0.85rem;
  line-height: 1.5;
}
.callout.danger { border-color: var(--bad-line); background: var(--bad-bg); color: #ffc4cf; }
.callout.info { border-color: var(--indigo-soft); background: var(--indigo-soft); color: #d7d8ff; }

/* ---- table ---- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
thead th {
  text-align: left;
  padding: 0.7rem 0.85rem;
  color: var(--faint);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}
tbody td {
  padding: 0.85rem;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
  color: var(--ink-soft);
}
tbody tr { transition: background 0.15s var(--ease); }
tbody tr:hover td { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }

/* ---- toast ---- */
.toast {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  max-width: min(420px, calc(100% - 2.2rem));
  background: var(--surface-3);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 0.85rem 1.05rem;
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
  z-index: 80;
}
.toast.show { transform: none; opacity: 1; }
.toast.err { border-color: var(--bad-line); color: #ffc4cf; }
.toast.ok { border-color: var(--ok-line); color: var(--ok); }

/* ---- dialog ---- */
dialog {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.3rem;
  width: min(420px, calc(100% - 2rem));
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgba(4, 7, 12, 0.68); backdrop-filter: blur(2px); }
dialog h3 { font-size: 1.15rem; margin: 0 0 0.5rem; }

/* ---- scrollreveal-ish utility ---- */
.copy-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 0.3rem 0.55rem;
  font-size: 0.72rem;
  cursor: pointer;
}
.copy-btn:hover { color: var(--ink); border-color: var(--brand); }
