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

/* Reseteo de estilos */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}

body {
  background: #ecf0f3;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wrapper {
  max-width: 380px;
  width: 90%;
  min-height: 480px;
  margin: 0 auto;
  padding: 30px 30px;
  background-color: rgba(236, 240, 243, 0.85);
  border-radius: 15px;
  box-shadow: 13px 13px 20px rgba(0, 0, 0, 0.2),
    -13px -13px 20px rgba(255, 255, 255, 0.8);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.wrapper:hover {
  transform: translateY(-5px);
  box-shadow: 15px 15px 25px rgba(0, 0, 0, 0.25),
    -15px -15px 25px rgba(255, 255, 255, 0.9);
}

.logo {
  width: 90px;
  height: 90px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 50%;
  box-shadow: 0px 0px 3px #5f5f5f, 0px 0px 0px 5px #ecf0f3, 8px 8px 15px #a7aaa7,
    -8px -8px 15px #fff;
  transition: transform 0.3s ease;
}

.logo img:hover {
  transform: scale(1.05);
}

.wrapper .name {
  font-weight: 600;
  font-size: 1.4rem;
  letter-spacing: 1.3px;
  padding-left: 10px;
  color: #555;
  text-align: center;
  margin-bottom: 5px;
}

#empresa {
  display: block;
  text-align: center;
  font-size: 0.9rem;
  color: #777;
  margin-top: 5px;
}

.wrapper .form-field {
  position: relative;
  padding-left: 10px;
  margin-bottom: 20px;
  border-radius: 20px;
  box-shadow: inset 8px 8px 8px #cbced1, inset -8px -8px 8px #fff;
  overflow: hidden;
}

.wrapper .form-field input {
  width: 100%;
  display: block;
  border: none;
  outline: none;
  background: none;
  font-size: 1rem;
  color: #666;
  padding: 12px 15px 12px 35px;
}

.wrapper .form-field .fas {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #555;
  font-size: 14px;
}

.wrapper .form-field .password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #777;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.wrapper .form-field .password-toggle:hover {
  color: #039be5;
}

.remember-me-container {
  display: flex;
  align-items: center;
  font-size: 0.85rem;
  color: #777;
  padding-left: 10px;
}

/* Estilo personalizado para checkbox */
.checkbox-container {
  display: block;
  position: relative;
  padding-left: 30px;
  cursor: pointer;
  user-select: none;
}

.checkbox-container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 18px;
  width: 18px;
  background-color: #eee;
  border-radius: 4px;
  box-shadow: inset 2px 2px 2px #cbced1, inset -2px -2px 2px #fff;
  transition: all 0.2s ease;
}

.checkbox-container:hover input ~ .checkmark {
  background-color: #ccc;
}

.checkbox-container input:checked ~ .checkmark {
  background-color: #03a9f4;
  box-shadow: inset 2px 2px 3px rgba(0, 0, 0, 0.2);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
}

.checkbox-container input:checked ~ .checkmark:after {
  display: block;
}

.checkbox-container .checkmark:after {
  left: 6px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.wrapper .btn {
  box-shadow: none;
  width: 100%;
  height: 45px;
  background-color: #03a9f4;
  color: #fff;
  border-radius: 25px;
  box-shadow: 3px 3px 3px #b1b1b1, -3px -3px 3px #fff;
  letter-spacing: 1.3px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
}

.wrapper .btn:hover {
  background-color: #039be5;
  transform: translateY(-2px);
  box-shadow: 4px 4px 5px #b1b1b1, -4px -4px 5px #fff;
}

.wrapper .btn:active {
  transform: translateY(0);
  box-shadow: 2px 2px 2px #b1b1b1, -2px -2px 2px #fff;
}

.wrapper a {
  text-decoration: none;
  font-size: 0.8rem;
  color: #03a9f4;
  transition: color 0.2s ease;
}

.wrapper a:hover {
  color: #039be5;
}

/* Mensaje de validación y alerta */
#mensaje {
  min-height: 30px;
  font-size: 0.85rem;
}

.badge {
  display: inline-block;
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
  border-radius: 0.25rem;
  transition: all 0.2s ease-in-out;
}

.badge-warning {
  color: #fff;
  background-color: #f0ad4e;
}

/* Animaciones para el formulario */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-field,
.btn,
.remember-me-container {
  animation: fadeIn 0.6s ease forwards;
}

.form-field:nth-child(1) {
  animation-delay: 0.1s;
}
.form-field:nth-child(2) {
  animation-delay: 0.2s;
}
.form-field:nth-child(3) {
  animation-delay: 0.3s;
}
.remember-me-container {
  animation-delay: 0.4s;
}
.btn {
  animation-delay: 0.5s;
}

/* Para pantallas más pequeñas */
@media (max-width: 480px) {
  .wrapper {
    width: 90%;
    margin: 20px auto;
    padding: 25px 20px;
    min-height: auto;
  }

  .logo {
    width: 70px;
    height: 70px;
  }

  .logo img {
    width: 60px;
    height: 60px;
  }

  .wrapper .name {
    font-size: 1.2rem;
  }
}

/* Preloader */
.cs-preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(245, 247, 251, 0.95);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.cs-preloader__in {
  width: 80px;
  height: 80px;
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
  0% {
    transform: scale(0.9);
    opacity: 0.7;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(0.9);
    opacity: 0.7;
  }
}
