:root {
  /* Base surfaces */
  --bg: #f7f7fb;
  --bg-alt: #eef0f7;
  --surface: #ffffff;
  --surface-2: #fbfbfe;
  --border: #e4e4ef;
  --border-strong: #d3d3e6;

  /* Text */
  --text: #17172b;
  --text-muted: #6b6b85;
  --text-faint: #9a9ab0;

  /* Brand */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef0ff;
  --accent: #10b981;
  --accent-light: #e7f9f1;
  --warn: #f59e0b;
  --danger: #e0455a;
  --danger-light: #fdeef0;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(23, 23, 43, 0.05);
  --shadow-md: 0 4px 16px -4px rgba(23, 23, 43, 0.10);
  --shadow-lg: 0 12px 32px -8px rgba(23, 23, 43, 0.16);
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  min-height: 100vh;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

.font-display { font-family: 'Sora', 'Inter', sans-serif; font-weight: 700; letter-spacing: -0.02em; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* ---------- Layout ---------- */
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) {
  .container { padding: 0 18px; }
}

/* ---------- Nav ---------- */
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0;
}
.brand {
  font-family: 'Sora', sans-serif; font-weight: 700; font-size: 1.3rem;
  color: var(--text); display: flex; align-items: center; gap: 8px;
}
.brand .spark { color: var(--primary); }
.nav-links { display: flex; gap: 28px; align-items: center; font-size: .92rem; }
.nav-links a { color: var(--text-muted); font-weight: 500; }
.nav-links a:hover { color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 22px; border-radius: var(--radius-sm); font-weight: 600; font-size: .92rem;
  border: 1px solid transparent; cursor: pointer; transition: all .15s ease;
  line-height: 1;
}
.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-outline { border-color: var(--border-strong); color: var(--text); background: var(--surface); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger-outline { border-color: var(--danger); color: var(--danger); background: var(--surface); }
.btn-danger-outline:hover { background: var(--danger-light); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Hero ---------- */
.hero { padding: 90px 0 70px; text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-light); color: var(--primary);
  padding: 6px 14px; border-radius: 999px; font-size: .8rem; font-weight: 600;
  margin-bottom: 24px;
}
.hero h1 {
  font-family: 'Sora', sans-serif; font-weight: 700; letter-spacing: -0.03em;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.12; margin: 0 0 20px; color: var(--text);
}
.hero h1 .accent-text { color: var(--primary); }
.hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 560px; margin: 0 auto 34px; line-height: 1.6; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- Cards / panels ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.feature-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin-bottom: 16px;
}
.feature-title { font-weight: 700; margin-bottom: 6px; font-size: 1.02rem; }
.feature-desc { color: var(--text-muted); font-size: .9rem; line-height: 1.6; }

/* ---------- Forms ---------- */
.form-page { max-width: 440px; margin: 70px auto; padding: 0 24px; }
.form-title { font-family: 'Sora', sans-serif; font-weight: 700; font-size: 1.7rem; text-align: center; margin-bottom: 6px; letter-spacing: -0.02em; }
.form-subtitle { color: var(--text-muted); text-align: center; margin-bottom: 32px; font-size: .92rem; }
label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 7px; color: var(--text); }
input[type=email], input[type=password], input[type=text], input[type=number], textarea, select {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border-strong);
  color: var(--text); font-size: .95rem; margin-bottom: 18px; font-family: inherit;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-footer { text-align: center; margin-top: 20px; font-size: .88rem; color: var(--text-muted); }
.alert {
  padding: 13px 16px; border-radius: var(--radius-sm); font-size: .88rem; margin-bottom: 18px;
  border: 1px solid; line-height: 1.5;
}
.alert-error { background: var(--danger-light); border-color: #f3c6cd; color: #a3283b; }
.alert-success { background: var(--accent-light); border-color: #b8ecd5; color: #0d7a52; }
.alert-info { background: var(--primary-light); border-color: #c7c9fb; color: #3730a3; }

/* ---------- Dashboard ---------- */
.dash-header { padding: 30px 0 8px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.dash-header h1 { font-family: 'Sora', sans-serif; font-size: 1.7rem; margin: 0 0 4px; font-weight: 700; letter-spacing: -0.02em; }
.dash-header p { color: var(--text-muted); font-size: .9rem; margin: 0; }

.key-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 18px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border);
  margin-bottom: 12px; flex-wrap: wrap; box-shadow: var(--shadow-sm);
}
.key-value {
  font-family: 'SFMono-Regular', Consolas, monospace; font-size: .84rem; color: var(--primary);
  background: var(--primary-light); padding: 7px 11px; border-radius: 8px;
  overflow-x: auto; max-width: 100%;
}
.badge {
  font-size: .68rem; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--text-muted); text-transform: uppercase; letter-spacing: .02em;
}
.badge-live { color: #0d7a52; border-color: #b8ecd5; background: var(--accent-light); }
.badge-revoked { color: #a3283b; border-color: #f3c6cd; background: var(--danger-light); }
.badge-processing { color: #92600a; border-color: #f6ddab; background: #fef6e7; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin: 22px 0; }
.stat-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 20px; box-shadow: var(--shadow-sm); }
.stat-value { font-size: 1.9rem; font-weight: 700; color: var(--text); font-family: 'Sora', sans-serif; letter-spacing: -0.02em; }
.stat-label { color: var(--text-muted); font-size: .82rem; margin-top: 4px; }

/* Agent cards */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin: 24px 0; }
.agent-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm); transition: box-shadow .15s ease, transform .1s ease;
}
.agent-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.agent-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.agent-name { font-weight: 700; font-size: 1.05rem; }
.agent-meta { color: var(--text-muted); font-size: .82rem; margin-top: 8px; }
.agent-card-actions { display: flex; gap: 8px; margin-top: 16px; }

.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
}

/* ---------- Docs / code blocks ---------- */
pre {
  background: #14142b; border: 1px solid #24243f; border-radius: var(--radius-sm);
  padding: 18px; overflow-x: auto; font-size: .85rem; line-height: 1.6; color: #e4e4f7;
}
code { color: #a5b4fc; font-family: 'SFMono-Regular', Consolas, monospace; }
:not(pre) > code { background: var(--primary-light); color: var(--primary-hover); padding: 2px 6px; border-radius: 5px; }
.docs-section { margin: 36px 0; }
.docs-section h2 { font-family: 'Sora', sans-serif; font-size: 1.25rem; font-weight: 700; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); padding: 30px 0; margin-top: 60px; text-align: center; color: var(--text-faint); font-size: .82rem; }

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .nav-links { gap: 16px; font-size: .85rem; }
  .hero { padding: 56px 0 40px; }
  .key-row { flex-direction: column; align-items: flex-start; }
  .card { padding: 20px; }
  .dash-header { padding: 24px 0 4px; }
}
