:root {
  --canvas: #0b0515;
  --panel: #130920;
  --panel-hover: #1b0d2a;
  --line: #4f2578;
  --purple: #9e40f7;
  --purple-light: #c97aff;
  --text: #f2e8ff;
  --muted: #8a7ba6;
  --green: #47f2a1;
  --red: #ff5770;
}

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

html, body {
  height: 100%;
  background: var(--canvas);
  color: var(--text);
  font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

#bg { position: fixed; inset: 0; z-index: 0; }
.grain {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.5;
  background-image: radial-gradient(rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 3px 3px;
}

.hidden { display: none !important; }

/* ---------- Auth ---------- */
.auth-wrap {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
}
.auth-card {
  width: min(410px, calc(100vw - 48px));
  padding: 34px 28px;
  background: rgba(15, 6, 26, 0.94);
  border: 1px solid rgba(79, 37, 120, 0.5);
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 0 80px rgba(158, 64, 247, 0.25);
  animation: rise 0.5s ease;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.logo {
  width: 46px; height: 46px; margin: 0 auto 10px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--purple-light), var(--purple) 60%);
  box-shadow: 0 0 24px rgba(158, 64, 247, 0.9);
  position: relative;
}
.logo::after {
  content: ''; position: absolute; inset: 16px; border-radius: 50%; background: var(--text);
}

.brand { font-size: 20px; letter-spacing: 0.35em; font-weight: 700; margin-bottom: 4px; }
.sub { font-size: 11px; letter-spacing: 0.18em; color: var(--muted); margin-bottom: 20px; }

.tabs { display: flex; gap: 6px; background: var(--panel); border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.tab {
  flex: 1; padding: 9px; background: transparent; border: none; border-radius: 8px;
  color: var(--muted); font-size: 12px; letter-spacing: 0.12em; cursor: pointer;
}
.tab.active { background: var(--purple); color: #fff; }

form label {
  display: block; text-align: left; font-size: 10px; letter-spacing: 0.16em;
  color: var(--muted); margin: 12px 0 5px;
}
form input {
  width: 100%; padding: 11px 13px; background: #0d0417; border: 1px solid var(--line);
  border-radius: 9px; color: var(--text); font-size: 14px; outline: none;
}
form input:focus { border-color: var(--purple); }

.btn {
  width: 100%; margin-top: 20px; padding: 13px; background: var(--purple); border: none;
  border-radius: 10px; color: #fff; font-size: 13px; letter-spacing: 0.1em; cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
.btn:hover { background: #b35cff; box-shadow: 0 0 18px rgba(158, 64, 247, 0.6); }
.btn.small { width: auto; padding: 10px 22px; margin-top: 18px; }
.arr { margin-left: 4px; }

.err { min-height: 16px; margin-top: 12px; color: var(--red); font-size: 12px; }
.status { margin-top: 6px; font-size: 10px; letter-spacing: 0.1em; color: var(--muted); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 6px; vertical-align: middle; }
.dot.green { background: var(--green); }

/* ---------- App layout ---------- */
.app { position: fixed; inset: 0; z-index: 10; display: flex; }

.sidebar {
  width: 210px; padding: 30px 14px; display: flex; flex-direction: column;
  background: rgba(8, 3, 16, 0.9); border-right: 1px solid var(--line);
}
.brand-block { display: flex; align-items: center; gap: 12px; padding: 0 6px 26px; }
.brand-block .logo { width: 34px; height: 34px; margin: 0; }
.brand-block .logo::after { inset: 12px; }
.brand-block .brand { font-size: 16px; letter-spacing: 0.2em; margin: 0; }
.ver { font-size: 9px; letter-spacing: 0.12em; color: var(--muted); }

nav { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.nav {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: transparent;
  border: none; border-radius: 9px; color: var(--muted); font-size: 13px; cursor: pointer; text-align: left;
}
.nav .glyph { width: 16px; color: var(--muted); }
.nav:hover { background: var(--panel-hover); }
.nav.active { background: rgba(71, 25, 112, 0.8); color: var(--text); }
.nav.active .glyph { color: var(--purple-light); }

.user-card {
  display: flex; align-items: center; gap: 10px; padding: 13px; background: var(--panel); border-radius: 10px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--purple);
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.uname { font-size: 13px; }
.license { font-size: 9px; letter-spacing: 0.08em; color: var(--green); }

.content { flex: 1; padding: 34px 40px; overflow: auto; }
.view { animation: rise 0.4s ease; }

header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; }
h2 { font-size: 24px; letter-spacing: 0.12em; margin-bottom: 6px; }
.subtitle { font-size: 11px; letter-spacing: 0.14em; color: var(--muted); }
.badge {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; font-size: 11px;
}

/* ---------- Products ---------- */
.products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.product {
  position: relative; padding: 22px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; min-height: 210px; display: flex; flex-direction: column;
  transition: transform 0.15s, border-color 0.15s;
}
.product:hover { transform: translateY(-3px); border-color: var(--purple); }
.accent { font-size: 10px; letter-spacing: 0.14em; color: var(--purple-light); margin-bottom: 12px; }
.code { font-size: 34px; font-weight: 800; letter-spacing: 0.05em; }
.name { font-size: 15px; margin: 6px 0 2px; }
.engine { font-size: 11px; color: var(--muted); margin-bottom: 20px; }

.claim {
  margin-top: auto; padding: 12px; background: var(--purple); border: none; border-radius: 9px;
  color: #fff; font-size: 12px; letter-spacing: 0.1em; cursor: pointer;
}
.claim:hover { background: #b35cff; }
.claim.disabled { background: #241435; color: #6a5b80; cursor: not-allowed; }

.trial { margin-top: auto; text-align: center; }
.trial .countdown { font-size: 12px; color: var(--muted); margin-top: 8px; }
.claim.download {
  display: block;
  text-decoration: none;
  text-align: center;
  margin-top: 14px;
  margin-left: auto;
  margin-right: auto;
}
.keybox {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0d0417;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 11px;
}
.keyval {
  flex: 1;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 12px;
  color: var(--purple-light);
  word-break: break-all;
  text-align: left;
}
.copy {
  padding: 6px 12px;
  background: var(--purple);
  border: none;
  border-radius: 7px;
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.copy:hover { background: #b35cff; }

.unavailable { opacity: 0.55; filter: saturate(0.4); }
.tag {
  position: absolute; top: 14px; right: 14px; padding: 4px 9px; font-size: 9px; letter-spacing: 0.12em;
  background: rgba(255, 87, 112, 0.16); color: var(--red); border: 1px solid rgba(255, 87, 112, 0.4); border-radius: 6px;
}

/* ---------- Panels ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px;
  max-width: 640px;
}
.prow {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0; border-bottom: 1px solid rgba(79, 37, 120, 0.4); font-size: 13px;
}
.prow:last-of-type { border-bottom: none; }
.k { color: var(--muted); letter-spacing: 0.08em; font-size: 11px; }
.v { font-weight: 600; }
.v.green { color: var(--green); }

.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { display: none; }
.switch span {
  position: absolute; inset: 0; border-radius: 20px; background: #241435; transition: 0.2s; cursor: pointer;
}
.switch span::before {
  content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  background: #8a7ba6; top: 3px; left: 3px; transition: 0.2s;
}
.switch input:checked + span { background: var(--purple); }
.switch input:checked + span::before { transform: translateX(18px); background: #fff; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 28px; right: 28px; z-index: 30; padding: 13px 20px;
  background: rgba(9, 31, 22, 0.95); border: 1px solid rgba(71, 242, 161, 0.4);
  border-radius: 9px; font-size: 12px; letter-spacing: 0.04em;
  display: flex; align-items: center; gap: 10px; animation: rise 0.3s ease;
}
.toast.err { background: rgba(40, 9, 15, 0.95); border-color: rgba(255, 87, 112, 0.5); }
