* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #0f172a;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 28px 18px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 115%, rgba(25, 118, 210, 0.55), transparent 44%),
    linear-gradient(145deg, #031634 0%, #0a2c63 45%, #071a3d 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -26%;
  pointer-events: none;
  z-index: 0;
  filter: blur(64px);
  opacity: 0.72;
  transform: translate3d(0, 0, 0);
}

body::before {
  background:
    radial-gradient(closest-side at 22% 35%, rgba(36, 112, 255, 0.62), transparent 70%),
    radial-gradient(closest-side at 68% 24%, rgba(10, 184, 255, 0.34), transparent 68%),
    radial-gradient(closest-side at 74% 76%, rgba(25, 70, 166, 0.58), transparent 70%),
    radial-gradient(closest-side at 30% 82%, rgba(225, 25, 45, 0.13), transparent 62%);
  animation: liquid-drift 20s ease-in-out infinite alternate;
}

body::after {
  background:
    radial-gradient(closest-side at 42% 30%, rgba(255, 255, 255, 0.12), transparent 66%),
    radial-gradient(closest-side at 54% 70%, rgba(37, 99, 235, 0.34), transparent 70%),
    radial-gradient(closest-side at 15% 72%, rgba(14, 165, 233, 0.22), transparent 64%);
  mix-blend-mode: screen;
  animation: liquid-breathe 16s ease-in-out infinite alternate;
}

body > * {
  position: relative;
  z-index: 1;
}

.login-card {
  width: min(410px, 100%);
  padding: 38px 34px 30px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 255, 0.88));
  box-shadow:
    0 28px 80px rgba(1, 10, 28, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.login-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.62);
  box-shadow:
    0 34px 96px rgba(1, 10, 28, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.login-card .logo {
  width: auto;
  height: auto;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.login-card .logo img {
  display: block;
  width: 148px;
  height: 148px;
  object-fit: contain;
}

.login-card h2 {
  margin: 0 0 28px;
  color: #08204a;
  font-size: 28px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0;
}

.login-card input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  margin-bottom: 16px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.86);
  color: #0f172a;
  font-size: 16px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-card input::placeholder {
  color: #7c8aa5;
}

.login-card input:focus {
  background: #fff;
  border-color: #2563eb;
  box-shadow:
    0 0 0 4px rgba(37, 99, 235, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.password-field {
  position: relative;
  width: 100%;
}

.password-field input {
  padding-right: 54px;
}

.login-card .password-toggle {
  position: absolute;
  right: 9px;
  top: 8px;
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #1d4ed8;
  font-size: 17px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card .password-toggle::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 2px;
  border-radius: 999px;
  background: #1d4ed8;
  transform: rotate(-38deg);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.75);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.login-card .password-toggle.is-visible::after {
  opacity: 0;
  transform: rotate(-38deg) scaleX(0.35);
}

.login-card .password-toggle:hover {
  background: rgba(37, 99, 235, 0.1);
  transform: none;
}

.login-card button {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: none;
  border-radius: 15px;
  background: linear-gradient(135deg, #0d47a1, #2563eb 58%, #3b82f6);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.34);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.login-card button:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow: 0 20px 42px rgba(37, 99, 235, 0.42);
}

.login-card button:disabled {
  opacity: 0.78;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.login-card .forgot-password {
  min-height: 34px;
  width: auto;
  margin: 12px auto 0;
  padding: 0 4px;
  background: transparent;
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 700;
  box-shadow: none;
}

.login-card .forgot-password:hover {
  background: transparent;
  color: #0d47a1;
  text-decoration: underline;
  transform: none;
  box-shadow: none;
}

.login-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-left: 8px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  vertical-align: -2px;
  animation: login-spin 0.8s linear infinite;
}

.hidden {
  display: none !important;
}

.login-card p {
  margin: 16px 0 12px;
  color: #5d6b82;
  font-size: 14px;
}

.login-card > button:last-of-type {
  min-height: 46px;
  margin-top: 4px;
  background: rgba(8, 32, 74, 0.08);
  color: #0d47a1;
  box-shadow: none;
}

.login-card > button:last-of-type:hover {
  background: rgba(13, 71, 161, 0.12);
  box-shadow: none;
}

.login-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 10, 28, 0.62);
  backdrop-filter: blur(8px);
  z-index: 1000;
}

.login-modal-content {
  width: min(430px, 100%);
  padding: 28px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(1, 10, 28, 0.4);
}

.login-modal-content h3 {
  margin: 0 0 12px;
  color: #08204a;
  font-size: 22px;
}

.login-modal-content p {
  margin: 0 0 22px;
  color: #475569;
  line-height: 1.55;
}

.login-modal-content button {
  width: auto;
  min-width: 132px;
  min-height: 46px;
  padding: 0 20px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #0d47a1, #2563eb);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

@keyframes login-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes liquid-drift {
  0% {
    transform: translate3d(-2%, -1%, 0) scale(1);
  }
  50% {
    transform: translate3d(3%, 2%, 0) scale(1.06);
  }
  100% {
    transform: translate3d(-1%, 3%, 0) scale(1.03);
  }
}

@keyframes liquid-breathe {
  0% {
    transform: translate3d(2%, 2%, 0) scale(1.04) rotate(0deg);
    opacity: 0.54;
  }
  100% {
    transform: translate3d(-3%, -1%, 0) scale(1.12) rotate(5deg);
    opacity: 0.78;
  }
}

@media (max-width: 560px) {
  body {
    align-items: flex-start;
    padding: 28px 14px;
  }

  body::before,
  body::after {
    inset: -18%;
    filter: blur(48px);
  }

  .login-card {
    margin-top: 10px;
    padding: 30px 22px 24px;
    border-radius: 22px;
  }

  .login-card .logo {
    width: auto;
    height: auto;
    border-radius: 0;
    margin-bottom: 16px;
  }

  .login-card .logo img {
    width: 124px;
    height: 124px;
  }

  .login-card h2 {
    font-size: 24px;
    margin-bottom: 22px;
  }

  .login-card input,
  .login-card button {
    min-height: 50px;
  }

  .login-modal-content {
    padding: 24px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
