:root {
  --bg: #07070d;
  --surface: #111118;
  --surface-2: #1a1a24;
  --border: #2a2a3a;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.25);
  --success: #22c55e;
  --danger: #ef4444;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --radius: 12px;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(168, 85, 247, 0.06) 0%, transparent 50%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.5px;
  margin-bottom: 24px;
}

h1 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.subtitle { color: var(--muted); font-size: 14px; margin-bottom: 28px; }

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 6px;
}
.form-group input {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus { border-color: var(--accent); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: white;
  width: 100%;
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 0 24px var(--accent-glow); }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
.btn-sm { padding: 8px 16px; font-size: 13px; width: auto; }

.form-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--muted);
}

.alert {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 18px;
}
.alert-error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; }
.alert-success { background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.3); color: #86efac; }
.alert-info { background: rgba(99, 102, 241, 0.1); border: 1px solid rgba(99, 102, 241, 0.3); color: #a5b4fc; }

/* Dashboard */
.dashboard { min-height: 100vh; }
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.nav-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-user { font-size: 14px; color: var(--muted); }

.main { max-width: 900px; margin: 0 auto; padding: 40px 24px; }
.main h2 { font-size: 28px; margin-bottom: 8px; }
.main .lead { color: var(--muted); margin-bottom: 32px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  margin-bottom: 24px;
}
.card h3 { font-size: 18px; margin-bottom: 6px; }
.card p { color: var(--muted); font-size: 14px; margin-bottom: 20px; }

.mcp-url-box {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 4px 4px 16px;
}
.mcp-url-box code {
  flex: 1;
  font-size: 14px;
  color: var(--accent-hover);
  word-break: break-all;
}
.mcp-url-box .btn { flex-shrink: 0; }

.steps { list-style: none; counter-reset: step; }
.steps li {
  counter-increment: step;
  padding: 16px 0 16px 48px;
  position: relative;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.steps li:last-child { border-bottom: none; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.steps li strong { display: block; margin-bottom: 4px; font-size: 15px; }
.steps li span { color: var(--muted); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-success { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.consent-card { max-width: 480px; }
.consent-details {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 24px;
}
.consent-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.consent-row:last-child { border-bottom: none; }
.consent-row span { color: var(--muted); }
.consent-actions { display: flex; gap: 12px; }
.consent-actions .btn-primary { flex: 1; width: auto; }
.consent-actions .btn-ghost { flex: 0; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.feature-item {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}
.feature-item .emoji { font-size: 32px; margin-bottom: 8px; }
.feature-item h4 { font-size: 14px; margin-bottom: 4px; }
.feature-item p { font-size: 12px; color: var(--muted); }

@media (max-width: 600px) {
  .auth-card { padding: 28px 20px; }
  .nav { padding: 12px 16px; }
  .mcp-url-box { flex-direction: column; align-items: stretch; padding: 12px; }
}