/* Страница входа (этап 30): анимированный фон — звёзды, вращающаяся Земля, спутники с межспутниковыми
   линиями; по центру — окно логина и пароля. Цвета — неоновая палитра комплекса. */
.login-page {
  --l-bg: #040a14;
  --l-panel: rgba(9, 20, 36, 0.88);
  --l-line: rgba(98, 160, 220, 0.28);
  --l-text: #e5f1fb;
  --l-muted: #8ea6bd;
  --l-cyan: #36d6ff;
  --l-green: #39ff9f;
  --l-violet: #a98bff;
  --l-amber: #ffc24d;
  --l-red: #ff5a6e;
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 120%, #0b2747 0%, var(--l-bg) 60%);
  color: var(--l-text);
  font: 13px/1.4 "Segoe UI", Roboto, Arial, sans-serif;
}

html[data-theme="light"] .login-page {
  --l-bg: #dfe8f2;
  --l-panel: rgba(250, 252, 255, 0.92);
  --l-line: rgba(60, 100, 150, 0.3);
  --l-text: #13212f;
  --l-muted: #5b6f82;
  --l-cyan: #0a7fa8;
  --l-green: #0a9a55;
  --l-violet: #6a4fd8;
  --l-amber: #9a6400;
  --l-red: #c8193a;
  background: radial-gradient(ellipse at 50% 120%, #b9cfe6 0%, var(--l-bg) 60%);
}

#login-sky,
#login-orbits {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

/* Земля: карта дня внутри круга сдвигается по долготе — вращение; тень и атмосфера — градиентами */
.login-globe {
  position: fixed;
  left: 50%;
  top: 100%;
  width: min(132vh, 118vw);
  aspect-ratio: 1;
  transform: translate(-50%, -38%);
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
  box-shadow: 0 0 90px 18px rgba(54, 170, 255, 0.35), 0 0 220px 40px rgba(54, 214, 255, 0.12);
}

.login-globe-map { /* две карты подряд (ширина карты — два диаметра); сдвиг на одну карту — бесшовно */
  position: absolute;
  top: 0;
  left: 0;
  width: 400%;
  height: 100%;
  background: url("/static/textures/2k_earth_daymap.jpg") repeat-x;
  background-size: 50% 100%;
  animation: login-spin 240s linear infinite;
  filter: saturate(1.15) brightness(0.8);
  will-change: transform;
}

.login-globe::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.12), transparent 40%),
    radial-gradient(circle at 50% 50%, transparent 52%, rgba(2, 8, 18, 0.65) 72%, rgba(2, 8, 18, 0.95) 100%);
}

html[data-theme="light"] .login-globe-map { filter: saturate(1.05) brightness(1.02); }
html[data-theme="light"] .login-globe::after {
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.25), transparent 40%),
    radial-gradient(circle at 50% 50%, transparent 55%, rgba(120, 150, 190, 0.45) 100%);
}

