/* Design note: this login surface is the reference future-science theme and
   already captures the target direction closely. Iterate carefully. */

html,
body {
  margin: 0;
  min-height: 100%;
}

body.login-page {
  min-height: 100vh;
  font-family: "IBM Plex Sans", sans-serif;
  color: #dcecf8;
  background: #07131f;
  overflow: hidden;
}

.login-page *,
.login-page *::before,
.login-page *::after {
  box-sizing: border-box;
}

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

.login-scene-image {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  filter: saturate(1.14) contrast(1.02) brightness(0.76);
  opacity: 0.98;
}

.login-scene-tint,
.login-scene-grid,
.login-scene-scan,
.login-scene-beam,
.login-scene-traces {
  position: absolute;
  inset: 0;
}

.login-scene-tint {
  z-index: 1;
  inset: -4%;
  background:
    radial-gradient(48% 52% at 74% 16%, rgba(106, 180, 255, 0.12), transparent 70%),
    radial-gradient(34% 34% at 14% 14%, rgba(17, 92, 168, 0.22), transparent 72%),
    linear-gradient(90deg, rgba(6, 17, 31, 0.82) 0%, rgba(6, 17, 31, 0.44) 22%, rgba(6, 17, 31, 0.12) 48%, rgba(6, 17, 31, 0.24) 64%, rgba(6, 17, 31, 0.72) 100%),
    linear-gradient(180deg, rgba(4, 13, 24, 0.42), rgba(4, 13, 24, 0.12) 24%, rgba(4, 13, 24, 0.54) 100%);
  animation: loginTintShift 18s ease-in-out infinite alternate;
}

.login-scene-grid {
  z-index: 2;
  inset: -8%;
  background-image:
    linear-gradient(rgba(132, 215, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(132, 215, 255, 0.16) 1px, transparent 1px);
  background-size: 82px 82px;
  mask-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.04) 0%, rgba(0, 0, 0, 0.56) 18%, rgba(0, 0, 0, 0.24) 72%, rgba(0, 0, 0, 0) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.72) 10%, rgba(0, 0, 0, 0.72) 90%, rgba(0, 0, 0, 0) 100%);
  opacity: 0.2;
  mix-blend-mode: screen;
  animation: loginGridDrift 15s linear infinite;
}

.login-scene-scan {
  z-index: 2;
  inset: -12% 10% -14% 28%;
  background: linear-gradient(
    108deg,
    transparent 0%,
    transparent 38%,
    rgba(138, 228, 255, 0.02) 44%,
    rgba(138, 228, 255, 0.14) 49%,
    rgba(255, 255, 255, 0.18) 50.5%,
    rgba(138, 228, 255, 0.1) 53%,
    transparent 60%,
    transparent 100%
  );
  filter: blur(10px);
  opacity: 0;
  mix-blend-mode: screen;
  animation: loginScanSweep 9.5s ease-in-out infinite;
}

.login-scene-beam {
  z-index: 2;
  inset: auto auto 6% 42%;
  width: min(40vw, 560px);
  height: min(36vh, 280px);
  background:
    radial-gradient(circle at 50% 54%, rgba(92, 204, 255, 0.22), transparent 58%),
    radial-gradient(circle at 50% 54%, rgba(169, 226, 255, 0.12), transparent 72%);
  filter: blur(44px);
  opacity: 0.76;
  mix-blend-mode: screen;
  animation: loginBeamPulse 8.2s ease-in-out infinite alternate;
}

.login-scene-traces {
  z-index: 2;
  inset: 7% 6% 14% 54%;
  background:
    linear-gradient(180deg, rgba(132, 215, 255, 0) 0%, rgba(132, 215, 255, 0.14) 18%, rgba(132, 215, 255, 0.05) 58%, rgba(132, 215, 255, 0) 100%),
    repeating-linear-gradient(90deg, rgba(132, 215, 255, 0.08) 0 1px, transparent 1px 52px),
    repeating-linear-gradient(180deg, rgba(132, 215, 255, 0.06) 0 1px, transparent 1px 34px);
  mask-image:
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.92) 12%, rgba(0, 0, 0, 0.92) 86%, transparent 100%),
    linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.18) 12%, rgba(0, 0, 0, 0.96) 32%, rgba(0, 0, 0, 0.96) 86%, transparent 100%);
  opacity: 0.32;
  mix-blend-mode: screen;
  filter: blur(0.2px);
  animation: loginTraceFlow 13s linear infinite;
}

.login-shell {
  position: relative;
  z-index: 3;
  min-height: 100vh;
  width: min(1220px, calc(100vw - 3rem));
  margin: 0 auto;
  padding: clamp(2rem, 4vw, 4rem);
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(280px, 360px);
  justify-content: space-between;
  align-items: end;
  gap: clamp(1.6rem, 7vw, 7rem);
}

.login-caption-card {
  justify-self: start;
  max-width: 420px;
  padding: 0 0 2vh;
}

.login-caption-tag,
.login-panel-tag {
  margin: 0 0 1rem;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(167, 224, 255, 0.84);
}

.login-caption-title {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 0.92;
  font-weight: 600;
  letter-spacing: -0.045em;
  color: #eef7ff;
  text-shadow: 0 10px 34px rgba(0, 0, 0, 0.34);
}

.login-caption-copy {
  margin: 1rem 0 0;
  max-width: 30ch;
  font-size: 1rem;
  line-height: 1.62;
  color: rgba(216, 237, 255, 0.82);
  text-shadow: 0 8px 26px rgba(0, 0, 0, 0.28);
}

.login-panel {
  justify-self: end;
  width: min(392px, 100%);
  padding: 0 0 2vh;
}

.auth-title {
  margin: 0;
  font-size: 1.48rem;
  line-height: 1.06;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: #eef7ff;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.26);
}

