:root {
  --bg: #0f1117;
  --surface: #171b26;
  --surface-hover: #1e2433;
  --border: #2a3142;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --primary: #f59e0b;
  --primary-hover: #d97706;
  --danger: #ef4444;
  --success: #10b981;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

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

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.topbar {
  background: rgba(23, 27, 38, 0.9);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none !important;
}

.brand-icon {
  font-size: 24px;
}

.brand-title {
  font-weight: 700;
  font-size: 18px;
}

.brand-sub {
  font-size: 13px;
  color: var(--primary);
  margin-left: 4px;
  font-weight: 600;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}

.nav-links a {
  color: var(--muted);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  text-decoration: none;
}

.main-content {
  padding-top: 36px;
  padding-bottom: 64px;
  min-height: calc(100vh - 140px);
}

.hero {
  text-align: center;
  max-width: 780px;
  margin: 20px auto 48px;
}

.hero h1 {
  font-size: 36px;
  line-height: 1.2;
  margin: 16px 0;
}

.hero-lead {
  color: var(--muted);
  font-size: 17px;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--primary);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card h2, .card h3 {
  margin-top: 0;
}

.auth-card {
  max-width: 460px;
  margin: 20px auto;
}

.muted {
  color: var(--muted);
  font-size: 14px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #cbd5e1;
}

.form-group input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #0b0e14;
  color: var(--text);
  font-size: 14px;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 7px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none !important;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: #0b0e14 !important;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text) !important;
}

.btn-outline:hover {
  background: var(--surface-hover);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5 !important;
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.28);
}

.hidden {
  display: none !important;
}

.mt-4 {
  margin-top: 24px;
}

.kv-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.kv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.kv-label {
  color: var(--muted);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th, .table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.token-reveal {
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.4);
  font-size: 13px;
}

.token-copy-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.token-copy-row code {
  flex: 1;
  padding: 8px 10px;
  background: #0b0e14;
  border-radius: 6px;
  border: 1px solid var(--border);
  word-break: break-all;
  color: #34d399;
}

.download-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  background: #0b0e14;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 16px 0;
  flex-wrap: wrap;
}

.divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 24px 0;
}

.steps-list {
  padding-left: 20px;
}

.steps-list li {
  margin-bottom: 12px;
}

.version-pill {
  font-size: 12px;
  padding: 6px 12px;
  background: #0b0e14;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
}

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.footer {
  display: flex;
  justify-content: space-between;
  padding: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12.5px;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
}
