/* ── Tokens ───────────────────────────────────────────────── */
:root {
  --bg:        #0f1117;
  --surface:   #1a1d27;
  --border:    #2a2d3a;
  --accent:    #00d4aa;
  --accent-dk: #00a884;
  --danger:    #ff5c5c;
  --success:   #00d4aa;
  --text:      #e2e4ec;
  --muted:     #6b7080;
  --mono:      "JetBrains Mono", "Fira Code", "Courier New", monospace;
  --sans:      "Inter", system-ui, sans-serif;
  --radius:    10px;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ──────────────────────────────────────────────── */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2rem;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
}

.card-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.dashboard-wrap {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 1rem;
}

/* ── Card ────────────────────────────────────────────────── */
.card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ── Tabs ────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.tab {
  flex: 1;
  padding: 0.85rem;
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.tab:hover { color: var(--text); }

.tab.active {
  color: var(--accent);
  background: rgba(0, 212, 170, 0.06);
  border-bottom: 2px solid var(--accent);
}

/* ── Form ────────────────────────────────────────────────── */
.auth-form {
  padding: 1.75rem 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.form-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.form-sub {
  font-size: 0.825rem;
  color: var(--muted);
  margin-top: -0.4rem;
  margin-bottom: 0.2rem;
}

.field-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: -0.5rem;
}

.field {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.9rem;
  transition: border-color 0.15s;
  outline: none;
}

.field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.12);
}

.field::placeholder { color: var(--muted); }

/* ── Alert ───────────────────────────────────────────────── */
.alert {
  font-size: 0.825rem;
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  border-left: 3px solid var(--danger);
  background: rgba(255, 92, 92, 0.08);
  color: var(--danger);
}

.alert.success {
  border-left-color: var(--success);
  background: rgba(0, 212, 170, 0.08);
  color: var(--success);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-primary {
  margin-top: 0.4rem;
  width: 100%;
  padding: 0.75rem;
  background: var(--accent);
  color: #0f1117;
  border: none;
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background 0.15s, transform 0.1s;
}

.btn-primary:hover  { background: var(--accent-dk); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 0.45rem 0.9rem;
  font-family: var(--sans);
  font-size: 0.825rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.btn-ghost:hover { color: var(--text); border-color: var(--muted); }

/* ── Spinner ─────────────────────────────────────────────── */
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: #0f1117;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footnote ────────────────────────────────────────────── */
.footnote {
  margin-top: 1.25rem;
  font-size: 0.775rem;
  color: var(--muted);
  text-align: center;
}

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

/* ── Dashboard ───────────────────────────────────────────── */
.dashboard-card { max-width: 480px; padding: 2rem; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(0, 212, 170, 0.1);
  border: 1px solid rgba(0, 212, 170, 0.25);
  border-radius: 100px;
  padding: 0.25rem 0.75rem;
  margin-bottom: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

.dash-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
}

.dash-sub {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.4rem;
  margin-bottom: 1.5rem;
}

.user-info {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
}

.info-row:last-child { border-bottom: none; }

.info-label {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.info-value {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text);
  text-align: right;
  word-break: break-all;
}

.token-pill {
  background: rgba(0, 212, 170, 0.1);
  color: var(--accent);
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
}

.endpoint-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
}

.endpoint-label {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.endpoint-code {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  display: block;
}

/* ── Utility ─────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .site-header { padding: 1rem; }
  .auth-form   { padding: 1.25rem; }
}