.auth-copy {
  margin: 0.42rem 0 0;
  font-size: 0.92rem;
  line-height: 1.54;
  color: rgba(213, 236, 255, 0.74);
}

.auth-error {
  margin-top: 0.9rem;
  padding: 0;
  border: 0;
  background: none;
  color: #ffb8a8;
  font-size: 0.82rem;
  line-height: 1.45;
}

.auth-form {
  margin-top: 1rem;
  display: grid;
  gap: 0.62rem;
}

.auth-label {
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(160, 223, 255, 0.8);
}

.auth-input {
  width: 100%;
  min-height: 44px;
  padding: 0.7rem 0 0.75rem;
  border: 0;
  border-bottom: 1px solid rgba(141, 209, 246, 0.38);
  border-radius: 0;
  background: transparent;
  color: #f2f9ff;
  font: inherit;
  font-size: 1.02rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  caret-color: #9fe8ff;
  text-shadow: 0 0 10px rgba(159, 232, 255, 0.08);
  outline: none;
  box-shadow: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease, text-shadow 0.16s ease;
}

.auth-input::placeholder {
  color: rgba(225, 240, 252, 0.3);
  letter-spacing: 0.08em;
}

.auth-input:focus {
  border-color: rgba(149, 224, 255, 0.88);
  box-shadow:
    0 1px 0 0 rgba(149, 224, 255, 0.88),
    0 14px 20px -22px rgba(110, 199, 255, 0.92);
  background: transparent;
  text-shadow: 0 0 16px rgba(159, 232, 255, 0.14);
}

.auth-input:not(:placeholder-shown) {
  border-bottom-color: rgba(166, 233, 255, 0.68);
  box-shadow: 0 1px 0 0 rgba(166, 233, 255, 0.68);
}

.auth-caps-hint {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0;
  border: 0;
  background: none;
  color: #ffcf9f;
  font-size: 0.76rem;
  line-height: 1.35;
}

.auth-caps-hint[hidden] {
  display: none;
}

.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6rem;
  width: auto;
  min-height: 0;
  padding: 0.85rem 0 0;
  border: 0;
  border-radius: 0;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ccefff;
  text-decoration: none;
  cursor: pointer;
  background: none;
  box-shadow: none;
  transition: color 0.14s ease, opacity 0.14s ease;
}

.auth-submit:hover,
.auth-submit:focus-visible {
  color: #eff9ff;
  opacity: 1;
}

.auth-submit:focus-visible {
  outline: 0;
  text-decoration: underline;
  text-underline-offset: 0.3em;
}

.auth-submit-arrow {
  transition: transform 0.14s ease;
}

.auth-submit::after {
  content: "";
  width: 3.8rem;
  height: 1px;
  margin-left: 0.25rem;
  background: linear-gradient(90deg, rgba(149, 224, 255, 0.88), rgba(149, 224, 255, 0));
}

.auth-submit:hover .auth-submit-arrow,
.auth-submit:focus-visible .auth-submit-arrow {
  transform: translateX(2px);
}

.auth-form.is-submitting .auth-submit {
  opacity: 0.76;
  pointer-events: none;
}

.auth-error-shake {
  animation: authErrorShake 0.34s ease;
}

@media (max-width: 920px) {
  body.login-page {
    overflow-y: auto;
  }

  .login-scene-image {
    object-position: center 50%;
  }

  .login-scene-grid {
    background-size: 58px 58px;
    opacity: 0.18;
  }

  .login-scene-scan {
    inset: -12% 0 -16% 14%;
  }

  .login-scene-beam {
    left: 24%;
    width: 58vw;
  }

  .login-scene-traces {
    inset: 10% 0 18% 34%;
    opacity: 0.28;
  }

  .login-shell {
    width: min(460px, calc(100vw - 1rem));
    grid-template-columns: 1fr;
    justify-content: center;
    align-items: end;
    gap: 1.2rem;
    padding: 1rem 0.65rem 1.4rem;
  }

  .login-caption-card,
  .login-panel {
    justify-self: stretch;
    width: 100%;
    padding-bottom: 0;
  }
}

@keyframes loginGridDrift {
  0% {
    background-position: 0 0, 0 0;
  }
  100% {
    background-position: -82px -82px, -82px -82px;
  }
}

@keyframes loginBeamPulse {
  0% {
    transform: translate3d(-4%, 3%, 0) scale(0.96);
    opacity: 0.36;
  }
  100% {
    transform: translate3d(4%, -4%, 0) scale(1.1);
    opacity: 0.84;
  }
}

@keyframes loginScanSweep {
  0% {
    transform: translate3d(-22%, 1%, 0);
    opacity: 0;
  }
  14% {
    opacity: 0.1;
  }
  42% {
    opacity: 0.48;
  }
  68% {
    opacity: 0.2;
  }
  100% {
    transform: translate3d(28%, -2%, 0);
    opacity: 0;
  }
}

@keyframes loginTintShift {
  0% {
    transform: translate3d(0, 0, 0);
    opacity: 0.94;
  }
  100% {
    transform: translate3d(1%, -0.85%, 0);
    opacity: 1;
  }
}

@keyframes loginTraceFlow {
  0% {
    background-position:
      0 0,
      0 0,
      0 0;
    opacity: 0.3;
  }
  50% {
    background-position:
      0 -17px,
      26px 0,
      0 17px;
    opacity: 0.34;
  }
  100% {
    background-position:
      0 -34px,
      52px 0,
      0 34px;
    opacity: 0.3;
  }
}

@keyframes authErrorShake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-3px);
  }
  40% {
    transform: translateX(3px);
  }
  60% {
    transform: translateX(-2px);
  }
  80% {
    transform: translateX(2px);
  }
}
