:root {
  --bg: #05070d;
  --ink: #e9eefb;
  --muted: #8b9ab3;
  --line: rgba(255, 255, 255, .08);
  --glass: rgba(17, 23, 38, .55);
  --accent: #7c5cff;
  --radius: 20px;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "SF Pro Display", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --- фон --- */
.aurora {
  position: fixed;
  inset: -20%;
  z-index: -2;
  filter: blur(80px);
  opacity: .55;
  pointer-events: none;
}
.aurora span {
  position: absolute;
  width: 46vw;
  height: 46vw;
  border-radius: 50%;
  animation: drift 26s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) { background: radial-gradient(circle, #4c1d95, transparent 65%); top: 2%; left: 4%; }
.aurora span:nth-child(2) { background: radial-gradient(circle, #0e7490, transparent 65%); top: 30%; right: 0; animation-duration: 32s; animation-delay: -8s; }
.aurora span:nth-child(3) { background: radial-gradient(circle, #7c2d12, transparent 65%); bottom: -10%; left: 28%; animation-duration: 38s; animation-delay: -16s; }

@keyframes drift {
  from { transform: translate3d(-4%, -2%, 0) scale(1); }
  to   { transform: translate3d(6%, 5%, 0) scale(1.15); }
}

.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 0%, transparent 40%, rgba(0, 0, 0, .55) 100%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .014) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

/* --- шапка --- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px clamp(18px, 4vw, 56px);
  max-width: 1240px;
  margin: 0 auto;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }

.mark {
  width: 34px; height: 34px; border-radius: 11px;
  background:
    radial-gradient(circle at 30% 25%, #c4b5fd, #7c5cff 45%, #4c1d95 100%);
  box-shadow: 0 0 26px rgba(124, 92, 255, .55), inset 0 1px 0 rgba(255,255,255,.35);
  flex: none;
}
.mark.big { width: 54px; height: 54px; border-radius: 17px; margin: 0 auto 18px; display: block; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 15px; letter-spacing: .02em; }
.brand-text i { font-size: 11px; color: var(--muted); font-style: normal; letter-spacing: .14em; text-transform: uppercase; }

.tools { display: flex; align-items: center; gap: 10px; }

.search {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(13, 18, 30, .6);
  backdrop-filter: blur(14px);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.search:focus-within { border-color: rgba(124, 92, 255, .6); box-shadow: 0 0 0 4px rgba(124, 92, 255, .12); }
.search svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.search input {
  border: 0; outline: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 13px; width: min(34vw, 220px);
}
.search input::placeholder { color: rgba(139, 154, 179, .7); }

.logout {
  color: var(--muted); text-decoration: none; font-size: 12.5px;
  padding: 9px 14px; border-radius: 999px; border: 1px solid transparent;
  transition: color .2s, border-color .2s, background .2s;
}
.logout:hover { color: #fff; border-color: var(--line); background: rgba(255,255,255,.04); }

/* --- контент --- */
main { max-width: 1240px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 56px) 40px; }

.hero { padding: 26px 0 30px; }
.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: -.03em;
  font-weight: 620;
  background: linear-gradient(92deg, #fff 10%, #c7bfff 55%, #7c5cff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { margin: 0; color: var(--muted); font-size: 14.5px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(266px, 1fr));
  gap: 14px;
}

.card {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 17px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(22, 28, 45, .72), rgba(11, 15, 26, .6));
  backdrop-filter: blur(16px) saturate(140%);
  text-decoration: none; color: inherit;
  overflow: hidden;
  isolation: isolate;
  opacity: 0;
  transform: translateY(14px);
  animation: rise .55s cubic-bezier(.22, 1, .36, 1) forwards;
  animation-delay: calc(var(--i) * 45ms);
  transition: transform .28s cubic-bezier(.22, 1, .36, 1), border-color .28s, box-shadow .28s;
}
@keyframes rise { to { opacity: 1; transform: none; } }

.card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--from) 22%, transparent), transparent 70%);
  opacity: 0; transition: opacity .3s ease;
  z-index: -1;
}
.card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--from) 45%, transparent);
  box-shadow: 0 18px 44px -18px color-mix(in srgb, var(--from) 60%, transparent);
}
.card:hover::before { opacity: 1; }

.icon {
  display: grid; place-items: center;
  width: 46px; height: 46px; flex: none;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--from), var(--to));
  box-shadow: 0 8px 22px -10px color-mix(in srgb, var(--from) 80%, transparent), inset 0 1px 0 rgba(255,255,255,.28);
  transition: transform .3s cubic-bezier(.22, 1, .36, 1), box-shadow .3s;
}
.icon svg {
  width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.card:hover .icon { transform: translateY(-1px) rotate(-4deg) scale(1.06); }

.meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.meta b { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.meta i {
  font-style: normal; font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.arrow {
  margin-left: auto; color: var(--muted); font-size: 15px;
  opacity: 0; transform: translate(-4px, 4px);
  transition: opacity .25s, transform .25s;
}
.card:hover .arrow { opacity: 1; transform: none; color: #fff; }

.empty { color: var(--muted); font-size: 14px; padding: 30px 0; }

footer {
  max-width: 1240px; margin: 0 auto;
  padding: 18px clamp(18px, 4vw, 56px) 34px;
  display: flex; align-items: center; gap: 10px;
  color: rgba(139, 154, 179, .7); font-size: 12px;
}
footer .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }

/* --- вход --- */
.login-body { display: grid; place-items: center; min-height: 100dvh; }
.login { width: min(400px, calc(100vw - 36px)); }
.login-card {
  padding: 34px 30px 28px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(24, 31, 50, .82), rgba(10, 14, 24, .72));
  backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .9);
  text-align: center;
  animation: rise .5s cubic-bezier(.22, 1, .36, 1) both;
}
.login-card h1 { margin: 0; font-size: 24px; letter-spacing: -.02em; }
.login-card .sub { margin: 6px 0 24px; color: var(--muted); font-size: 13px; }
.login-card label { display: block; text-align: left; margin-bottom: 14px; }
.login-card label span { display: block; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: rgba(139,154,179,.8); margin-bottom: 6px; }
.login-card input {
  width: 100%; padding: 12px 14px;
  border-radius: 12px; border: 1px solid var(--line);
  background: rgba(5, 8, 14, .6); color: var(--ink);
  font: inherit; font-size: 14px; outline: 0;
  transition: border-color .2s, box-shadow .2s;
}
.login-card input:focus { border-color: rgba(124, 92, 255, .7); box-shadow: 0 0 0 4px rgba(124, 92, 255, .13); }
.login-card button {
  width: 100%; margin-top: 4px; padding: 12px;
  border: 0; border-radius: 12px; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600; color: #fff;
  background: linear-gradient(180deg, #8b6dff, #6a45f5);
  box-shadow: 0 14px 30px -12px rgba(124, 92, 255, .8);
  transition: transform .15s ease, box-shadow .2s;
}
.login-card button:hover { transform: translateY(-1px); box-shadow: 0 18px 36px -12px rgba(124, 92, 255, .9); }
.login-card button:active { transform: translateY(1px); }
.err { margin: 12px 0 0; color: #fb7185; font-size: 12.5px; }
.hint { margin: 20px 0 0; color: rgba(139, 154, 179, .7); font-size: 11.5px; line-height: 1.5; }

@media (max-width: 640px) {
  .top { flex-wrap: wrap; gap: 12px; }
  .search input { width: 40vw; }
  .brand-text i { display: none; }
  .hero { padding: 14px 0 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .aurora span, .card, .login-card { animation: none !important; }
  .card { opacity: 1; transform: none; }
}
