:root {
  --accent: #8b5cf6;
  --accent2: #ec4899;
}

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

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a12;
  color: #f0f0f5;
  padding: 24px;
}

.bg {
  position: fixed; inset: 0; z-index: -1;
  overflow: hidden;
}
.bg::before, .bg::after {
  content: "";
  position: absolute;
  width: 55vmax; height: 55vmax;
  border-radius: 50%;
  filter: blur(100px);
  animation: drift 20s ease-in-out infinite alternate;
}
.bg::before { background: var(--accent); top: -18vmax; left: -14vmax; opacity: 0.45; }
.bg::after { background: var(--accent2); bottom: -20vmax; right: -14vmax; opacity: 0.4; animation-delay: -10s; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(10vmax, -7vmax) scale(1.12); }
}

.wrap { width: min(92vw, 420px); text-align: center; }

.brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 8px; }
.logo {
  width: 46px; height: 46px;
  border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  box-shadow: 0 10px 30px rgba(139,92,246,0.4);
}
.brand h1 { font-size: 1.9rem; letter-spacing: 1px; }
.tag { color: rgba(240,240,245,0.6); margin-bottom: 30px; font-size: 0.95rem; }

.card {
  background: rgba(22,22,34,0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 28px 26px 22px;
  text-align: left;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}

.tabs { display: flex; background: rgba(255,255,255,0.05); border-radius: 10px; padding: 4px; margin-bottom: 22px; }
.tab {
  flex: 1; padding: 9px;
  border: none; border-radius: 8px;
  background: none; color: #9a9aab;
  font: inherit; font-size: 0.9rem; font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tab.active { background: linear-gradient(135deg, var(--accent), #a855f7); color: #fff; }

label { display: block; font-size: 0.82rem; color: #9a9aab; margin-bottom: 14px; }
input {
  display: block; width: 100%;
  margin-top: 6px;
  background: #1c1c2c;
  border: 1px solid rgba(255,255,255,0.08);
  color: #f0f0f5;
  font: inherit;
  padding: 11px 13px;
  border-radius: 9px;
  outline: none;
  transition: border-color 0.15s;
}
input:focus { border-color: var(--accent); }

.hint { font-size: 0.8rem; color: #9a9aab; margin-bottom: 16px; min-height: 18px; }

.btn {
  width: 100%;
  padding: 12px;
  border: none; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  color: #fff; font: inherit; font-size: 0.95rem; font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(139,92,246,0.35);
  transition: filter 0.15s, transform 0.12s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }

.error { color: #f87171; font-size: 0.85rem; margin-top: 12px; min-height: 18px; }
.info { margin-top: 18px; border-top: 1px solid rgba(255,255,255,0.07); padding-top: 14px; }
.info p { font-size: 0.82rem; color: #9a9aab; line-height: 1.5; }

.foot {
  margin-top: 26px;
  font-size: 0.72rem; letter-spacing: 2px; text-transform: uppercase;
  color: rgba(240,240,245,0.35);
}

/* ---------- Front page (home) ---------- */

body.home { display: block; padding: 44px 24px 64px; }
body.home .wrap { width: min(92vw, 860px); margin: 0 auto; text-align: center; }

.hero { margin-bottom: 44px; }
.hero .logo { width: 58px; height: 58px; font-size: 1.8rem; border-radius: 16px; }
.hero .brand h1 { font-size: 2.4rem; }
.hero .tag { margin-bottom: 26px; }

.auth-btns { display: flex; gap: 12px; justify-content: center; }
.auth-btns .btn { width: auto; min-width: 150px; padding: 12px 22px; text-decoration: none; }
.btn.ghost { background: rgba(255,255,255,0.06); color: #f0f0f5; box-shadow: none; border: 1px solid rgba(255,255,255,0.12); }
.btn.ghost:hover { background: rgba(255,255,255,0.1); }

.dir-head {
  font-size: 0.85rem; letter-spacing: 2px; text-transform: uppercase;
  color: rgba(240,240,245,0.45); margin-bottom: 18px; text-align: center;
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.pcard {
  display: flex; align-items: center; gap: 12px;
  background: rgba(22,22,34,0.85);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px; padding: 14px;
  text-decoration: none; color: #f0f0f5;
  transition: transform 0.12s, border-color 0.12s;
}
.pcard:hover { transform: translateY(-2px); border-color: var(--accent); }
.pcard .av {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-weight: 700; font-size: 0.9rem;
  display: inline-flex; align-items: center; justify-content: center;
  overflow: hidden; flex-shrink: 0;
}
.pcard .av img { width: 100%; height: 100%; object-fit: cover; }
.pcard .who { min-width: 0; text-align: left; }
.pcard .who b { display: block; font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard .who span { font-size: 0.78rem; color: #9a9aab; }

.empty { text-align: center; padding: 40px 0 20px; color: rgba(240,240,245,0.5); }

/* ---------- Auth pages ---------- */

.alt { margin-top: 18px; text-align: center; font-size: 0.85rem; color: #9a9aab; }
.alt a { color: var(--accent); text-decoration: none; font-weight: 600; }
.alt a:hover { text-decoration: underline; }

.err-line { color: #f87171; font-size: 0.85rem; min-height: 18px; margin-top: 12px; text-align: center; }
