/* ─────────── Fix Autocompletado WebKit ─────────── */
.custom-input:-webkit-autofill,
.custom-input:-webkit-autofill:hover,
.custom-input:-webkit-autofill:focus,
.custom-input:-webkit-autofill:active,
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus,
.form-control:-webkit-autofill:active {
  /* Fuerza el color del texto a blanco */
  -webkit-text-fill-color: #fff !important;

  /* TRUCO: Retrasa la transición del color de fondo por 5000 segundos.
       Esto evita que el navegador aplique su fondo blanco y mantiene la transparencia */
  transition: background-color 5000s ease-in-out 0s;

  /* Mantiene el borde que definimos originalmente */
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body {
  background: var(--primary-color, #0f172a); /* Fondo de respaldo oscuro */
  color: #fff;
  min-height: 100vh;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* ─────────── Gráfico de Fondo ─────────── */
#chart-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.3; /* Ligeramente más visible en pantallas grandes */
  pointer-events: none;
}

#chart-background::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(14, 39, 67, 0.8) 0%,
    rgba(0, 18, 32, 0.95) 100%
  );
  z-index: 1; /* Se sitúa frente al canvas del gráfico, pero detrás del contenido */
  pointer-events: none;
}

/* ─────────── Layout Principal ─────────── */
.login-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 450px; /* Tamaño ideal para tarjetas de login */
  padding: 2rem 1.5rem;
  z-index: 10;
}

.logo-link {
  margin-bottom: 1.5rem;
  transition: opacity 0.3s ease;
}

.logo-link:hover {
  opacity: 0.8;
}

#logo-login {
  max-width: 16rem;
  width: 100%;
}

.platform-title {
  text-align: center;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 300;
  line-height: 1.4;
  margin-bottom: 2rem;
  letter-spacing: 0.5px;
}

/* ─────────── Tarjeta de Login (Glassmorphism) ─────────── */
#loggin {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.08); /* Más sutil */
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 1.25rem;
  padding: 2.5rem 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.text-muted-custom {
  color: #94a3b8;
  font-size: 0.9rem;
}

/* ─────────── Inputs Personalizados ─────────── */
.custom-input,
.form-control {
  background-color: rgba(0, 0, 0, 0.2) !important; /* Oscuro translúcido */
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.custom-input::placeholder,
.form-control::placeholder {
  color: rgba(255, 255, 255, 0.4) !important;
}

.custom-input:focus,
.form-control:focus {
  background-color: rgba(0, 0, 0, 0.4) !important;
  border-color: #5bc0ff !important;
  box-shadow: 0 0 0 0.25rem rgba(91, 192, 255, 0.25) !important;
}

/* ─────────── Toggle de Contraseña ─────────── */
.password-box {
  position: relative;
}

.password-box input.custom-input {
  padding-right: 3rem; /* Espacio para el ojo */
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.2s;
  cursor: pointer;
}

.password-toggle:hover {
  color: #fff;
}

svg.password-icon {
  height: 18px;
  width: 18px;
}

/* ─────────── Botones y Enlaces ─────────── */
.btn-custom-primary {
  background-color: #0284c7; /* Azul moderno */
  border: none;
  color: #fff;
  border-radius: 0.5rem;
  transition:
    background-color 0.3s,
    transform 0.1s;
}

.btn-custom-primary:hover {
  background-color: #0369a1;
  color: #fff;
}

.btn-custom-primary:active {
  transform: scale(0.98);
}

.link-contrast {
  color: #38bdf8;
  transition: color 0.2s;
}

.link-contrast:hover {
  color: #7dd3fc;
  text-decoration: underline !important;
}

/* ─────────── Media Queries ─────────── */
@media (max-width: 576px) {
  #chart-background {
    opacity: 0.15; /* Menos distracción en móvil */
  }

  #loggin {
    padding: 2rem 1.25rem;
  }
}
