/*
 * GALACTIC ERP — Login screen
 * Builds on design-system.css. Pure CSS, no JavaScript.
 * Background: 6 cinematic module scenes, 9s each, Ken Burns crossfade.
 */

.login-body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--g-navy);
}

.login-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.login-slides {
  position: absolute;
  inset: 0;
}

.login-slides img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transform: scale(1.06);
  animation: loginKen 54s infinite;
  will-change: opacity, transform;
}

.login-slides img:nth-child(1) {
  opacity: 1;
  animation-name: loginKenFirst;
  animation-delay: 0s;
}
.login-slides img:nth-child(2) { animation-delay: 9s; }
.login-slides img:nth-child(3) { animation-delay: 18s; }
.login-slides img:nth-child(4) { animation-delay: 27s; }
.login-slides img:nth-child(5) { animation-delay: 36s; }
.login-slides img:nth-child(6) { animation-delay: 45s; }

@keyframes loginKenFirst {
  0% {
    opacity: 1;
    transform: scale(1.05) translate3d(0, 0, 0);
  }
  14.5% { opacity: 1; }
  18.5% {
    opacity: 0;
    transform: scale(1.14) translate3d(1.2%, 0, 0);
  }
  100% {
    opacity: 0;
    transform: scale(1.14);
  }
}

@keyframes loginKen {
  0% {
    opacity: 0;
    transform: scale(1.05) translate3d(0, 0, 0);
  }
  3.5% { opacity: 1; }
  14.5% { opacity: 1; }
  18.5% {
    opacity: 0;
    transform: scale(1.14) translate3d(1.2%, 0, 0);
  }
  100% {
    opacity: 0;
    transform: scale(1.14);
  }
}

.login-atmosphere {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 10, 22, 0.58) 0%, rgba(16, 20, 43, 0.28) 42%, rgba(8, 10, 22, 0.62) 100%),
    radial-gradient(900px 520px at 10% 15%, rgba(122, 48, 151, 0.22), transparent 58%),
    radial-gradient(760px 480px at 90% 10%, rgba(62, 90, 201, 0.18), transparent 55%);
}

.login-topbar,
.login-main,
.login-footer,
.login-dots { position: relative; z-index: 1; }

.login-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: linear-gradient(180deg, rgba(8, 10, 22, 0.42), transparent);
}

.login-brand-mark {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.login-brand-mark .g-logo-mark { width: 2.15rem; height: 2.15rem; }
.login-brand-mark .g-logo-wordmark { height: 0.82rem; max-width: 8.2rem; }

.login-topbar .lang-form select {
  border: 0;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink-900);
}
.login-topbar .inline-apply .btn {
  border-color: rgba(255, 255, 255, 0.35);
  color: #EDEEF5;
}
.login-topbar .inline-apply .btn:hover { background: rgba(255, 255, 255, 0.14); }

.login-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: var(--sp-4) var(--sp-4) var(--sp-7);
}

.login-card {
  width: min(420px, 100%);
  text-align: center;
  background: rgba(255, 255, 255, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 4vw, 2.5rem);
  box-shadow:
    0 30px 70px rgba(6, 8, 20, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
}

.login-hero-logo {
  margin: 0 auto var(--sp-4);
  width: min(196px, 72%);
}
.login-hero-logo .g-logo-stacked { width: 100%; }

.login-eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: var(--fs-xs);
  color: var(--primary-strong);
  font-weight: 800;
}

.login-title {
  margin: 0.35rem 0 var(--sp-2);
  font-size: clamp(1.6rem, 4vw, 2rem);
  color: var(--ink-900);
  line-height: 1.15;
}

.login-lead {
  margin: 0 0 var(--sp-5);
  color: var(--ink-700);
  font-size: var(--fs-base);
}

.login-form { display: grid; gap: var(--sp-4); text-align: start; }

.login-field { display: grid; gap: var(--sp-2); font-size: var(--fs-sm); color: var(--ink-800); }
.login-field span { font-weight: 700; }

.login-field .auth-input,
.login-field input {
  width: 100%;
  border: 1.5px solid rgba(16, 20, 43, 0.14);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.9rem;
  font: inherit;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-900);
  transition: border-color 160ms, box-shadow 160ms, background 160ms;
}
.login-field .auth-input:focus,
.login-field input:focus {
  outline: none;
  border-color: var(--secondary);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 4px rgba(62, 90, 201, 0.22);
}

