/* ── Reset & variables (copied from loader) ─────────────────────────────── */
:root {
  --pur-100:   #ffffff;
  --pur-200:   #e8e8e8;
  --pur-300:   #c9c9c9;
  --pur-400:   #a8a8a8;
  --pur-500:   #8a8a8a;
  --pur-600:   #6e6e6e;

  --fg:        #f2f2f2;
  --fg-dim:    rgba(255,255,255,.62);
  --muted:     #b3b3b3;
  --faint:     #7d7d7d;
  --line:      rgba(255,255,255,.16);
  --panel:     rgba(255,255,255,.04);
  --panel-brd: rgba(255,255,255,.20);
  --red:       #e8617f;
  --green:     #4ade80;

  --glow-soft: rgba(255,255,255,.20);
  --glow-mid:  rgba(255,255,255,.38);
  --glow-hot:  rgba(255,255,255,.65);
}

.grad-text {
  background: linear-gradient(180deg, #ffffff 0%, var(--pur-200) 58%, var(--pur-400) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

html, body {
  width: 100%; height: 100%;
  background: #000;
  color: var(--fg);
  font-family: "Segoe UI Light","Segoe UI",sans-serif;
  font-weight: 300;
  overflow: hidden;
  cursor: none;
  -webkit-user-select: none;
  user-select: none;
}

/* ── Background (copied from loader) ───────────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background: #000;
}

#deep-sky {
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none;
  opacity: .95;
  will-change: transform;
}

#stars {
  position: fixed; inset: 0; z-index: 1;
  opacity: .95;
  pointer-events: none;
}

#space-scene {
  position: fixed; inset: 0; z-index: 1;
  pointer-events: none;
  overflow: hidden;
  contain: strict;
}

.sun-glare {
  position: absolute;
  top: -6vmin; left: -4vmin;
  width: 46vmin; height: 46vmin;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.30) 0%,
      rgba(255,255,255,.12) 16%, rgba(255,255,255,.07) 38%, transparent 68%);
  will-change: transform, opacity;
  animation: sun-breathe 13s ease-in-out infinite;
}
@keyframes sun-breathe {
  0%, 100% { opacity: .75; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.05); }
}

.saturn {
  position: absolute;
  top: 92%; left: 84%;
  width: 80vmin; height: 80vmin;
  transform: translate(-50%, -50%);
  transform-style: preserve-3d;
  opacity: .72;
  animation: saturn-drift 46s ease-in-out infinite alternate;
}
@keyframes saturn-drift {
  from { transform: translate(-50%, -50%) translate3d(0, 0, 0)      rotate(0deg); }
  to   { transform: translate(-50%, -50%) translate3d(-1.6vmin, 2.2vmin, 0) rotate(1.1deg); }
}

.saturn-globe {
  position: absolute;
  top: 50%; left: 50%;
  width: 42%; height: 42%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  overflow: hidden;
  background:
    radial-gradient(circle at 33% 27%,
      #f2f2f2 0%, #dddddd 14%, #b5b5b5 33%, #8c8c8c 52%,
      #5b5b5b 70%, #2e2e2e 85%, #141414 97%, #0a0a0a 100%);
  box-shadow:
    0 0 9vmin rgba(255,255,255,.14),
    inset -1.2vmin -1.2vmin 5vmin rgba(0,0,0,.75);
}
.globe-bands {
  position: absolute; inset: -30% -60%;
  background: repeating-linear-gradient(
    177deg,
    rgba(255,255,255,.060) 0 1.1%,
    rgba(0,0,0,.055)       1.1% 2.0%,
    rgba(255,255,255,.035) 2.0% 3.4%,
    rgba(0,0,0,.075)       3.4% 4.2%,
    rgba(255,255,255,.075) 4.2% 5.6%,
    rgba(0,0,0,.030)       5.6% 7.0%
  );
  opacity: .85;
  will-change: transform;
  animation: bands-spin 120s linear infinite;
}
@keyframes bands-spin {
  from { transform: translateX(0); }
  to   { transform: translateX(33%); }
}
.globe-ringshadow {
  position: absolute;
  top: 44%; left: -12%;
  width: 124%; height: 15%;
  border-radius: 50%;
  background: linear-gradient(180deg,
    rgba(0,0,0,0) 0%, rgba(0,0,0,.36) 22%, rgba(0,0,0,.58) 50%,
    rgba(0,0,0,.32) 76%, rgba(0,0,0,0) 100%);
}
.globe-terminator {
  position: absolute; inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 24%, rgba(255,255,255,.18) 0%, transparent 42%),
    linear-gradient(128deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.55) 68%, rgba(0,0,0,.92) 100%);
}
.saturn-limb {
  position: absolute;
  top: 50%; left: 50%;
  width: 45%; height: 45%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle,
    transparent 62%, rgba(255,255,255,.14) 76%, transparent 88%);
  pointer-events: none;
}
.saturn-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  transform: rotate(-16deg) rotateX(74deg);
  background: radial-gradient(circle at 50% 50%,
    transparent 0 28.0%,
    rgba(255,255,255,.00) 28.0%,
    rgba(255,255,255,.16) 29.4%,
    rgba(255,255,255,.30) 32.0%,
    rgba(255,255,255,.46) 35.0%,
    rgba(255,255,255,.52) 37.6%,
    rgba(170,170,170,.10) 39.4%,
    rgba(255,255,255,.38) 41.0%,
    rgba(255,255,255,.33) 44.4%,
    rgba(150,150,150,.07) 45.6%,
    rgba(255,255,255,.22) 46.6%,
    rgba(255,255,255,.05) 48.6%,
    transparent 50%);
}
.saturn-ring::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at 50% 50%,
    rgba(255,255,255,.045) 0 .45%, rgba(0,0,0,.05) .45% .95%);
  -webkit-mask: radial-gradient(circle at 50% 50%,
    transparent 0 29%, #000 31% 48%, transparent 50%);
  mask: radial-gradient(circle at 50% 50%,
    transparent 0 29%, #000 31% 48%, transparent 50%);
}
.ring-front { clip-path: inset(50% 0 0 0); z-index: 3; }
.ring-back  { clip-path: inset(0 0 50% 0); z-index: 1; }
.saturn-globe { z-index: 2; }
.saturn-limb  { z-index: 4; }

.moon-orbit {
  position: absolute;
  top: 50%; left: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-16deg) rotateX(74deg);
  z-index: 5;
}
.moon-orbit .moon {
  position: absolute;
  top: -0.35vmin; left: 50%;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff 0%, #d5d5d5 45%, #5a5a5a 100%);
  box-shadow: 0 0 1.1vmin rgba(255,255,255,.55);
}
.moon-orbit { will-change: transform; }
.orbit-1 { width: 76%; height: 76%; animation: moon-spin 38s linear infinite; }
.orbit-1 .moon { width: .95vmin; height: .95vmin; margin-left: -.475vmin; }
.orbit-2 { width: 112%; height: 112%; animation: moon-spin 74s linear infinite reverse; }
.orbit-2 .moon { width: .7vmin; height: .7vmin; margin-left: -.35vmin; opacity: .8; }
@keyframes moon-spin {
  from { transform: translate(-50%, -50%) rotate(-16deg) rotateX(74deg) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(-16deg) rotateX(74deg) rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .saturn, .globe-bands, .moon-orbit, .sun-glare { animation: none !important; }
}

.ambient-glow { display: none; }
#space-scene  { display: block; }

/* ── Custom cursor (copied from loader) ────────────────────────────────── */
#cursor-dot, #cursor-tail {
  position: fixed; z-index: 9999;
  left: 0; top: 0;
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
  transform: translate(-200px,-200px);
  transition: width .18s ease, height .18s ease, background .18s ease, opacity .2s ease,
              border-color .2s ease;
}
#cursor-dot {
  width: 6px; height: 6px;
  background: var(--pur-100);
  box-shadow: 0 0 8px rgba(255,255,255,.95), 0 0 16px rgba(255,255,255,.55);
}
#cursor-tail {
  width: 34px; height: 34px;
  border: 1px solid rgba(255,255,255,.28);
  background: radial-gradient(circle, rgba(255,255,255,.03), transparent 65%);
}
body.cursor-hover #cursor-dot  { width: 4px; height: 4px; }
body.cursor-hover #cursor-tail { width: 46px; height: 46px; border-color: rgba(255,255,255,.5); }
body.cursor-down  #cursor-tail { width: 26px; height: 26px; }

