/* Страница входа — неон, сетка, анимированный логотип */

/* Прокрутка на телефонах: не режем overflow у корня, даём iOS нормальный touch-scroll */
html.page-login,
html.page-login body.page-login-body {
  height: auto;
  min-height: 100dvh;
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.login-page {
  box-sizing: border-box;
  min-height: 100dvh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  padding: max(20px, env(safe-area-inset-top, 0px)) 16px max(28px, env(safe-area-inset-bottom, 0px));
  position: relative;
  overflow-x: hidden;
  overflow-y: visible;
}

/* Браузеры без safe center: на низком экране не «режем» контент по вертикали */
@supports not (justify-content: safe center) {
  @media (max-height: 720px) {
    .login-page {
      justify-content: flex-start;
    }
  }
}

.login-page::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(ellipse 80% 50% at 50% 20%, rgba(31, 209, 255, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 80% 70%, rgba(0, 119, 255, 0.08), transparent 50%);
  pointer-events: none;
}

.login-shell {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.login-hero-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.login-brand-line {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg3);
  text-align: center;
  width: 100%;
}

.login-lang-foot {
  width: 100%;
  margin-top: 4px;
}

.login-page .app-footer {
  width: 100%;
  margin-top: 0.5rem;
  padding-left: 0;
  padding-right: 0;
}

.login-hero-wrap {
  position: relative;
  width: 168px;
  height: 150px;
  display: grid;
  place-items: center;
}

.login-hero-logo {
  position: relative;
  z-index: 1;
  width: 124px;
  height: auto;
  max-height: 124px;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(31, 209, 255, 0.55)) drop-shadow(0 0 28px rgba(0, 119, 255, 0.35));
  animation: login-hero-float 4.2s ease-in-out infinite;
}

.login-hero-flame {
  position: absolute;
  bottom: 14%;
  left: 50%;
  width: 34px;
  height: 38px;
  margin-left: -17px;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 140, 60, 0.95), rgba(255, 60, 40, 0.4) 45%, transparent 70%);
  border-radius: 50% 50% 40% 40%;
  filter: blur(0.5px);
  animation: login-flame-pulse 0.45s ease-in-out infinite alternate;
  opacity: 0.85;
  pointer-events: none;
}

@keyframes login-hero-float {
  0%,
  100% {
    transform: translate(0, 0) rotate(-6deg);
  }
  50% {
    transform: translate(8px, -18px) rotate(4deg);
  }
}

@keyframes login-flame-pulse {
  from {
    transform: scaleY(0.85);
    opacity: 0.75;
  }
  to {
    transform: scaleY(1.1);
    opacity: 1;
  }
}

.login-card {
  width: 100%;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 22px 22px 20px;
  box-shadow:
    0 0 0 1px rgba(31, 209, 255, 0.06),
    0 18px 48px rgba(0, 0, 0, 0.35);
}

.login-card h1 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 6px;
  color: var(--fg1);
}

.login-card .login-lead {
  font-size: 13px;
  color: var(--fg3);
  margin: 0 0 18px;
  line-height: 1.45;
}

.login-field {
  margin-bottom: 14px;
}

.login-field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg3);
  margin-bottom: 6px;
}

.login-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--panel-2);
  color: var(--fg1);
  font-size: 14px;
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.login-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cyan-500) 22%, transparent);
}

.login-actions {
  margin-top: 18px;
}

.login-actions .btn {
  width: 100%;
  justify-content: center;
  min-height: 42px;
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-err {
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--red-500) 14%, var(--panel-2));
  border: 1px solid color-mix(in srgb, var(--red-500) 45%, var(--border));
  color: var(--fg1);
  font-size: 13px;
  display: none;
}

.login-err.show {
  display: block;
}

.login-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.login-stars span {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(95, 224, 255, 0.7);
  border-radius: 50%;
  animation: login-star 3s linear infinite;
  opacity: 0;
}

@keyframes login-star {
  0% {
    opacity: 0;
    transform: translateY(0);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-120px);
  }
}
