@import url('https://fonts.googleapis.com/icon?family=Material+Icons');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;700&display=swap');

.contenedor-login {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #c1e6c5 0%, #e8f9e9 100%);
  font-family: 'Poppins', sans-serif;
}

.tarjeta-login {
  background-color: white;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 450px;
  text-align: center;
  position: relative;
  transition: box-shadow 0.3s ease;
  overflow: hidden;
}

.tarjeta-login::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-radius: 16px;
  pointer-events: none;
  transition: border-color 0.6s linear;
  z-index: 0;
}

.tarjeta-login:hover {
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.tarjeta-login:hover::before {
  border-color: #4CAF50;
  animation: border-dance 2s infinite linear;
}

@keyframes border-dance {
  0% {
    border-color: #4CAF50 transparent transparent transparent;
  }
  25% {
    border-color: transparent #4CAF50 transparent transparent;
  }
  50% {
    border-color: transparent transparent #4CAF50 transparent;
  }
  75% {
    border-color: transparent transparent transparent #4CAF50;
  }
  100% {
    border-color: #4CAF50 transparent transparent transparent;
  }
}

.cabecera-login {
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.logo-login {
  max-width: 30%;
  width: 30%;  
  height: 15%;
  margin-bottom: 2%; 
  padding: 2%; 
  border-radius: 2%;
  box-shadow: 0 0.5% 2% rgba(76, 175, 80, 0.2);
  object-fit: contain;
}

h2 {
  color: #2c5e2e;
  font-size: 1.8rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.formulario-login {
  background-color: #e8f9e9;
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  position: relative;
  z-index: 1;
}

.grupo-formulario {
  margin-bottom: 1.2rem;
  text-align: end;
}

label {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
  color: #2c5e2e;
  font-weight: 500;
}

.icono-input {
  font-size: 1.2rem;
  margin-right: 0.5rem;
  color: #4CAF50;
}

input {
  width: 100%;
  max-width: 100%;
  padding: 0.8rem 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: border-color 0.3s;
  background-color: white;
  box-sizing: border-box; 
}

/* Específico para el input de contraseña con icono */
.envoltorio-contrasena {
  position: relative;
  width: 100%;
}

.envoltorio-contrasena input[type="password"],
.envoltorio-contrasena input[type="text"] {
  padding: 0.8rem 44px 0.8rem 1rem !important;
  /* El !important asegura que sobrescribe la general */
}

input:focus {
  border-color: #4CAF50;
  outline: none;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
}

input.error {
  border-color: #ff4444;
}

.mensaje-error {
  color: #ff4444;
  font-size: 0.8rem;
  margin-top: 0.3rem;
}

.envoltorio-contrasena {
  position: relative;
  width: 100%;
}

.envoltorio-contrasena input[type="password"],
.envoltorio-contrasena input[type="text"] {
  width: 100%;
  padding: 0.8rem 44px 0.8rem 1rem;
  box-sizing: border-box;
}

.alternar-contrasena {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: #666;
  font-size: 1.4rem;
  z-index: 2;
  background: transparent;
  border: none;
  padding: 0;
  line-height: 1;
}

.btn-enviar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.9rem;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s;
  margin-top: 1.5rem;
}

.btn-enviar:hover {
  background-color: #3c9f40;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.icono-btn {
  margin-right: 0.5rem;
  font-size: 1.2rem;
}

.enlace-registro {
  margin-top: 1.5rem;
  color: #555;
  font-weight: 400;
}

.btn-registro {
  color: #4CAF50;
  text-decoration: none;
  font-weight: 600;
  margin-left: 0.5rem;
  position: relative;
  transition: color 0.3s;
}

.btn-registro:hover {
  color: #3c9f40;
}

.btn-registro::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  background-color: #4CAF50;
  bottom: -3px;
  left: 0;
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease-out;
  z-index: 1;
}

.btn-registro:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

@media (max-width: 768px) {
  .contenedor-login {
    padding: 1rem;
    min-height: 100vh;
    background: linear-gradient(135deg, #c1e6c5 0%, #e8f9e9 100%);
  }

  .tarjeta-login {
    padding: 1.5rem;
    width: 100%;
    max-width: 100%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  }

  .logo-login {
    margin-bottom: 1rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .formulario-login {
    padding: 1rem;
  }

  input {
    padding: 0.7rem;
    font-size: 0.85rem;
  }

  .btn-enviar {
    padding: 0.8rem;
    font-size: 0.9rem;
  }

  .enlace-registro {
    font-size: 0.85rem;
  }

  .btn-registro {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .tarjeta-login {
    padding: 1rem;
    border-radius: 8px;
  }

  h2 {
    font-size: 1.3rem;
  }

  .btn-enviar {
    padding: 0.7rem;
    font-size: 0.85rem;
  }
}

#divLang {
  position: fixed;
  top: 16px;
  right: 16px;
  margin: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  z-index: 9999;
}

  
  #divLang a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 28px;
    border-radius: 8px;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.75rem;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    border: none;
  }
  
  #divLang a[href*="ln=zh"] {
    background: linear-gradient(135deg, #ef5350, #e53935);
  }
  
  #divLang a[href*="ln=ar"] {
    background: linear-gradient(135deg, #26a69a, #00897b);
  }
  
  #divLang a[href*="ln=en"] {
    background: linear-gradient(135deg, #42a5f5, #1e88e5);
  }
  
  #divLang a[href*="ln=es"] {
    background: linear-gradient(135deg, #ffa726, #fb8c00);
  }
  
  #divLang a:hover {
    transform: translateX(3px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  }
  
  #divLang a.active[href*="ln=zh"] {
    background: linear-gradient(135deg, #c62828, #b71c1c);
    box-shadow: 0 3px 10px rgba(198, 40, 40, 0.4);
    font-weight: 700;
    transform: translateX(5px);
  }
  
  #divLang a.active[href*="ln=ar"] {
    background: linear-gradient(135deg, #00695c, #004d40);
    box-shadow: 0 3px 10px rgba(0, 105, 92, 0.4);
    font-weight: 700;
    transform: translateX(5px);
  }
  
  #divLang a.active[href*="ln=en"] {
    background: linear-gradient(135deg, #1565c0, #0d47a1);
    box-shadow: 0 3px 10px rgba(21, 101, 192, 0.4);
    font-weight: 700;
    transform: translateX(5px);
  }
  
  #divLang a.active[href*="ln=es"] {
    background: linear-gradient(135deg, #e65100, #bf360c);
    box-shadow: 0 3px 10px rgba(230, 81, 0, 0.4);
    font-weight: 700;
    transform: translateX(1px);
  }
  
  #divLang a.active::before {
    content: '●';
    position: absolute;
    left: 5px;
    font-size: 0.6rem;
    animation: pulse 1.5s ease-in-out infinite;
  }
  
  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
  }
  
  #divLang a span {
    position: relative;
    z-index: 1;
  }

    @media (max-width: 600px) {
      #divLang {
        top: 10px;
        right: 10px;
        gap: 0.35rem;
      }
    }
  
    #divLang a {
      width: 40px;
      height: 26px;
      font-size: 0.7rem;
      border-radius: 7px;
    }

  @media (max-width: 400px) {
    #divLang {
      gap: 0.3rem;
    }
  
    #divLang a {
      width: 38px;
      height: 24px;
      font-size: 0.65rem;
      border-radius: 6px;
    }
  
    #divLang a.active::before {
      left: 3px;
      font-size: 0.5rem;
    }
  }