#login {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background-color: #090d1a !important;
  background-position: center center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-image:
    linear-gradient(110deg, rgba(8, 12, 26, 0.22) 0%, rgba(8, 12, 26, 0.36) 52%, rgba(8, 12, 26, 0.68) 100%),
    url("/static/img/bg1.webp") !important;
  animation: fbBaseSwap 32s linear infinite;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

#login::before,
#login::after {
  content: "";
  position: fixed;
  inset: -2%;
  z-index: 0;
  pointer-events: none;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  will-change: opacity, transform;
}

#login::before {
  background-image:
    linear-gradient(110deg, rgba(8, 12, 26, 0.22) 0%, rgba(8, 12, 26, 0.36) 52%, rgba(8, 12, 26, 0.68) 100%),
    url("/static/img/bg2.webp");
  opacity: 0;
  animation: fbLayerBefore 32s ease-in-out infinite;
}

#login::after {
  background-image:
    linear-gradient(110deg, rgba(8, 12, 26, 0.22) 0%, rgba(8, 12, 26, 0.36) 52%, rgba(8, 12, 26, 0.68) 100%),
    url("/static/img/bg4.webp");
  opacity: 0;
  animation: fbLayerAfter 32s ease-in-out infinite;
}

@keyframes fbBaseSwap {
  0%, 34.9% {
    background-image:
      linear-gradient(110deg, rgba(8, 12, 26, 0.22) 0%, rgba(8, 12, 26, 0.36) 52%, rgba(8, 12, 26, 0.68) 100%),
      url("/static/img/bg1.webp");
  }
  35%, 84.9% {
    background-image:
      linear-gradient(110deg, rgba(8, 12, 26, 0.22) 0%, rgba(8, 12, 26, 0.36) 52%, rgba(8, 12, 26, 0.68) 100%),
      url("/static/img/bg3.webp");
  }
  85%, 100% {
    background-image:
      linear-gradient(110deg, rgba(8, 12, 26, 0.22) 0%, rgba(8, 12, 26, 0.36) 52%, rgba(8, 12, 26, 0.68) 100%),
      url("/static/img/bg1.webp");
  }
}

@keyframes fbLayerBefore {
  0%, 21%   { opacity: 0; transform: scale(1.0); }
  27%       { opacity: 1; transform: scale(1.015); }
  47%       { opacity: 1; transform: scale(1.045); }
  53%, 100% { opacity: 0; transform: scale(1.06); }
}

@keyframes fbLayerAfter {
  0%, 71%   { opacity: 0; transform: scale(1.0); }
  77%       { opacity: 1; transform: scale(1.015); }
  94%       { opacity: 1; transform: scale(1.045); }
  100%      { opacity: 0; transform: scale(1.06); }
}

#login form {
  z-index: 2;
  width: 90%;
  max-width: 375px !important;
  padding: 36px 32px 28px;
  border-radius: 22px;
  background: rgba(13, 19, 38, 0.56);
  backdrop-filter: blur(22px) saturate(165%);
  -webkit-backdrop-filter: blur(22px) saturate(165%);
  border: 1px solid rgba(165, 210, 255, 0.24);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.54),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  box-sizing: border-box;
  animation: cardFadeIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 920px) {
  #login form {
    left: auto !important;
    right: 8vw;
    top: 50%;
    transform: translateY(-50%) !important;
  }
}

@keyframes cardFadeIn {
  from { opacity: 0; margin-top: 12px; }
  to   { opacity: 1; margin-top: 0; }
}

#login img {
  width: 58px !important;
  height: 58px !important;
  margin: 0 auto 14px !important;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(56, 189, 248, 0.3);
}

#login h1 {
  font-size: 1.5rem !important;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: #f8fafc !important;
  margin: 0 0 26px !important;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.38);
}

#login h1::after {
  content: "Private Encrypted Media Vault";
  display: block;
  margin-top: 6px;
  font-size: 0.76rem;
  font-weight: 400;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(196, 216, 248, 0.74);
}

#login input.input,
#login input[type="text"],
#login input[type="password"] {
  width: 100%;
  height: 44px;
  padding: 0 15px !important;
  margin-bottom: 14px !important;
  border-radius: 12px !important;
  background: rgba(9, 14, 28, 0.56) !important;
  border: 1px solid rgba(148, 197, 255, 0.22) !important;
  color: #f1f5f9 !important;
  font-size: 0.94rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-sizing: border-box;
}

#login input.input::placeholder,
#login input[type="text"]::placeholder,
#login input[type="password"]::placeholder {
  color: rgba(186, 204, 232, 0.56);
}

#login input.input:focus,
#login input[type="text"]:focus,
#login input[type="password"]:focus {
  outline: none !important;
  background: rgba(12, 20, 40, 0.75) !important;
  border-color: rgba(103, 232, 249, 0.8) !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2) !important;
}

#login input[type="submit"],
#login .button {
  width: 100%;
  height: 44px;
  margin-top: 6px !important;
  border: none !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 55%, #d946ef 100%) !important;
  color: #ffffff !important;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(129, 140, 248, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

#login input[type="submit"]:hover,
#login .button:hover {
  transform: translateY(-1px);
  filter: brightness(1.07);
  box-shadow: 0 14px 30px rgba(168, 85, 247, 0.42);
}

#login input[type="submit"]:active,
#login .button:active {
  transform: translateY(0);
}

#login form::after {
  content: "WebP · AVIF · Private Gallery · TLS 1.3";
  display: block;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 197, 255, 0.14);
  text-align: center;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: rgba(186, 204, 232, 0.56);
}

#login .wrong {
  margin-bottom: 16px;
  padding: 10px 12px !important;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.25) !important;
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fecaca !important;
  font-size: 0.86rem;
}

#login p {
  color: rgba(165, 210, 255, 0.8) !important;
  text-align: center !important;
  margin-top: 14px !important;
}