@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@400;600;800;900&family=Rubik:ital,wght@0,400;0,500;0,700;0,800;1,400&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
  --bg: #060309;
  --bg2: #0d0616;
  --card: rgba(255, 255, 255, .04);
  --card-border: rgba(255, 255, 255, .09);
  --text: #f2eefc;
  --muted: #9d94b8;
  --accent: #8b5cf6;
  --accent2: #e553ff;
  --cyan: #22d3ee;
  --ok: #34d399;
  --bad: #fb7185;
  --gold: #fbbf24;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html, body { min-height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: .01em;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* animated aurora + wallpaper */
body::before {
  content: ""; position: fixed; inset: -20%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(38% 45% at 78% 8%, rgba(229, 83, 255, .16), transparent 65%),
    radial-gradient(45% 50% at 12% 85%, rgba(139, 92, 246, .17), transparent 60%),
    radial-gradient(30% 35% at 55% 45%, rgba(34, 211, 238, .07), transparent 65%),
    linear-gradient(165deg, #08040f, #0d0718 55%, #12081f);
  animation: drift 26s ease-in-out infinite alternate;
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.35) 1px, transparent 1.4px);
  background-size: 46px 46px;
  opacity: .05;
  mask-image: radial-gradient(70% 70% at 50% 30%, #000 30%, transparent 100%);
}
@keyframes drift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(2.5%, -2%, 0) scale(1.05); }
  100% { transform: translate3d(-2%, 2%, 0) scale(1.02); }
}

.bg-glow { display: none; }

/* ============ header ============ */
.top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 5vw, 48px);
  backdrop-filter: blur(18px) saturate(1.3);
  background: linear-gradient(180deg, rgba(6,3,9,.85), rgba(6,3,9,.55));
  border-bottom: 1px solid var(--card-border);
}
.top::after {
  content: ""; position: absolute; left: clamp(16px,5vw,48px); right: clamp(16px,5vw,48px);
  bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(229,83,255,.55), transparent);
}

.logo {
  font-family: "Unbounded", system-ui, sans-serif;
  font-weight: 900; letter-spacing: .24em; font-size: 19px;
  color: var(--text); text-decoration: none;
}
.logo span {
  background: linear-gradient(115deg, var(--accent), var(--accent2) 60%, var(--cyan));
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 5s linear infinite;
}
@keyframes shine { to { background-position: 200% 0; } }

nav { display: flex; gap: 4px; align-items: center; }
.navlink {
  color: var(--muted); text-decoration: none; font-weight: 700; font-size: 14px;
  padding: 9px 16px; border-radius: 999px; transition: .18s;
  border: 1px solid transparent;
}
.navlink:hover { color: var(--text); background: rgba(255,255,255,.06); }
.navlink.active {
  color: #fff; border-color: rgba(229,83,255,.4);
  background: linear-gradient(120deg, rgba(139,92,246,.25), rgba(229,83,255,.25));
  box-shadow: 0 0 18px rgba(229,83,255,.18);
}
.navlink.quit:hover { color: var(--bad); background: rgba(251,113,133,.1); border-color: rgba(251,113,133,.35); }

main { flex: 1; padding: clamp(22px, 4vw, 48px); max-width: 1080px; margin: 0 auto; width: 100%; }

