/* ==========================================================
   OPENBANK — Production Stylesheet (Light Theme)
   Stripe-inspired: clean white, strong hierarchy, trust-first
   Fonts: Inter (system fallback), DM Mono for numbers/code
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=DM+Mono:wght@300;400;500&display=swap');

/* ── CSS Variables ───────────────────────────────────────── */
:root {
  /* Palette — Stripe-inspired light with teal accent */
  --navy-950:   #f6f9fc;
  --navy-900:   #f0f4f8;
  --navy-800:   #e3e8ee;
  --navy-700:   #c1c9d2;
  --navy-600:   #a3acb9;

  --bg-page:    #f6f9fc;
  --bg-card:    #ffffff;
  --bg-card-hover: #f9fafb;
  --bg-elevated:#f0f4f8;
  --bg-subtle:  #f4f7fa;

  --border:     rgba(0,0,0,0.08);
  --border-med: rgba(0,0,0,0.12);
  --border-strong: rgba(0,0,0,0.18);

  /* Accent — teal (darkened for light bg contrast) */
  --teal:       #00b894;
  --teal-dim:   #00a381;
  --teal-glow:  rgba(0,184,148,0.10);
  --teal-glow-strong: rgba(0,184,148,0.20);

  /* Purple gradient (Stripe's secret sauce) */
  --purple:     #6772e5;
  --purple-dim: #4f58d4;
  --purple-glow:rgba(103,114,229,0.10);

  /* Warm amber for earnings */
  --amber:      #d97706;
  --amber-glow: rgba(217,119,6,0.10);

  /* Status */
  --green:      #059669;
  --green-bg:   rgba(5,150,105,0.08);
  --red:        #dc2626;
  --red-bg:     rgba(220,38,38,0.08);
  --yellow:     #d97706;
  --yellow-bg:  rgba(217,119,6,0.08);
  --blue:       #2563eb;
  --blue-bg:    rgba(37,99,235,0.08);

  /* Text */
  --text-primary:   #1a1f36;
  --text-secondary: #697386;
  --text-muted:     #8898aa;
  --text-disabled:  #adb5bd;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'DM Mono', 'Fira Code', 'Consolas', monospace;

  /* Spacing */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  16px;
  --r-xl:  24px;
  --r-2xl: 32px;

  /* Shadows */
  --shadow-card:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lift:  0 8px 32px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-glow-teal: 0 0 40px rgba(0,184,148,0.12);

  /* Transitions */
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
  --fast:      150ms;
  --med:       250ms;
  --slow:      400ms;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { background: var(--bg-page); color: var(--text-secondary); font-family: var(--font-sans); font-size: 16px; line-height: 1.6; min-height: 100vh; }
a { color: var(--teal); text-decoration: none; transition: color var(--fast); }
a:hover { color: var(--text-primary); }
img { display: block; max-width: 100%; }
button { font-family: var(--font-sans); }

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3, h4, h5 { color: var(--text-primary); line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.75rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
.mono { font-family: var(--font-mono); }
.text-muted { color: var(--text-muted); }
.text-teal  { color: var(--teal); }
.text-green { color: var(--green); }
.text-amber { color: var(--amber); }
.text-secondary { color: var(--text-secondary); }

/* ── Layout ──────────────────────────────────────────────── */
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.container-wide { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 32px; }
.section { padding: 96px 0; }
.section-sm { padding: 64px 0; }
@media(max-width:768px){ .section { padding: 64px 0; } .container { padding: 0 16px; } }

/* ── Navigation ──────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: 64px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  display: flex; align-items: center;
}
.nav-inner {
  display: flex; align-items: center;
  width: 100%; max-width: 1120px;
  margin: 0 auto; padding: 0 24px;
  gap: 0;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.1rem; font-weight: 700; color: var(--text-primary);
  letter-spacing: -0.02em; white-space: nowrap; margin-right: 40px;
}
.nav-mark {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--teal), var(--teal-dim));
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; color: #ffffff; font-weight: 800;
}
.nav-links { display: flex; align-items: center; gap: 2px; list-style: none; flex: 1; }
.nav-links a {
  color: var(--text-secondary); font-size: 0.875rem; font-weight: 500;
  padding: 6px 14px; border-radius: var(--r-sm); transition: all var(--fast);
}
.nav-links a:hover, .nav-links a.active { color: var(--text-primary); background: rgba(0,0,0,0.04); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-link-text { color: var(--text-secondary); font-size: 0.875rem; padding: 6px 14px; cursor: pointer; }
.nav-link-text:hover { color: var(--text-primary); }
@media(max-width:768px){ .nav-links { display: none; } .nav-logo { margin-right: auto; } }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--r-sm);
  font-size: 0.875rem; font-weight: 500; cursor: pointer;
  border: none; transition: all var(--fast) var(--ease);
  white-space: nowrap; line-height: 1;
  text-decoration: none;
}
.btn-primary {
  background: var(--teal); color: #ffffff;
  box-shadow: 0 1px 3px rgba(0,184,148,0.30);
}
.btn-primary:hover {
  background: #00a381; color: #ffffff;
  box-shadow: 0 4px 14px rgba(0,184,148,0.35);
  transform: translateY(-1px);
}
.btn-secondary {
  background: #ffffff;
  color: var(--text-primary);
  border: 1px solid var(--border-med);
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.btn-secondary:hover {
  background: #f9fafb;
  border-color: var(--border-strong);
  color: var(--text-primary);
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}
.btn-ghost {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(0,0,0,0.03); color: var(--text-primary); border-color: var(--border-med); }
.btn-sm { padding: 7px 16px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-xl { padding: 16px 36px; font-size: 1.05rem; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }
.btn-purple { background: var(--purple); color: #fff; }
.btn-purple:hover { background: #7b86ee; color: #fff; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
}
.card:hover { border-color: var(--border-med); }
.card-elevated { background: var(--bg-elevated); border-color: var(--border-med); }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
label { font-size: 0.78rem; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
input, select, textarea {
  background: #ffffff; border: 1px solid var(--border-med);
  border-radius: var(--r-sm); color: var(--text-primary);
  font-family: var(--font-sans); font-size: 0.9rem;
  padding: 10px 14px; width: 100%; outline: none;
  transition: border-color var(--fast), box-shadow var(--fast);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-glow);
}
input::placeholder, textarea::placeholder { color: var(--text-disabled); }
select { cursor: pointer; }
textarea { resize: vertical; min-height: 100px; }
.input-group { display: flex; gap: 0; }
.input-group input { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.input-group .btn { border-radius: 0 var(--r-sm) var(--r-sm) 0; flex-shrink: 0; }

/* ── Status Badges ───────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 100px;
  font-size: 0.72rem; font-weight: 500; font-family: var(--font-mono);
}
.badge::before { content:''; width:6px; height:6px; border-radius:50%; flex-shrink:0; }
.badge-online    { background:var(--green-bg);  color:var(--green);  }
.badge-online::before  { background:var(--green); box-shadow:0 0 5px var(--green); animation:pulse-dot 2s infinite; }
.badge-degraded  { background:var(--yellow-bg); color:var(--yellow); }
.badge-degraded::before { background:var(--yellow); }
.badge-offline   { background:var(--red-bg);    color:var(--red);    }
.badge-offline::before  { background:var(--red); }
.badge-completed { background:var(--green-bg);  color:var(--green);  }
.badge-completed::before{ background:var(--green); }
.badge-failed    { background:var(--red-bg);    color:var(--red);    }
.badge-failed::before   { background:var(--red); }
.badge-pending   { background:var(--blue-bg);   color:var(--blue);   }
.badge-pending::before  { background:var(--blue); }
@keyframes pulse-dot { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead { background: var(--bg-elevated); }
th {
  text-align: left; padding: 11px 16px; font-size: 0.72rem; font-weight: 500;
  color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase;
  border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none;
}
td { padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--text-secondary); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(0,0,0,0.02); }
.td-mono { font-family: var(--font-mono); font-size: 0.8rem; }

/* ── Code block ──────────────────────────────────────────── */
.code-block {
  background: #f4f6f9; border: 1px solid var(--border-med);
  border-radius: var(--r-md); padding: 20px 24px;
  font-family: var(--font-mono); font-size: 0.82rem;
  color: #1a1f36; line-height: 1.7; overflow-x: auto;
}
.code-block .kw  { color: #7c3aed; }
.code-block .str { color: #059669; }
.code-block .num { color: #dc2626; }
.code-block .cmt { color: #8898aa; font-style: italic; }
.code-block .fn  { color: #2563eb; }
.code-block .var { color: #1a1f36; }

/* ── Eyebrow labels ──────────────────────────────────────── */
.eyebrow {
  display: inline-block;
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--teal);
  margin-bottom: 14px;
}
.eyebrow-purple { color: var(--purple); }

/* ── Divider ─────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

/* ── Toast ───────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  background: #ffffff; border: 1px solid var(--border-med);
  border-radius: var(--r-sm); padding: 12px 18px;
  font-size: 0.875rem; color: var(--text-primary);
  box-shadow: var(--shadow-lift);
  display: flex; align-items: center; gap: 10px;
  pointer-events: all; max-width: 360px;
  animation: toast-in var(--med) var(--ease);
}
.toast-success { border-left: 3px solid var(--green); }
.toast-error   { border-left: 3px solid var(--red); }
.toast-info    { border-left: 3px solid var(--blue); }
@keyframes toast-in { from{transform:translateX(120%);opacity:0} to{transform:translateX(0);opacity:1} }

/* ── Skeleton ────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, #e8ecf1 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.skeleton-text  { height: 14px; border-radius: 4px; }
.skeleton-title { height: 28px; border-radius: 4px; }

/* ── Grid helpers ────────────────────────────────────────── */
.grid-2 { display:grid; grid-template-columns:repeat(2,1fr); gap:20px; }
.grid-3 { display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
.grid-4 { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
@media(max-width:900px){ .grid-4{grid-template-columns:repeat(2,1fr)} .grid-3{grid-template-columns:repeat(2,1fr)} }
@media(max-width:600px){ .grid-4,.grid-3,.grid-2{grid-template-columns:1fr} }

/* ── Utilities ───────────────────────────────────────────── */
.flex            { display: flex; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mt-32  { margin-top: 32px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.font-mono  { font-family: var(--font-mono); }

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-page); }
::-webkit-scrollbar-thumb { background: #c1c9d2; border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: #a3acb9; }
::selection { background: var(--teal-glow-strong); color: var(--text-primary); }