/* ── App shell ─────────────────────────────────────────────────────────── */
#app { position: fixed; inset: 0; z-index: 2; }

.screen {
  position: absolute; inset: 0;
  display: none;
  align-items: center; justify-content: center;
}
.screen.active { display: flex; }

.hidden { display: none !important; }

/* ── Login card (copied from loader) ───────────────────────────────────── */
.login-card {
  width: min(440px, 90vw);
  padding: 54px 46px 44px;
  background: linear-gradient(160deg, rgba(255,255,255,.035), rgba(255,255,255,.008));
  border: 1px solid var(--panel-brd);
  border-radius: 18px;
  backdrop-filter: blur(4px);
  box-shadow:
    inset 0 1px rgba(255,255,255,.06),
    0 30px 90px rgba(0,0,0,.6);
}
.login-brand { text-align: center; margin-bottom: 30px; }
.login-wordmark {
  font-size: clamp(17px,1.3vw,22px);
  letter-spacing: .42em;
  text-indent: .42em;
  font-weight: 200;
  background: linear-gradient(100deg,
    var(--pur-300) 20%, #ffffff 42%, var(--pur-200) 62%, var(--pur-400) 86%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: text-sheen 6s linear infinite;
}
@keyframes text-sheen {
  from { background-position: 120% 0; }
  to   { background-position: -130% 0; }
}
.login-sub {
  margin-top: 10px;
  font-size: 8px;
  letter-spacing: .3em;
  text-indent: .3em;
  color: var(--faint);
}
.login-sep {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 25%, var(--line) 75%, transparent);
  margin-bottom: 38px;
}
.login-hint {
  text-align: center;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 22px;
}

