@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/*********************************** Estilos Generales ***********************************/

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

/*********************************** Layout Login (flotante centrado) ***********************************/

.login-page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.login-card {
  --login-brand: #155482;
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 18px;
  box-shadow:
    0 24px 60px rgba(15, 23, 42, 0.18),
    0 2px 0 rgba(255, 255, 255, 0.35) inset;
  padding: 2rem 2rem 1.75rem;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

@media (min-width: 1600px) {
  .login-card {
    max-width: 460px;
    padding: 2.25rem 2.25rem 1.75rem;
  }
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 3rem;
}

.login-logo img {
  width: min(100%, 280px);
  height: auto;
  display: block;
}

/*********************************** Título con flechas (jerarquía secundaria) ***********************************/

.login-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  text-align: center;
  text-transform: uppercase;
  font-size: clamp(0.9rem, 1.5vw, 1.05rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.3;
  color: #155482;
  opacity: 0.88;
}

.login-title span {
  white-space: nowrap;
}

.login-title-arrow {
  width: 16px;
  height: auto;
  flex-shrink: 0;
  display: block;
  opacity: 0.8;
}

.login-title-arrow--right {
  transform: scaleX(-1);
}

/*********************************** Formulario ***********************************/

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-field .form-label {
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #155482;
}

.login-input.form-control {
  height: 42px;
  padding: 0.5rem 0.85rem;
  font-size: 0.9375rem;
  font-weight: 400;
  color: #1f2937;
  background-color: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(209, 213, 219, 0.95);
  border-radius: 10px;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

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

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

.login-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.login-password-toggle:hover:not(:disabled) {
  color: #374151;
  background-color: rgba(15, 23, 42, 0.05);
}

.login-password-toggle:focus-visible {
  outline: 2px solid var(--login-brand);
  outline-offset: 1px;
}

.login-password-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.login-password-icon {
  display: block;
}

.login-password-icon[hidden] {
  display: none;
}

.login-input.form-control::placeholder {
  color: #9ca3af;
}

.login-input.form-control:hover {
  border-color: #9ca3af;
  background-color: rgba(255, 255, 255, 0.92);
}

.login-input.form-control:focus {
  border-color: var(--login-brand);
  background-color: #fff;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--login-brand) 22%, transparent);
  outline: 0;
}

.login-input.form-control.is-loading {
  color: #6b7280;
}

.login-submit {
  margin-top: 0.25rem;
  width: 100%;
  height: 42px;
  border: none;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  background: #155482;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: filter 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.login-submit:hover:not(:disabled) {
  filter: brightness(0.92);
}

.login-submit:active:not(:disabled) {
  transform: translateY(1px);
}

.login-submit:disabled {
  opacity: 0.75;
  cursor: not-allowed;
  filter: none;
}

.login-submit-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: login-spin 0.7s linear infinite;
}

.login-card .login-alert,
.login-card .alert {
  margin-bottom: 1rem;
  font-size: 0.875rem;
  line-height: 1.4;
}

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

@media (max-width: 480px) {
  .login-card {
    padding: 1.5rem 1.25rem 1.25rem;
    border-radius: 16px;
  }

  .login-title-arrow {
    width: 14px;
  }
}

/*********************************** Estilos del Imagen de Fondo ***********************************/

.back-img {
  position: fixed;
  z-index: -10;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.back-img .img-fluid {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/*********************************** Estilos del Fondo Animado ***********************************/

.bg {
  animation: slide 15s ease-in-out infinite alternate;
  background-image: linear-gradient(-60deg, #d2d2d27a 50%, #9595953a 50%);
  bottom: 0;
  left: -50%;
  opacity: 0.12;
  position: fixed;
  right: -50%;
  top: 0;
  z-index: -1;
  will-change: transform;
}

.bg2 {
  animation-direction: alternate-reverse;
  animation-duration: 17s;
  opacity: 0.1;
}

.bg3 {
  animation-duration: 19s;
  opacity: 0.08;
}

@keyframes slide {
  0% {
    transform: translateX(-12%);
  }

  100% {
    transform: translateX(12%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg,
  .bg2,
  .bg3 {
    animation: none;
  }

  .login-submit-spinner {
    animation: none;
    border-top-color: rgba(255, 255, 255, 0.8);
  }
}

/* Fallback si backdrop-filter no está disponible */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .login-card {
    background: rgba(255, 255, 255, 0.94);
  }
}