.login-password-wrap {
  position: relative;
}
.login-password-wrap .auth-input,
.login-password-wrap input {
  padding-inline-end: 3.15rem;
}

.login-eye {
  position: absolute;
  inset-inline-end: 0.4rem;
  top: 50%;
  width: 2.15rem;
  height: 2.15rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #4B4E72;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.95), transparent 52%),
    rgba(247, 247, 251, 0.88);
  box-shadow:
    0 1px 2px rgba(16, 20, 43, 0.08),
    0 6px 14px rgba(16, 20, 43, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transform: translateY(-50%);
  transition:
    color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}
.login-eye:hover {
  color: #5F2179;
  transform: translateY(-50%) scale(1.07);
  box-shadow:
    0 4px 16px rgba(122, 48, 151, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}
.login-eye:active { transform: translateY(-50%) scale(0.96); }
.login-eye:focus-visible {
  outline: 3px solid var(--secondary);
  outline-offset: 2px;
}
.login-eye.is-revealed {
  color: #fff;
  background: linear-gradient(145deg, #9A3FBE 0%, #7A3097 42%, #3E5AC9 100%);
  box-shadow:
    0 8px 18px rgba(122, 48, 151, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.login-eye.is-revealed:hover {
  color: #fff;
  transform: translateY(-50%) scale(1.06);
}
.login-eye svg {
  width: 1.12rem;
  height: 1.12rem;
  display: block;
}
.login-eye .icon-hide { display: none; }
.login-eye.is-revealed .icon-show { display: none; }
.login-eye.is-revealed .icon-hide { display: block; }

.login-alert {
  background: rgba(251, 231, 234, 0.88);
  color: #9C2338;
  border: 1px solid #F3C1CA;
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-sm);
  text-align: start;
}
.login-alert ul { margin: 0; padding-inline-start: 1.1rem; }

.login-submit {
  margin-top: var(--sp-1);
  border: 0;
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
  font: inherit;
  font-weight: 800;
  font-size: var(--fs-base);
  cursor: pointer;
  color: var(--white);
  background: var(--primary);
  transition: background 160ms, transform 160ms;
}
.login-submit:hover { background: var(--primary-strong); transform: translateY(-1px); }
.login-submit:active { transform: translateY(0); }

.login-dots {
  display: flex;
  justify-content: center;
  gap: 0.42rem;
  padding: 0 0 0.35rem;
}

.login-dots span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  box-shadow: 0 0 0 1px rgba(8, 10, 22, 0.15);
  animation: loginDot 54s infinite;
}

.login-dots span:nth-child(1) { animation-delay: 0s; }
.login-dots span:nth-child(2) { animation-delay: 9s; }
.login-dots span:nth-child(3) { animation-delay: 18s; }
.login-dots span:nth-child(4) { animation-delay: 27s; }
.login-dots span:nth-child(5) { animation-delay: 36s; }
.login-dots span:nth-child(6) { animation-delay: 45s; }

@keyframes loginDot {
  0%, 16.5% {
    background: #fff;
    transform: scale(1.25);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22);
  }
  18.5%, 100% {
    background: rgba(255, 255, 255, 0.32);
    transform: scale(1);
    box-shadow: 0 0 0 1px rgba(8, 10, 22, 0.15);
  }
}

.login-footer {
  width: 100%;
  margin-top: auto;
  padding: 0;
  border: 0;
  background: transparent;
  z-index: 2;
}
.login-footer__brand { display: none; }

@media (max-width: 480px) {
  .login-card { border-radius: var(--radius-md); }
}

@media (prefers-reduced-motion: reduce) {
  .login-slides img {
    animation: none;
    opacity: 0;
    transform: none;
  }
  .login-slides img:first-child { opacity: 1; }
  .login-dots span { animation: none; }
  .login-dots span:first-child {
    background: #fff;
    transform: scale(1.25);
  }
  .login-eye,
  .login-eye:hover,
  .login-eye.is-revealed:hover { transform: translateY(-50%); }
}