/* ── Buttons (copied from loader) ──────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 26px 0;
  background: linear-gradient(180deg, rgba(255,255,255,.16), rgba(255,255,255,.10));
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 14px;
  color: var(--fg);
  font-family: inherit;
  font-size: 15px;
  font-weight: 300;
  letter-spacing: .32em;
  text-indent: .32em;
  cursor: none;
  position: relative;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  animation: btn-breathe 3.4s ease-in-out infinite;
  transition: transform .28s cubic-bezier(.2,.8,.2,1),
              border-color .25s, background .25s, box-shadow .25s, color .25s;
}
.btn-primary::before {
  content: '';
  position: absolute; top: 0; bottom: 0;
  left: -80%;
  width: 50%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.22), transparent);
  transform: skewX(-20deg);
  transition: left .7s cubic-bezier(.2,.8,.2,1);
  pointer-events: none;
}
.btn-primary:hover {
  transform: translateY(-2px) scale(1.015);
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.55);
  box-shadow:
    0 18px 44px rgba(0,0,0,.55),
    0 0 26px rgba(255,255,255,.14),
    inset 0 1px rgba(255,255,255,.2);
  animation: none;
}
.btn-primary:hover::before { left: 130%; }
.btn-primary:active { transform: translateY(1px) scale(.98); }
@keyframes btn-breathe {
  0%, 100% { box-shadow: 0 0 0 rgba(255,255,255,0);    border-color: rgba(255,255,255,.22); }
  50%      { box-shadow: 0 0 22px rgba(255,255,255,.10); border-color: rgba(255,255,255,.38); }
}
.btn-primary.loading .btn-text { opacity: 0; }
.btn-primary.loading .btn-spinner { opacity: 1; }

.btn-spinner {
  position: absolute;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.15);
  border-top-color: var(--fg);
  border-radius: 50%;
  opacity: 0;
  animation: spin .7s linear infinite;
  transition: opacity .2s;
}
@keyframes spin { to { transform: rotate(360deg); } }

.auth-error {
  margin-top: 14px;
  min-height: 18px;
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--red);
  text-align: center;
  opacity: 0;
  transition: opacity .3s;
}
.auth-error.visible { opacity: 1; }

/* ── Dashboard shell ───────────────────────────────────────────────────── */
#dash.dash { padding: 0; }
.dash { display: flex; }
.sidebar {
  width: 230px; flex: none;
  padding: 28px 16px 20px;
  background: rgba(8,9,12,.55);
  border-right: 1px solid var(--panel-brd);
  backdrop-filter: blur(8px);
  display: flex; flex-direction: column;
}
.side-brand {
  font-size: 16px; font-weight: 200;
  letter-spacing: .34em; text-indent: .34em;
  padding: 4px 10px 24px;
}
.side-nav { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.nav-item {
  padding: 14px 18px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px; font-weight: 300;
  letter-spacing: .28em; text-indent: .28em;
  text-align: left;
  cursor: none;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.nav-item:hover { background: rgba(255,255,255,.05); color: var(--fg); }
.nav-item.active {
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.05));
  border-color: rgba(255,255,255,.30);
  color: #fff;
  box-shadow: inset 0 1px rgba(255,255,255,.08), 0 8px 24px rgba(0,0,0,.4);
}
.side-user {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 10px 0;
  border-top: 1px solid var(--panel-brd);
}
.side-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.2);
  box-shadow: 0 0 14px rgba(255,255,255,.12);
}
.side-userinfo { display: flex; flex-direction: column; min-width: 0; }
.side-username {
  font-size: 12px; font-weight: 300;
  letter-spacing: .06em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-badge {
  margin-top: 4px;
  font-size: 8px; font-weight: 500;
  letter-spacing: .22em;
  color: var(--green);
}

/* ── Content ───────────────────────────────────────────────────────────── */
.content {
  flex: 1; overflow-y: auto;
  padding: 48px 56px;
}
.page { display: none; }
.page.active { display: block; animation: page-in .5s cubic-bezier(.16,1,.3,1); }
@keyframes page-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; } }
.page-title {
  font-size: 15px; font-weight: 300;
  letter-spacing: .4em; text-indent: .4em;
  margin-bottom: 30px;
}
.hint { margin-top: 20px; font-size: 11px; color: var(--faint); letter-spacing: .06em; }

