.login-page {
  margin: 0;
  min-height: 100svh;
  overflow-x: hidden;
  position: relative;
  isolation: isolate;
  background-color: #1a2130;
}

.login-page::before {
  content: "";
  position: fixed;
  inset: -8%;
  background: url("../../img/login.c200a18c3c19.png") center center / cover no-repeat;
  transform: scale(1.14);
  transform-origin: center;
  animation: login-space-drift 20s ease-in-out infinite alternate;
  will-change: transform;
  z-index: -2;
}

.login-page::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 22% 18%, rgba(118, 201, 216, 0.14), transparent 42%),
    radial-gradient(circle at 78% 22%, rgba(165, 195, 255, 0.08), transparent 48%);
  pointer-events: none;
  z-index: -1;
}

.login-overlay {
  min-height: 100svh;
  width: 100%;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(18, 25, 37, 0.34), rgba(18, 25, 37, 0.60)),
    radial-gradient(circle at 20% 20%, rgba(89,185,199,0.18), transparent 45%);
  margin: 0;
  padding: 1.2rem;
}

@keyframes login-space-drift {
  0% {
    transform: scale(1.14) translate3d(-4.2%, -3.1%, 0) rotate(-0.28deg);
  }

  50% {
    transform: scale(1.18) translate3d(3.8%, -5.2%, 0) rotate(0.22deg);
  }

  100% {
    transform: scale(1.16) translate3d(5.1%, 3.3%, 0) rotate(0.34deg);
  }
}

.login-card {
  width: min(440px, 100%);
  background: linear-gradient(165deg, rgba(41, 50, 66, 0.97), rgba(30, 38, 52, 0.95));
  color: #d2dee3;
  border: 1px solid rgba(174, 190, 210, 0.34);
  border-radius: 20px;
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.34), 0 2px 10px rgba(89, 185, 199, 0.16);
  backdrop-filter: blur(6px);
  padding: 1.35rem 1.15rem 1.15rem;
  margin: 0;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, #7dd3de 0%, #59b9c7 50%, #7dd3de 100%);
  pointer-events: none;
}

.login-card,
.login-card * {
  font-family: var(--fuente-principal);
}

.login-logo {
  text-align: center;
  margin-bottom: 0.2rem;
}

.login-logo img {
  height: 36px;
  width: auto;
}

.login-title {
  margin: 0;
  text-align: center;
  font-size: 1.7rem;
  font-weight: 900;
  color: #f4fbff;
  letter-spacing: 0.2px;
}

.login-subtitle {
  margin: 0.15rem 0 0;
  text-align: center;
  color: #b6c8d6;
  font-weight: 600;
  font-size: 0.9rem;
}

.login-divider {
  height: 4px;
  background: #59b9c7;
  width: 100%;
  max-width: 260px;
  border-radius: 2px;
  margin: 0.55rem auto 0.9rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin: 0;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.login-form label {
  color: #d6e2ea;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: left;
  padding-left: 0.1rem;
}

.login-form input {
  width: 100%;
  max-width: none;
  padding: 0.72rem 0.8rem;
  border-radius: 10px;
  border: 1px solid rgba(174, 190, 210, 0.42);
  background: rgba(255, 255, 255, 0.96);
  color: #2b313f;
  font-size: 0.95rem;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.login-form input::placeholder {
  color: #7d8b98;
}

.login-password-wrap {
  position: relative;
}

.login-password-wrap input {
  padding-right: 5.5rem;
}

.login-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
  border: 1px solid rgba(174, 190, 210, 0.5);
  background: rgba(255, 255, 255, 0.95);
  color: #2b313f;
  border-radius: 8px;
  padding: 0.28rem 0.55rem;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  line-height: 1;
}

.login-password-toggle:hover {
  border-color: #59b9c7;
  color: #0f4c75;
}

.login-password-toggle:focus-visible {
  outline: 2px solid rgba(89, 185, 199, 0.7);
  outline-offset: 2px;
}

.login-error {
  margin: 0;
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(215, 154, 162, 0.45);
  background: rgba(139, 0, 0, 0.10);
  color: #ffd2d8;
  font-size: 0.88rem;
  line-height: 1.3;
  text-align: center;
}

.login-card input:focus {
  outline: none;
  border-color: #59b9c7;
  box-shadow: 0 0 0 3px rgba(89, 185, 199, 0.55);
  background: #ffffff;
}

.login-form .btn-submit.login-submit {
  width: 100%;
  margin: 0.3rem 0 0;
  min-height: 46px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.15px;
  background: linear-gradient(180deg, #72cedb 0%, #59b9c7 52%, #4eaab9 100%) !important;
  border-color: #90d4de !important;
  color: #1f2d40 !important;
}

.login-form .btn-submit.login-submit:not(:disabled):hover {
  background: linear-gradient(180deg, #7ad4e0 0%, #61c2cf 52%, #55b4c3 100%) !important;
  border-color: #98d9e2 !important;
  color: #172233 !important;
  filter: none !important;
  box-shadow: 0 6px 16px rgba(18, 35, 55, 0.22) !important;
}

.login-form .btn-submit.login-submit:not(:disabled):active {
  transform: translateY(0) !important;
}

@media (max-width: 768px) {
  .login-page {
    overflow-x: hidden;
  }
}

@media (max-width: 520px) {
  .login-overlay {
    padding: 0.85rem;
  }

  .login-card {
    border-radius: 14px;
    padding: 1rem 0.9rem 0.95rem;
  }

  .login-title {
    font-size: 1.35rem;
  }

  .login-logo img {
    height: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-page::before {
    animation: none;
    transform: scale(1.14);
  }
}