/* ============ hero ============ */
.hero { text-align: center; padding: clamp(30px, 7vw, 84px) 0 30px; animation: rise .7s ease both; }
.hero h1 {
  font-family: "Unbounded", system-ui, sans-serif;
  font-size: clamp(40px, 9vw, 92px); font-weight: 900; letter-spacing: .1em; line-height: 1.04;
}
.hero h1 span {
  background: linear-gradient(115deg, var(--accent), var(--accent2) 45%, var(--cyan) 90%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 6s linear infinite;
  filter: drop-shadow(0 0 26px rgba(229,83,255,.35));
}
.tagline { color: var(--muted); font-size: 17px; margin: 16px auto 24px; max-width: 580px; line-height: 1.6; }
.hero-badges { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.hero-badges span {
  border: 1px solid var(--card-border); border-radius: 999px;
  padding: 9px 18px; font-size: 13px; font-weight: 600; color: var(--muted);
  background: var(--card); backdrop-filter: blur(8px);
  transition: .2s;
}
.hero-badges span:hover { color: var(--text); border-color: rgba(229,83,255,.4); }

/* ============ cards / glass ============ */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.025));
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 28px;
  backdrop-filter: blur(14px);
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  overflow: visible;
}
.card::before {
  content: ""; position: absolute; top: -1px; left: 14%; right: 14%; height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(229,83,255,.65), transparent);
  opacity: .9;
  pointer-events: none;
}
.auth-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-top: 34px; }
.auth { animation: rise .65s ease both; }
.auth-grid .card:nth-child(2) { animation-delay: .09s; }
.auth h2 { margin-bottom: 14px; font-family: "Unbounded", sans-serif; font-size: 15px; letter-spacing: .06em; }
.auth h1 { font-size: 24px; margin-bottom: 6px; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* живые эмодзи — тг-стиль */
.e {
  display: inline-block;
  animation: bob 3.2s ease-in-out .7s infinite, popin .6s cubic-bezier(.22,1.5,.36,1) .05s backwards;
  transform-origin: 50% 62%;
  will-change: transform;
}
.e:nth-child(2n) { animation-delay: 1.05s, .12s; }
.e:nth-child(3n) { animation-duration: 3.6s, .6s; animation-delay: 1.4s, .19s; }
.e:nth-child(4n) { animation-delay: .55s, .25s; }
.e:nth-child(5n) { animation-delay: 1.75s, .3s; }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  16%      { transform: translateY(-4.5px) rotate(-7deg) scale(1.12); }
  38%      { transform: translateY(-1px) rotate(2deg) scale(1.02); }
  62%      { transform: translateY(0) rotate(5deg); }
}
@keyframes wiggle {
  0%   { transform: scale(1) rotate(0); }
  30%  { transform: scale(1.28) rotate(-13deg); }
  60%  { transform: scale(1.18) rotate(11deg); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes popin {
  from { transform: scale(0) rotate(-30deg); opacity: 0; }
  to   { transform: scale(1) rotate(0); opacity: 1; }
}
.card:hover .e, .btn:hover .e, .pill:hover .e, .dots-menu a:hover .e {
  animation: wiggle .7s cubic-bezier(.22,1.6,.36,1);
}
.btn .e, .pill .e { font-size: inherit; }

/* настоящие тг-анимации (lottie svg внутри .e) */
.e.e-tgs {
  width: 1.25em;
  height: 1.25em;
  vertical-align: -0.28em;
  line-height: 1;
}
.e.e-tgs svg { will-change: transform; }
.e.e-tgs::after { content: none; }

/* ============ inputs ============ */
label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 16px 0 6px; }
label input {
  display: block; width: 100%; margin-top: 6px; letter-spacing: normal; text-transform: none;
  background: rgba(0,0,0,.45); border: 1px solid var(--card-border);
  color: var(--text); padding: 13px 15px; border-radius: 13px;
  font-size: 15px; font-family: inherit; outline: none; transition: .18s;
}
label input::placeholder { color: rgba(157,148,184,.55); }
label input:focus {
  border-color: rgba(139,92,246,.7);
  box-shadow: 0 0 0 4px rgba(139,92,246,.18), 0 0 22px rgba(229,83,255,.14);
  background: rgba(0,0,0,.55);
}

.hint { color: var(--muted); font-size: 13px; margin-top: 16px; line-height: 1.6; }
.sub { color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.sub.warn { color: var(--gold); }
.okline { margin: 10px 0 4px; font-size: 15px; }
.okline.dim { color: var(--muted); }
code {
  background: rgba(229,83,255,.12); border: 1px solid rgba(229,83,255,.25);
  padding: 2px 8px; border-radius: 7px; color: #f0d9ff; font-size: 13px;
}

/* ============ buttons ============ */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--card-border); cursor: pointer; overflow: hidden;
  color: var(--text); font-weight: 800; font-size: 14.5px; font-family: inherit;
  padding: 13px 24px; border-radius: 13px; text-decoration: none;
  background: rgba(255,255,255,.05); transition: .18s; margin-top: 16px;
  letter-spacing: .02em;
}
.btn:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.2); }
.btn:active { transform: translateY(0) scale(.98); }
.btn::after {
  content: ""; position: absolute; top: 0; left: -80%; width: 50%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.22), transparent);
  transition: .5s;
}
.btn:hover::after { left: 130%; }
.btn.primary {
  background: linear-gradient(120deg, var(--accent), var(--accent2) 70%, #b14aff);
  border: none; color: #fff;
  box-shadow: 0 10px 30px rgba(139,92,246,.4), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn.primary:hover { filter: brightness(1.1); box-shadow: 0 14px 38px rgba(229,83,255,.45), inset 0 1px 0 rgba(255,255,255,.25); }
.btn.ghost { background: transparent; }
.btn.big { width: 100%; font-size: 15.5px; }
.btn.sm { padding: 9px 16px; font-size: 13px; margin-top: 0; border-radius: 11px; }

/* ============ flashes ============ */
.flash-row { display: grid; gap: 10px; margin-bottom: 22px; }
.flash {
  padding: 13px 18px; border-radius: 14px; font-size: 15px;
  border: 1px solid; backdrop-filter: blur(8px);
  animation: rise .4s ease both;
}
.flash.ok  { background: rgba(52,211,153,.09);  border-color: rgba(52,211,153,.4);  color: #a7f3d0; box-shadow: 0 0 24px rgba(52,211,153,.1); }
.flash.bad { background: rgba(251,113,133,.09); border-color: rgba(251,113,133,.4); color: #fecdd3; box-shadow: 0 0 24px rgba(251,113,133,.1); }

/* ============ panel ============ */
.narrow { max-width: 480px; margin: 0 auto; }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 6px 0 24px; flex-wrap: wrap; }
.panel-head h1 { font-family: "Unbounded", sans-serif; font-size: 27px; letter-spacing: .02em; }

.accounts { display: grid; gap: 14px; margin-top: 12px; }
.account {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 20px 24px 20px 20px;
  transition: .2s; animation: rise .5s ease both;
}
.account:hover { transform: translateY(-3px); border-color: rgba(229,83,255,.35); box-shadow: 0 18px 44px rgba(0,0,0,.5), 0 0 30px rgba(139,92,246,.12); }
.account::before {
  content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
  opacity: .85;
}
.account form { margin: 0; }
.acc-title { font-weight: 800; font-size: 17px; letter-spacing: .02em; }
.acc-phone { color: var(--muted); margin-top: 4px; font-size: 14px; }
.acc-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.acc-actions { display: flex; align-items: center; gap: 10px; }
.badge {
  font-size: 10.5px; font-weight: 900; padding: 4px 11px; border-radius: 999px;
  letter-spacing: .05em;
  background: linear-gradient(120deg, var(--accent), var(--accent2)); color: #fff;
  box-shadow: 0 0 16px rgba(229,83,255,.35);
  vertical-align: middle;
}
.pill { font-size: 12px; font-weight: 800; padding: 7px 14px; border-radius: 999px; white-space: nowrap; }
.pill.on  { color: #a7f3d0; background: rgba(52,211,153,.12);  border: 1px solid rgba(52,211,153,.35); }
.pill.off { color: #fecdd3; background: rgba(251,113,133,.12); border: 1px solid rgba(251,113,133,.35); }
.dimrow { opacity: .8; }

.empty { text-align: center; padding: 48px 26px; }
.empty p { color: var(--muted); margin-bottom: 12px; }

/* ============ logs / terminal ============ */
.logs pre {
  background: rgba(0,0,0,.55); border: 1px solid var(--card-border);
  padding: 18px; border-radius: 14px; overflow-x: auto;
  font: 13px "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #d8d3ec; white-space: pre-wrap;
  box-shadow: inset 0 0 40px rgba(0,0,0,.4);
}

/* ============ admin ============ */
.reg-form { margin-bottom: 18px; }
.reg-form h2 { font-size: 17px; margin-bottom: 6px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.inline-form input {
  flex: 1 1 180px;
  background: rgba(0,0,0,.45); border: 1px solid var(--card-border);
  color: var(--text); padding: 12px 14px; border-radius: 13px; font-size: 15px;
  font-family: inherit; outline: none; transition: .18s;
}
.inline-form input:focus { border-color: rgba(139,92,246,.7); box-shadow: 0 0 0 4px rgba(139,92,246,.16); }
.inline-form .btn { margin-top: 0; }
.auth-grid { margin-top: 18px; }

.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 26px; opacity: .65; }

/* ============ account page ============ */
.acc-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.acc-head h1 { font-family: "Unbounded", sans-serif; font-size: 24px; }
.acc-head form { margin: 0; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.tab {
  color: var(--muted); text-decoration: none; font-weight: 700; font-size: 14px;
  padding: 10px 20px; border-radius: 999px; background: rgba(255,255,255,.04);
  border: 1px solid var(--card-border); transition: .18s;
}
.tab:hover { color: var(--text); transform: translateY(-1px); }
.tab.active {
  color: #fff; border-color: rgba(229,83,255,.45);
  background: linear-gradient(120deg, rgba(139,92,246,.35), rgba(229,83,255,.35));
  box-shadow: 0 0 20px rgba(229,83,255,.2);
}
.muted { color: var(--muted); }
.total { margin-top: 14px; color: var(--muted); font-size: 14px; }
.total b { color: var(--text); }

.table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 15px; }
.table th {
  text-align: left; color: var(--muted); font-weight: 800; font-size: 11.5px;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 10px 12px; border-bottom: 1px solid var(--card-border);
}
.table td { padding: 11px 12px; border-bottom: 1px dashed rgba(255,255,255,.07); }
.table tr:hover td { background: rgba(255,255,255,.03); }

/* ============ three-dots menu ============ */
.dots { position: relative; }
.dots summary {
  list-style: none; cursor: pointer; color: var(--muted);
  font-size: 18px; padding: 7px 13px; border-radius: 11px;
  border: 1px solid var(--card-border); background: rgba(255,255,255,.04);
  transition: .18s;
}
.dots summary::-webkit-details-marker { display: none; }
.dots summary:hover { color: var(--text); border-color: rgba(255,255,255,.2); }
.dots-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 30;
  background: rgba(13,7,22,.95); border: 1px solid rgba(255,255,255,.12); border-radius: 14px;
  padding: 7px; min-width: 210px; display: grid; gap: 2px;
  box-shadow: 0 20px 50px rgba(0,0,0,.6), 0 0 30px rgba(139,92,246,.12);
  backdrop-filter: blur(16px);
  animation: pop .26s cubic-bezier(.22,1.4,.36,1) both;
  transform-origin: top right;
}
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(.94); } to { opacity: 1; transform: none; } }
.dots-menu a, .dots-menu button {
  text-align: left; background: none; border: none; color: var(--text);
  font: 700 13.5px/1 "Manrope", system-ui, sans-serif; padding: 10px 13px; border-radius: 9px;
  text-decoration: none; cursor: pointer; transition: .12s;
}
.dots-menu a:hover, .dots-menu button:hover { background: rgba(255,255,255,.07); }
.dots-menu .danger { color: var(--bad); }
.dots-menu .danger:hover { background: rgba(251,113,133,.1); }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(139,92,246,.35); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(229,83,255,.5); }
::-webkit-scrollbar-track { background: transparent; }
::selection { background: rgba(229,83,255,.35); }

@media (max-width: 560px) {
  .top { flex-direction: column; gap: 10px; }
  nav { flex-wrap: wrap; justify-content: center; }
  main { padding: 18px 14px 30px; }
  .hero h1 { letter-spacing: .05em; }
  .hero { padding-bottom: 22px; }
  .card { padding: 20px 18px; border-radius: 17px; }
  .account { flex-wrap: wrap; padding: 18px 16px 18px 16px; }
  .acc-actions { width: 100%; justify-content: space-between; margin-top: 12px; }
  .acc-actions .btn { flex: 1; }
  .panel-head { margin-bottom: 18px; }
  .btn { padding: 12px 18px; }
  .tabs { gap: 6px; }
  .tab { padding: 9px 14px; font-size: 13px; }
  .table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .dots-menu { min-width: 180px; }
  .inline-form { flex-direction: column; }
  .inline-form .btn { width: 100%; }
  .logs pre { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
