:root {
  --bg: #f5f7fc;
  --text: #000;
  --card-bg: #fff;
  --input-bg: #fff;
  --input-border: #ccc;
  --button-bg: #007bff;
  --button-hover: #0056b3;
  --logo: #4B2D95;
  --opacity: 0.06;
}

.dark-mode {
  --bg: #121212;
  --text: #f5f5f5;
  --card-bg: #1e1e1e;
  --input-bg: #2a2a2a;
  --input-border: #444;
  --button-bg: #3399ff;
  --button-hover: #2277cc;
  --logo: #7e6ccf;
  --opacity: 0.08;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  position: relative;
  padding: 1rem;
  overflow: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;

  background-image: url('/mx/loginu/img/loginU_logo_2.svg') ;
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-position: bottom right 20px;
  background-size: 700px;
}

.theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: var(--button-bg);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  z-index: 2;
}

.login-box {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 512px;
  min-height: 300px;
  z-index: 1;
  transition: all 0.3s ease-in-out;
}

.login-box h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

.login-box label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.login-box input {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--input-border);
  background-color: var(--input-bg);
  color: var(--text);
  border-radius: 4px;
}

.login-box .actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.login-box .actions a {
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
}

.login-box .actions button {
  background-color: var(--button-bg);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.login-box .actions button:hover {
  background-color: var(--button-hover);
}

.logo-bg {
  position: absolute;
  bottom: -40px;
  right: -40px;
  width: 420px;
  max-width: 60%;
  opacity: var(--opacity);
  z-index: 0;
  pointer-events: none;
  color: var(--logo);
}

.logo {
 display: none;
}

@media (max-width: 480px) {
  .logo-bg {
    display: none;
  }

  .logo {
    display: block;
    width: 100%;
    height: 80px;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    background-image: url('/mx/loginu/img/loginU_logo_2.svg');
  }

  .login-box {
    min-height: 300px;
  }

}

@media screen and (max-width: 1396px){
  body {
    background-image: none;
  }
}

.is-invalid {
  border: 1px solid #dc3545 !important;
  background-color: #f8d7da;
}

.is-invalid:focus {
  border-color: #dc3545;
  outline: none;
}

.is-valid:focus {
  border-color: #28a745;
  outline: none;
}

.invalid-feedback {
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: -0.75rem;
  display: none;
}

.is-invalid + .invalid-feedback {
  display: block;
}

.alert-warning {
  background-color: #fff3cd;
  border: 1px solid #ffeeba;
  color: #856404;
  padding: 1rem;
  border-radius: 0.375rem;
  font-size: 0.9375rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-warning,
.is-invalid + .invalid-feedback {
  animation: fadeInUp 0.4s ease forwards;
}

.login-box input:focus {
  outline: none;
  border-color: var(--button-bg);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
  transition: box-shadow 0.2s ease-in-out;
}

.alert-info {
  background-color: #d1ecf1;
  border: 1px solid #bee5eb;
  color: #0c5460;
  padding: 1rem;
  border-radius: 0.375rem;
  font-size: 0.9375rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: fadeInUp 0.4s ease forwards;
}

.alert-success {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
  padding: 1rem;
  border-radius: 0.375rem;
  font-size: 0.9375rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: fadeInUp 0.4s ease forwards;
}

.font-bold{
  font-weight: bold;
}