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

:root {
  --bg: #0b071d;
  --color: #e6e4ef;
  --bg02: #0d052a;
  --success: #4CAF50;
  --error: #e74c3c;
}

.wrapper {
  position: relative;
  width: 80%;
  max-width: 900px;
  height: 600px;
  /* Increased height for larger form visibility */
  background: transparent;
  border: 4px solid var(--color);
  box-shadow: 0 0 25px var(--color);
  overflow: hidden;
  border-radius: 20px;
  display: flex;
  justify-content: space-between;
  animation: slide-in 1.5s ease-out;
  margin: 50px auto;
}

@keyframes slide-in {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }

  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.form-box {
  width: 50%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 60px 0 40px;
  animation: form-slide-in 1s ease-out forwards;
  background-color: #0b071d;
}

@keyframes form-slide-in {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }

  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.welcome-box {
  width: 50%;
  background: var(--bg02);
  color: #fff;
  padding: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  animation: welcome-slide-in 1s ease-out forwards;
}

@keyframes welcome-slide-in {
  0% {
    transform: translateX(100%);
    opacity: 0;
  }

  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

.form-box h2,
.welcome-box h2 {
  margin-top: 40px;
  font-size: 36px;
  margin-bottom: 20px;
  color: #fff;
  text-align: center;
}

.input-box {
  position: relative;
  width: 100%;
  margin: 25px 0;
}

.input-box input {
  width: 100%;
  height: 50px;
  background: transparent;
  border: none;
  outline: none;
  border-bottom: 2px solid #fff;
  padding-left: 40px;
  font-size: 16px;
  color: #fff;
  transition: .5s;
}

.input-box input:focus,
.input-box input:valid {
  border-bottom-color: var(--color);
}

.input-box label {
  position: absolute;
  top: 50%;
  left: 40px;
  transform: translateY(-50%);
  font-size: 16px;
  color: #fff;
  pointer-events: none;
  transition: .5s;
}

.input-box input:focus~label,
.input-box input:valid~label {
  top: -5px;
  left: 0;
  color: var(--color);
}

.input-box i {
  position: absolute;
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
  font-size: 18px;
  color: #fff;
  transition: .5s;
}

.btn {
  width: 100%;
  height: 50px;
  background: transparent;
  border: 2px solid var(--color);
  outline: none;
  border-radius: 40px;
  cursor: pointer;
  font-size: 18px;
  color: #fff;
  font-weight: 600;
  margin-top: 30px;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 300%;
  background: linear-gradient(var(--bg), var(--color), var(--bg), var(--color));
  z-index: -1;
  transition: .5s;
}

.btn:hover::before {
  top: 0;
}

.btn:hover {
  transform: scale(1.05);
}

.logreg-link p {
  margin-top: 20px;
  text-align: center;
  color: #fff;
}

.logreg-link a {
  color: var(--color);
  text-decoration: none;
  font-weight: 600;
}

.logreg-link a:hover {
  text-decoration: underline;
}

.message {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--success);
  padding: 15px 25px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  animation: fadeOut 7s ease forwards;
  z-index: 1000;
}

.alert-message {
  color: var(--error);
}

@keyframes fadeOut {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    display: none;
  }
}

@media (max-width: 768px) {
  .wrapper {
    flex-direction: column;
    height: auto;
    width: 90%;
    margin: 30px auto;
    /* Reduced margin for mobile */
  }

  .form-box,
  .welcome-box {
    width: 100%;
  }

  .form-box {
    padding: 40px 20px;
  }

  .welcome-box {
    padding: 20px;
  }

  .form-box h2 {
    font-size: 28px;
  }

  .input-box input {
    font-size: 14px;
  }

  .btn {
    font-size: 16px;
  }

  .logreg-link p {
    font-size: 14px;
  }
}