:root {
  --bg: #f6f6fb;
  --fg: #14141f;
  --muted: #5d5d73;
  --card: rgba(255, 255, 255, 0.72);
  --border: rgba(20, 20, 40, 0.08);
  --accent: #6d5efc;
  --accent2: #e45cc4;
  --accent3: #2bb3f0;
  --error: #c0362c;
  --shadow: 0 20px 60px -20px rgba(40, 30, 120, 0.25);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b12;
    --fg: #ececf4;
    --muted: #9a9ab0;
    --card: rgba(22, 22, 34, 0.7);
    --border: rgba(255, 255, 255, 0.08);
    --error: #ff7a6e;
    --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[hidden] { display: none !important; }

/* Background */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.blob {
  position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%;
  filter: blur(80px); opacity: 0.35; animation: drift 22s ease-in-out infinite alternate;
}
.b1 { background: var(--accent); top: -18vmax; left: -12vmax; }
.b2 { background: var(--accent2); bottom: -20vmax; right: -14vmax; animation-delay: -7s; }
.b3 { background: var(--accent3); top: 30%; left: 45%; width: 30vmax; height: 30vmax; opacity: 0.22; animation-delay: -14s; }
@keyframes drift {
  to { transform: translate(6vmax, 4vmax) scale(1.12); }
}
@media (prefers-reduced-motion: reduce) { .blob { animation: none; } }

/* Layout */
.center {
  min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
}
#app .center { min-height: calc(100vh - 72px); }

.card {
  width: 100%; max-width: 400px; text-align: center;
  padding: 40px 32px 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  animation: rise 0.5s cubic-bezier(.2,.8,.2,1);
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

.logo {
  width: 56px; height: 56px; margin: 0 auto 20px; border-radius: 16px; color: #fff;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 10px 30px -8px var(--accent);
}
.logo svg { width: 60%; height: 60%; }
.logo.sm { width: 30px; height: 30px; margin: 0; border-radius: 9px; box-shadow: none; }

h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; }
h2 { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 8px; }
.grad {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.muted { color: var(--muted); margin: 0 0 28px; line-height: 1.5; }
.fine { color: var(--muted); font-size: 12px; margin: 24px 0 0; line-height: 1.5; opacity: 0.8; }
.error { color: var(--error); font-size: 14px; margin: 16px 0 0; }

.gbtn { display: flex; justify-content: center; min-height: 44px; }

/* Top bar */
.topbar {
  height: 72px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--card);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; }
.user { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.user img { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); }
#uname { font-weight: 500; }
.ghost {
  font: inherit; font-size: 13px; font-weight: 500; color: var(--fg);
  background: transparent; border: 1px solid var(--border); border-radius: 10px;
  padding: 7px 12px; cursor: pointer; transition: background 0.15s;
}
.ghost:hover { background: var(--border); }

.empty { text-align: center; animation: rise 0.5s cubic-bezier(.2,.8,.2,1); }

@media (max-width: 520px) {
  #uname { display: none; }
  .topbar { padding: 0 16px; }
  .card { padding: 32px 20px 24px; }
}

/* Loading */
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
