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

:root {
  --bg: #0b0d14;
  --surface: #151824;
  --surface-2: #1c2032;
  --border: #2a2f45;
  --text: #e8eaf2;
  --text-dim: #9aa0b5;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --danger: #f87171;
  --radius: 14px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #1e1b4b55, transparent), var(--bg);
  color: var(--text);
  min-height: 100vh;
}

#app {
  max-width: 860px;
  margin: 0 auto;
  padding: 48px 20px;
}

.loading { text-align: center; color: var(--text-dim); padding: 80px 0; }

/* ---- Login ---- */
.login-wrap {
  max-width: 380px;
  margin: 10vh auto 0;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
}
.login-card h1 {
  font-size: 22px;
  margin-bottom: 4px;
}
.login-card .sub {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 24px;
}
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 15px;
}
.field input:focus { outline: none; border-color: var(--accent); }

button {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
}
.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: white;
  margin-top: 6px;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  margin-top: 10px;
}
.btn-ghost:hover { border-color: var(--accent); }

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  font-size: 12px;
  margin: 18px 0 8px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.error {
  background: #7f1d1d33;
  border: 1px solid #7f1d1d;
  color: #fca5a5;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}

/* ---- Dashboard ---- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}
.topbar h1 { font-size: 20px; }
.topbar .who { color: var(--text-dim); font-size: 13px; }
.topbar button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 8px 14px;
  font-size: 13px;
}
.topbar button:hover { color: var(--text); border-color: var(--accent); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.tile {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.tile .icon { font-size: 34px; display: block; margin-bottom: 12px; }
.tile .title { font-weight: 700; font-size: 16px; }
.tile .desc { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

/* ---- Passkeys ---- */
.section {
  margin-top: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.section h2 { font-size: 16px; margin-bottom: 4px; }
.section .sub { color: var(--text-dim); font-size: 13px; margin-bottom: 16px; }
.pk-list { list-style: none; }
.pk-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.pk-list li:last-child { border-bottom: none; }
.pk-list .meta { color: var(--text-dim); font-size: 12px; }
.pk-list button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--danger);
  padding: 6px 10px;
  font-size: 12px;
}
.section .btn-ghost { width: auto; padding: 10px 16px; }
