:root {
  --bg: #0c0618;
  --bg2: #160b2e;
  --card: rgba(12, 6, 24, 0.82);
  --line: #6d28d9;
  --accent: #c026d3;
  --hot: #e879f9;
  --text: #f5f3ff;
  --muted: #c4b5fd;
  --danger: #ff6b9d;
  --ok: #4ade80;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(192, 38, 211, .35), transparent 60%),
    radial-gradient(900px 400px at 100% 0%, rgba(109, 40, 217, .35), transparent 55%),
    var(--bg);
}
a { color: var(--hot); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 980px; margin: 0 auto; padding: 24px 20px 64px; }
header.nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 36px;
}
.brand { font-weight: 800; letter-spacing: .12em; font-size: 18px; color: var(--hot); text-shadow: 0 0 18px #c026d3; }
.nav-links { display: flex; gap: 16px; font-size: 14px; color: var(--muted); }
.hero h1 { font-size: 42px; margin: 0 0 12px; }
.hero p { color: var(--muted); max-width: 520px; line-height: 1.5; }
.actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 0 40px rgba(192, 38, 211, .12);
  max-width: 440px;
}
.card.wide { max-width: 720px; }
h2 { margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--hot); margin: 14px 0 6px; }
input {
  width: 100%; padding: 12px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: rgba(12, 6, 24, 0.82); color: var(--text);
  font-size: 15px;
}
input:focus { outline: none; border-color: var(--hot); box-shadow: 0 0 14px rgba(192, 38, 211, .6); }
.btn {
  display: inline-block; border: 0; cursor: pointer; border-radius: 8px;
  padding: 12px 18px; font-weight: 700; font-size: 15px;
  background: var(--accent); color: #1a0524;
  box-shadow: 0 0 18px rgba(192, 38, 211, .7);
}
.btn:hover { background: var(--hot); }
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.btn:disabled:hover { background: var(--accent); }
.btn.ghost { background: transparent; color: var(--muted); box-shadow: none; border: 1px solid var(--line); }
.btn.full { width: 100%; margin-top: 18px; }
.msg { margin-top: 14px; font-size: 14px; color: var(--muted); }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat {
  border: 1px solid var(--line); border-radius: 12px; padding: 16px;
  background: rgba(22, 11, 46, .6);
}
.stat.clickable { cursor: pointer; }
.stat.clickable:hover { border-color: var(--hot); box-shadow: 0 0 14px rgba(192, 38, 211, .4); }
.stat b { display: block; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; background: #2a1644; }
.badge.on { background: #14532d; color: var(--ok); }
.badge.off { background: #4c0519; color: var(--danger); }
.badge.warn { background: #3b2a08; color: #fbbf24; }
.wrap-wide { max-width: 1180px; }
.wrap-wide .card.wide { max-width: none; }
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 18px;
  padding: 6px;
  background: rgba(12, 6, 24, 0.82);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 0 40px rgba(192, 38, 211, .12);
}
.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab:hover { color: var(--text); background: rgba(109, 40, 217, .18); }
.tab.on {
  color: #1a0524;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(192, 38, 211, .45);
}
.tab-count {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #3b2a08;
  color: #fbbf24;
  font-size: 11px;
  font-weight: 700;
}
.tab.on .tab-count { background: rgba(26, 5, 36, .28); color: #1a0524; }
.tab-panel { display: none; }
.tab-panel.on { display: block; }
.tab-panel .card.wide + .card.wide { margin-top: 18px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #3b1d6e; vertical-align: top; }
table.data th { color: var(--muted); font-size: 11px; letter-spacing: .06em; }
table.data tr:hover td { background: rgba(109, 40, 217, .15); }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.row-actions > div { flex: 1; min-width: 140px; }
.keys-once { background: #1a0a2e; border: 1px dashed var(--hot); padding: 12px; border-radius: 8px; margin-top: 12px; white-space: pre-wrap; font-family: Consolas, monospace; font-size: 13px; }
.btn.tiny { padding: 6px 10px; font-size: 12px; width: auto; margin-top: 0; }
a.btn { text-decoration: none; color: #1a0524; }
a.btn:hover { text-decoration: none; }
.trial-request { margin-top: 14px; }
.trial-request .sub { margin: 0 0 10px; }
.btn.telegram {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #229ED9;
  color: #fff;
  box-shadow: 0 0 18px rgba(34, 158, 217, .45);
}
.btn.telegram:hover { background: #1b8ec4; color: #fff; }
.btn.danger { background: #7f1d1d; color: #fecaca; box-shadow: 0 0 12px rgba(239, 68, 68, .35); }
.btn.danger:hover { background: #991b1b; }
.btn.ghost.tiny { padding: 6px 10px; font-size: 12px; }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; }
select, textarea {
  width: 100%; padding: 12px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: rgba(12, 6, 24, 0.82); color: var(--text);
  font-size: 14px; font-family: inherit;
}
select:focus, textarea:focus { outline: none; border-color: var(--hot); box-shadow: 0 0 14px rgba(192, 38, 211, .6); }
textarea { min-height: 88px; resize: vertical; line-height: 1.45; }
input[type="datetime-local"] { color-scheme: dark; }
.event-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  background: rgba(22, 11, 46, .45);
  margin-top: 14px;
}
.event-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.event-head h3 { margin: 0; font-size: 18px; }
.event-card .sub { margin: 8px 0 4px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.chip {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; cursor: pointer; font-weight: 600;
}
.chip:hover, .chip.on { border-color: var(--hot); color: var(--text); background: rgba(192, 38, 211, .18); }
.badge.status-new { background: #3b2a08; color: #fbbf24; }
.badge.status-in_task { background: #1e3a5f; color: #38bdf8; }
.badge.status-in_progress { background: #2a1644; color: #e879f9; }
.badge.status-resolved { background: #14532d; color: var(--ok); }
.badge.status-ignored { background: #4c0519; color: var(--danger); }
.log-view {
  margin: 12px 0 0; max-height: 280px; overflow: auto; padding: 12px;
  background: #070414; border: 1px solid #3b1d6e; border-radius: 8px;
  color: #c4b5fd; font-size: 12px; white-space: pre-wrap; word-break: break-word;
  font-family: Consolas, "Segoe UI", monospace;
}
.modal.wide { width: min(860px, 100%); }
.desc-clip { max-width: 280px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dev-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
footer { margin-top: 48px; color: #7c3aed; font-size: 12px; }
.profile {
  display: flex; align-items: center; gap: 16px; margin-bottom: 22px;
}
.avatar {
  width: 72px; height: 72px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--hot); box-shadow: 0 0 16px rgba(192, 38, 211, .5);
  background: #160b2e;
}
.gear {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(22, 11, 46, .8); color: var(--hot); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.gear:hover { border-color: var(--hot); }
.lic-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.lic-row .btn { flex-shrink: 0; }
.overlay {
  position: fixed; inset: 0; background: rgba(6, 2, 14, .72);
  display: none; align-items: center; justify-content: center; padding: 16px; z-index: 40;
}
.overlay.open { display: flex; }
.modal {
  width: min(720px, 100%); background: var(--bg2); border: 1px solid var(--line);
  border-radius: 16px; padding: 22px; max-height: 90vh; overflow: auto;
  box-shadow: 0 0 40px rgba(192, 38, 211, .25);
}
.modal.small { width: min(420px, 100%); }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.plan {
  border: 1px solid var(--line); border-radius: 12px; padding: 16px; cursor: pointer;
  background: rgba(12, 6, 24, .6);
}
.plan:hover, .plan.pick { border-color: var(--hot); box-shadow: 0 0 14px rgba(192, 38, 211, .4); }
.plan h3 { margin: 0 0 6px; }
.plan .price { color: var(--hot); font-weight: 700; font-size: 20px; }
.avatars { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 18px; }
.avatars img {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover; cursor: pointer;
  border: 2px solid transparent;
}
.avatars img.pick { border-color: var(--hot); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.x { background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; }

/* Full-screen auth gate — background covers entire viewport */
body.auth-page {
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  margin: 0;
  padding: 0;
  background: #070414;
}
.auth-shell {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  background: #070414;
}
.auth-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: #070414;
}
.auth-art::before {
  content: "";
  position: absolute;
  inset: -8%;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 22% 28%, rgba(168, 85, 247, 0.16), transparent 46%),
    radial-gradient(ellipse at 78% 72%, rgba(232, 121, 249, 0.1), transparent 42%);
  animation: authGlow 5.5s ease-in-out infinite alternate;
  mix-blend-mode: screen;
}
.auth-art-dust {
  position: absolute;
  inset: -20%;
  z-index: 1;
  pointer-events: none;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(232, 121, 249, 0.45), transparent),
    radial-gradient(1px 1px at 38% 68%, rgba(255, 255, 255, 0.28), transparent),
    radial-gradient(1.5px 1.5px at 64% 18%, rgba(196, 181, 253, 0.4), transparent),
    radial-gradient(1px 1px at 82% 54%, rgba(232, 121, 249, 0.35), transparent),
    radial-gradient(1.5px 1.5px at 28% 86%, rgba(255, 255, 255, 0.22), transparent),
    radial-gradient(1px 1px at 91% 31%, rgba(167, 139, 250, 0.4), transparent);
  animation: authDust 18s linear infinite;
  opacity: 0.7;
}
.auth-slide {
  position: absolute;
  inset: -4%;
  width: 108%;
  height: 108%;
  object-fit: cover;
  object-position: center center;
  opacity: 0;
  transform: scale(1.04);
  filter: brightness(0.88) saturate(0.96);
  transition:
    opacity 1s cubic-bezier(0.22, 1, 0.36, 1),
    filter 1s ease;
  pointer-events: none;
  will-change: opacity, transform;
}
.auth-slide.is-on {
  opacity: 1;
  z-index: 1;
  filter: brightness(1.04) saturate(1.06);
  animation: authKenBurns 9s linear forwards;
}
.auth-slide.is-on.zoom-alt {
  animation-name: authKenBurnsAlt;
}
/* Single static register background — no slideshow / Ken Burns */
.auth-slide.auth-slide-static,
.auth-slide.auth-slide-static.is-on {
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 1;
  transform: none;
  filter: brightness(1) saturate(1.02);
  object-position: center center;
  animation: none;
  transition: none;
}
@keyframes authKenBurns {
  from { transform: scale(1) translate3d(0, 0, 0); }
  to { transform: scale(1.08) translate3d(-1.4%, -0.7%, 0); }
}
@keyframes authKenBurnsAlt {
  from { transform: scale(1) translate3d(0, 0, 0); }
  to { transform: scale(1.08) translate3d(1.2%, 0.5%, 0); }
}
@keyframes authGlow {
  from { opacity: 0.45; transform: translate3d(0, 0, 0); }
  to { opacity: 0.9; transform: translate3d(-1.5%, 1%, 0); }
}
@keyframes authDust {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-4%, -6%, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .auth-slide,
  .auth-slide.is-on,
  .auth-slide.is-on.zoom-alt,
  .auth-slide.auth-slide-static,
  .auth-art::before,
  .auth-art-dust {
    animation: none;
  }
  .auth-slide { transform: none; inset: 0; width: 100%; height: 100%; }
}
.auth-art-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(7, 4, 20, 0.1) 0%,
    rgba(7, 4, 20, 0.05) 40%,
    rgba(7, 4, 20, 0.65) 72%,
    rgba(7, 4, 20, 0.94) 100%
  );
}
.auth-slide-dots {
  position: absolute;
  left: 32px;
  bottom: 32px;
  z-index: 3;
  display: flex;
  gap: 8px;
}
.auth-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .28);
  cursor: pointer;
  transition: transform .35s ease, background .35s ease, box-shadow .35s ease, width .35s ease;
}
.auth-dot.is-on {
  background: var(--hot);
  box-shadow: 0 0 12px rgba(232, 121, 249, .85);
  transform: scale(1.25);
  width: 22px;
  border-radius: 999px;
}
.auth-dot:focus-visible {
  outline: 2px solid rgba(232, 121, 249, .9);
  outline-offset: 3px;
}
.auth-panel {
  position: relative;
  z-index: 3;
  margin-left: auto;
  width: min(500px, 100%);
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 44px 28px 40px;
  background: transparent;
  border: none;
}
.auth-panel-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.auth-brand-link {
  font-size: 12px;
  color: #a78bfa;
  text-decoration: none;
}
.auth-brand-link:hover { color: var(--hot); text-decoration: none; }
.auth-reg-btn {
  padding: 9px 18px;
  font-size: 13px;
  letter-spacing: .04em;
  text-decoration: none;
  background: var(--accent);
  color: #1a0524;
  border: 1px solid #f0abfc;
  box-shadow:
    0 0 0 1px rgba(7, 4, 20, .55),
    0 2px 10px rgba(0, 0, 0, .45),
    0 0 22px rgba(192, 38, 211, .75);
}
.auth-reg-btn:hover {
  background: var(--hot);
  color: #1a0524;
  text-decoration: none;
  border-color: #fce7f3;
  box-shadow:
    0 0 0 1px rgba(7, 4, 20, .55),
    0 2px 12px rgba(0, 0, 0, .5),
    0 0 28px rgba(232, 121, 249, .9);
}
.auth-panel-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: .04em;
  text-shadow: 0 0 16px rgba(192, 38, 211, .9);
}
.auth-sub {
  margin: 8px 0 6px;
  color: #c4b5fd;
  font-size: 13px;
}
.auth-tagline {
  margin: 0 0 22px;
  color: #7c3aed;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
}
.auth-panel label:not(.auth-check) {
  margin-top: 0;
}
.auth-panel label + input { margin-bottom: 0; }
.auth-panel label[for="password"] { margin-top: 16px; }
.auth-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  font-size: 13px;
  color: #a78bfa;
  font-weight: 500;
  letter-spacing: 0;
  cursor: pointer;
}
.auth-check input {
  width: auto;
  margin: 0;
  accent-color: var(--hot);
}
.auth-panel .btn.full {
  margin-top: 22px;
  height: 44px;
  letter-spacing: .04em;
}
.auth-forgot {
  margin: 16px 0 0;
  font-size: 13px;
  color: #a78bfa;
}
.auth-panel-foot {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #6d28d9;
  color: #c4b5fd;
  font-size: 11px;
  font-weight: 600;
}

@media (max-width: 720px) {
  .hero h1 { font-size: 30px; }
  .plans { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .card { max-width: none; }
  body.auth-page { height: auto; min-height: 100vh; overflow: auto; }
  .auth-shell { min-height: 100vh; height: auto; }
  .auth-art { position: fixed; min-height: 100vh; }
  .auth-art-overlay {
    background: linear-gradient(
      180deg,
      rgba(7, 4, 20, 0.2) 0%,
      rgba(7, 4, 20, 0.75) 55%,
      rgba(7, 4, 20, 0.95) 100%
    );
  }
  .auth-panel {
    margin-left: 0;
    width: 100%;
    min-height: 100vh;
    height: auto;
    padding: 20px 20px 28px;
  }
  .auth-slide-dots { left: 20px; bottom: auto; top: 20px; }
}