/* Cards (loader glass style) */
.card {
  background:
    linear-gradient(160deg, rgba(255,255,255,.045), rgba(255,255,255,.008)),
    linear-gradient(160deg, rgba(12,12,12,.46), rgba(5,5,5,.32));
  border: 1px solid var(--panel-brd);
  border-radius: 18px;
  backdrop-filter: blur(6px);
  box-shadow:
    inset 0 1px rgba(255,255,255,.06),
    0 30px 60px rgba(0,0,0,.55);
}
.hwid-box { max-width: 560px; padding: 8px 28px; }
.hwid-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 17px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: 11px; letter-spacing: .14em;
}
.hwid-row:last-child { border-bottom: none; }
.hwid-row span { color: var(--faint); }
.hwid-row b { font-weight: 300; word-break: break-all; max-width: 62%; text-align: right; color: var(--fg); }

.dl-card {
  max-width: 560px;
  padding: 42px 44px;
  text-align: center;
}
.dl-icon {
  width: 64px; height: 64px; margin: 0 auto 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 18px; font-size: 26px; color: #fff;
  background: linear-gradient(160deg, rgba(255,255,255,.12), rgba(255,255,255,.04));
  border: 1px solid rgba(255,255,255,.3);
  box-shadow: inset 0 1px rgba(255,255,255,.1), 0 14px 34px rgba(0,0,0,.5);
}
.dl-name { font-size: 16px; font-weight: 200; letter-spacing: .18em; }
.dl-version { margin: 10px 0 28px; font-size: 10px; letter-spacing: .14em; color: var(--faint); }
.dl-btn { width: auto; padding: 20px 40px; font-size: 13px; text-decoration: none; }

.lic-card {
  max-width: 560px;
  padding: 40px 44px;
  display: flex; flex-direction: column; gap: 16px;
}
.lic-label { font-size: 10px; letter-spacing: .3em; color: var(--faint); }
.lic-input {
  width: 100%;
  padding: 18px;
  background: rgba(0,0,0,.5);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  color: var(--fg);
  caret-color: var(--fg);
  font-family: inherit;
  font-size: 14px;
  font-weight: 300;
  letter-spacing: .08em;
  text-align: center;
  outline: none;
  cursor: none;
  transition: border-color .25s, box-shadow .25s;
}
.lic-input::placeholder { color: var(--faint); letter-spacing: .2em; }
.lic-input:focus {
  border-color: rgba(255,255,255,.4);
  animation: input-glow 2.4s ease-in-out infinite;
}
@keyframes input-glow {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255,255,255,.04); }
  50%      { box-shadow: 0 0 0 3px rgba(255,255,255,.09), 0 0 18px rgba(255,255,255,.08); }
}
.lic-btn { width: auto; padding: 20px 40px; font-size: 13px; }
.lic-status { min-height: 18px; font-size: 12px; letter-spacing: .08em; }
.lic-status.ok { color: var(--green); }
.lic-status.err { color: var(--red); }

/* ── Perf lite (copied from loader) ────────────────────────────────────── */
body.perf-lite *,
body.perf-lite *::before,
body.perf-lite *::after {
  transition-duration: 0s !important;
  animation-duration: .01s !important;
  animation-iteration-count: 1 !important;
}
body.perf-lite .sun-glare,
body.perf-lite .globe-bands,
body.perf-lite .saturn,
body.perf-lite .moon-orbit {
  animation: none !important;
}