html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: sans-serif;
  background: linear-gradient(to bottom, #000000, #000000);
  overflow: hidden;
}

#particles-js {
  position: cover;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.login-box {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 400px;
  padding: 40px;
  transform: translate(-50%, -50%);
  background: rgb(29, 29, 29);
  box-sizing: border-box;
  box-shadow: 0 15px 25px rgb(65, 65, 65);
  border-radius: 10px;
  z-index: 1;
}

.login-box h2 {
  margin: 0 0 30px;
  padding: 0;
  color: #fff;
  text-align: center;
}

.login-box .user-box {
  position: relative;
}

.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
    padding-right: 40px; /* Make room for the eye icon */
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 30%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1.2rem;
    color: #666666;
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: #333333;
}


/* Error and Success Messages */
.error {
    display: none;
    color: #ff4d4d;
    font-size: 0.9rem;
    font-weight: bold;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #ffe6e6;
    border: 1px solid #f02e2e;
    border-radius: 5px;
    animation: shake 0.3s ease-in-out;
}

/* Keyframes for Shake Animation */
@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

/* Keyframes for Fade In Animation */
@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}


.login-box .user-box input {
  width: 100%;
  padding: 10px 0;
  font-size: 16px;
  color: #fff;
  margin-bottom: 30px;
  border: none;
  border-bottom: 1px solid #fff;
  outline: none;
  background: transparent;
}

.login-box .user-box label {
  position: absolute;
  top: 0;
  left: 0;
  padding: 10px 0;
  font-size: 16px;
  color: #fff;
  pointer-events: none;
  transition: 0.5s;
}

.login-box .user-box input:focus ~ label,
.login-box .user-box input:valid ~ label {
  top: -20px;
  left: 0;
  color: transparent;
  font-size: 12px;
}


@keyframes btn-anim1 {
  0% {
    left: -100%;
  }
  50%, 100% {
    left: 100%;
  }
}

.login-box a span:nth-child(2) {
  top: -100%;
  right: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, transparent, #ffffff);
  animation: btn-anim2 1s linear infinite;
  animation-delay: 0.25s;
}

@keyframes btn-anim2 {
  0% {
    top: -100%;
  }
  50%, 100% {
    top: 100%;
  }
}

.login-box a span:nth-child(3) {
  bottom: 0;
  right: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(270deg, transparent, #ffffff);
  animation: btn-anim3 1s linear infinite;
  animation-delay: 0.5s;
}

@keyframes btn-anim3 {
  0% {
    right: -100%;
  }
  50%, 100% {
    right: 100%;
  }
}

.login-box a span:nth-child(4) {
  bottom: -100%;
  left: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(360deg, transparent, #ffffff);
  animation: btn-anim4 1s linear infinite;
  animation-delay: 0.75s;
}

@keyframes btn-anim4 {
  0% {
    bottom: -100%;
  }
  50%, 100% {
    bottom: 100%;
  }
}

.toggle-text {
  top:  0;
  left: 0;
  color: #fff;
  font-size: 18px;
}

.animated-button {
  position: relative;
  display: inline-block;
  padding: 10px 20px;
  color: #fff;
  font-size: 16px;
  text-decoration: none;
  text-transform: uppercase;
  overflow: hidden;
  transition: 0.5s;
  margin-top: 20px;
  margin-bottom: 30px;
  letter-spacing: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.animated-button:hover {
  background: #fff;
  color: #3f3f3f;
  border-radius: 5px;
  box-shadow: 0 0 5px #fff,
              0 0 25px #fff,
              0 0 50px #fff,
              0 0 100px #fff;
}

.animated-button span {
  position: absolute;
  display: block;
}

.animated-button span:nth-child(1) {
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #fff);
  animation: btn-anim1 1s linear infinite;
}

.animated-button span:nth-child(2) {
  top: -100%;
  right: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, transparent, #fff);
  animation: btn-anim2 1s linear infinite;
  animation-delay: .25s;
}

.animated-button span:nth-child(3) {
  bottom: 0;
  right: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(270deg, transparent, #fff);
  animation: btn-anim3 1s linear infinite;
  animation-delay: .5s;
}

.animated-button span:nth-child(4) {
  bottom: -100%;
  left: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(360deg, transparent, #fff);
  animation: btn-anim4 1s linear infinite;
  animation-delay: .75s;
}

.toggle-link {
  color: #fff;
  text-decoration: none;
  transition: color 0.3s ease;
}

.toggle-link:hover {
  color: #00ffff;
}