@keyframes login-spin {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.login-theme {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 3;
}

.login-wrap {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px 80px;
  box-sizing: border-box;
}

.login-card {
  width: min(420px, 100%);
  padding: 28px 30px 22px;
  border: 1px solid rgba(54, 214, 255, 0.45);
  border-radius: 14px;
  background: var(--l-panel);
  box-shadow: 0 0 46px rgba(54, 214, 255, 0.16), 0 22px 60px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  box-sizing: border-box;
  animation: login-rise 0.7s ease-out both;
}

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

.login-title {
  margin: 0;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.login-accent {
  background: linear-gradient(90deg, var(--l-cyan), var(--l-green) 45%, var(--l-violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
  filter: drop-shadow(0 0 10px rgba(54, 214, 255, 0.45));
}

html[data-theme="light"] .login-accent { filter: none; }

.login-sub {
  margin: 6px 0 22px;
  color: var(--l-muted);
  font-size: 12.5px;
}

.login-field {
  display: grid;
  gap: 5px;
  margin-bottom: 13px;
}

.login-field span {
  color: var(--l-cyan);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.login-field input {
  padding: 10px 12px;
  border: 1px solid var(--l-line);
  border-radius: 8px;
  background: rgba(4, 12, 24, 0.55);
  color: var(--l-text);
  font: inherit;
  font-size: 14px;
  outline: none;
}

html[data-theme="light"] .login-field input { background: rgba(255, 255, 255, 0.9); }

.login-field input:focus {
  border-color: var(--l-cyan);
  box-shadow: 0 0 0 3px rgba(54, 214, 255, 0.18);
}

.login-error {
  margin: 2px 0 10px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 90, 110, 0.55);
  border-radius: 7px;
  background: rgba(255, 90, 110, 0.09);
  color: var(--l-red);
  font-size: 12.5px;
}

.login-submit {
  width: 100%;
  margin-top: 6px;
  padding: 11px 14px;
  border: 1px solid var(--l-cyan);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(54, 214, 255, 0.2), rgba(169, 139, 255, 0.2));
  color: var(--l-text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
}

.login-submit:hover { box-shadow: 0 0 18px rgba(54, 214, 255, 0.45); transform: translateY(-1px); }
.login-submit:disabled { opacity: 0.6; cursor: wait; transform: none; }

.login-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  color: var(--l-muted);
  font-size: 11.5px;
}

.login-server {
  color: var(--l-amber);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.login-version b { color: var(--l-violet); font-weight: 700; }

.login-credit {
  position: fixed;
  left: 10px;
  bottom: 10px;
  z-index: 2;
}

.login-credit .sm-local-credit {
  display: inline-flex;
  padding: 3px 9px;
  border: 1px solid rgba(0, 194, 215, 0.7);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(13, 28, 34, 0.92), rgba(6, 13, 17, 0.92));
  color: #dffaff;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

html[data-theme="light"] .login-credit .sm-local-credit {
  border-color: #26889d;
  background: rgba(255, 255, 255, 0.9);
  color: #174b5a;
}

@media (prefers-reduced-motion: reduce) {
  .login-globe-map, .login-card { animation: none; }
}

/* Заставка (этап 31): 3D-сцена вместо прежнего фона; окно входа появляется, когда сюжет дошёл до стола. */
#intro-canvas {
  position: fixed;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
}

.login-page.has-intro { background: #010207; }
.has-intro #intro-canvas { display: block; }
.has-intro .login-globe,
.has-intro #login-sky,
.has-intro #login-orbits { display: none; }

.has-intro .login-card {
  transition: opacity 0.9s ease, transform 0.9s ease;
  animation: none;
}

.has-intro:not(.intro-ready) .login-card {
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  pointer-events: none;
}

@media (min-width: 1100px) {
  .has-intro .login-wrap { justify-items: end; padding-right: 6vw; }
}

.intro-hud {
  position: fixed;
  left: 22px;
  top: 16vh;
  z-index: 2;
  display: grid;
  gap: 10px;
  width: 230px;
  pointer-events: none;
}

.intro-hud-block {
  --c: 54, 214, 255;
  padding: 8px 12px;
  border: 1px solid rgba(var(--c), 0.35);
  border-left: 3px solid rgb(var(--c));
  border-radius: 8px;
  background: rgba(4, 12, 24, 0.62);
  color: #e5f1fb;
  box-shadow: 0 0 18px rgba(var(--c), 0.12);
  backdrop-filter: blur(4px);
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.intro-hud-block span { display: block; color: #8ea6bd; font-size: 11px; letter-spacing: 0.04em; }
.intro-hud-block b { display: block; margin-top: 2px; color: rgb(var(--c)); font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.intro-hud-block.is-green { --c: 57, 255, 159; }
.intro-hud-block.is-pink { --c: 255, 90, 180; }
.intro-hud-block.is-violet { --c: 169, 139, 255; }
.intro-hud-block.is-amber { --c: 255, 176, 32; }
.intro-hud.is-shown .intro-hud-block { opacity: 1; transform: none; }
.intro-hud.is-shown .intro-hud-block:nth-child(2) { transition-delay: 0.12s; }
.intro-hud.is-shown .intro-hud-block:nth-child(3) { transition-delay: 0.24s; }
.intro-hud.is-shown .intro-hud-block:nth-child(4) { transition-delay: 0.36s; }
.intro-hud.is-shown .intro-hud-block:nth-child(5) { transition-delay: 0.48s; }

.login-replay {
  position: fixed;
  right: 14px;
  bottom: 12px;
  z-index: 3;
  padding: 6px 12px;
  border: 1px solid rgba(54, 214, 255, 0.55);
  border-radius: 7px;
  background: rgba(4, 12, 24, 0.7);
  color: #bff3ff;
  font: 600 12px/1.3 "Segoe UI", Roboto, Arial, sans-serif;
  cursor: pointer;
}

.login-replay:hover { box-shadow: 0 0 14px rgba(54, 214, 255, 0.45); }

/* Просмотр заставки: окно входа и кнопки скрыты; клавиша, щелчок или движение мыши возвращают их */
.intro-watch .login-wrap,
.intro-watch .login-replay,
.intro-watch .login-theme,
.intro-watch .login-credit { opacity: 0; pointer-events: none; transition: opacity 0.5s ease; }

@media (max-width: 900px) {
  .intro-hud { left: 10px; right: 10px; top: 10px; width: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .intro-hud-block:nth-child(n + 4) { display: none; }
}
