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

*,
*::before,
*::after {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

body,
input {
  font-family: "Poppins", sans-serif;
}

main {
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  background: linear-gradient(135deg, #dc4242, #42bddc, #74e889);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.box {
  position: relative;
  width: 100%;
  max-width: 1020px;
  height: 640px;
  background-color: #fff;
  border-radius: 3.3rem;
  box-shadow: 0 60px 40px -30px rgba(0, 0, 0, 0.27);
  transition: height 0.3s ease;
}

.inner-box {
  position: absolute;
  width: calc(100% - 4.1rem);
  height: calc(100% - 4.1rem);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: auto; /* Enable scrolling when content overflows */
  scrollbar-width: none; /* Hide scrollbars on Firefox */
  -ms-overflow-style: none; /* Hide scrollbars on IE/Edge */
}

.inner-box::-webkit-scrollbar {
  display: none; /* Hide scrollbars on Chrome/Safari/Opera */
}

.forms-wrap {
  position: absolute;
  height: 100%;
  width: 45%;
  top: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  transition: 0.8s ease-in-out;
  overflow-y: hidden; /* Change from auto to hidden by default */
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-top: 1.5rem; /* Add a little padding at the top */
}

.forms-wrap::-webkit-scrollbar {
  display: none;
}

/* Add specific styling for sign-up mode */
main.sign-up-mode .forms-wrap {
  overflow-y: auto; /* Only enable scrolling in sign-up mode if needed */
}

form {
  max-width: 300px;
  width: 100%;
  margin: 0 auto;
  height: 110%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* Change to allow content to flow naturally */
  grid-column: 1 / 2;
  grid-row: 1 / 2;
  transition: opacity 0.02s 0.4s;
  padding: 2rem 0;
}

form.sign-in-form {
  overflow: hidden; /* Explicitly prevent scrolling for sign-in form */
  justify-content: flex-start; /* Changed from center to flex-start */
  padding-top: 1rem; /* Increase padding at the top */
  padding-bottom: 0; /* Remove bottom padding */
  margin-top: 0; /* Remove negative margin */
}

/* Additional spacing for moving the form higher */
.sign-in-form .logo {
  margin-bottom: 2rem; /* Space below logo */
}

.sign-in-form .heading {
  margin-bottom: 3rem; /* Increase space below heading */
}

.sign-in-form .heading h2 {
  margin-bottom: 0.5rem; /* Add space after the heading text */
}

/* Adjust spacing between input elements */
.sign-in-form .input-wrap {
  margin-bottom: 1.8rem; /* Increased spacing between input fields */
}

form.sign-up-form {
  opacity: 0;
  pointer-events: none;
  padding-bottom: 3rem;
}

.signup-fields {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  width: 40px;
  margin-right: 0.3rem;
}

.logo h4 {
  font-size: 1.7rem;
  margin-top: -9px;
  letter-spacing: -0.5px;
  color: #151111;
}

.heading h2 {
  font-size: 2.1rem;
  font-weight: 600;
  color: #151111;
}

.heading h6 {
  color: #bababa;
  font-weight: 400;
  font-size: 0.75rem;
  display: inline;
}

.signupbtn {
  color: #151111;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  transition: 0.3s;
}

.signupbtn:hover {
  color:rgb(66, 189, 220);
}

.toggle {
  color: #151111;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  transition: 0.3s;
}

.toggle:hover {
  color:rgb(66, 189, 220);
}

.input-wrap {
  position: relative;
  height: 37px;
  margin-bottom: 2rem;
}

.input-field {
  position: absolute;
  width: 100%;
  height: 100%;
  background: none;
  border: none;
  outline: none;
  border-bottom: 1px solid #bbb;
  padding: 0;
  font-size: 0.95rem;
  color: #151111;
  transition: 0.4s;
}

label {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  color: #bbb;
  pointer-events: none;
  transition: 0.4s;
}

.input-field.active {
  border-bottom-color: #151111;
}

.input-field.active + label {
  font-size: 0.75rem;
  top: -2px;
}

.sign-btn {
  display: inline-block;
  width: 100%;
  height: 43px;
  background-color: #151111;
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 0.8rem;
  font-size: 0.8rem;
  margin-bottom: 2rem;
  transition: 0.3s;
}

.sign-btn:hover {
  background-color: rgb(66, 189, 220);
}

.text {
  color: #bbb;
  font-size: 0.7rem;
}

.text a {
  color: #bbb;
  transition: 0.3s;
}

.text a:hover {
  color: #8371fd;
}

main.sign-up-mode form.sign-in-form {
  opacity: 0;
  pointer-events: none;
}

main.sign-up-mode form.sign-up-form {
  opacity: 1;
  pointer-events: all;
}

main.sign-up-mode .forms-wrap {
  left: 55%;
}

main.sign-up-mode .carousel {
  left: 0%;
}

.carousel {
  position: absolute;
  height: 100%;
  width: 55%;
  left: 45%;
  top: 0;
  background-color: rgb(191, 247, 201);
  border-radius: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-bottom: 2rem;
  overflow: hidden;
  transition: 0.8s ease-in-out;
  box-shadow: 0 40px 40px -30px rgba(0, 0, 0, 0.27);
}

.carousel-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 100%;
  width: 100%;
  padding: 2rem;
}

.images-wrapper {
  position: relative;
  width: 100%;
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
  overflow: hidden;
}

.image {
  position: absolute;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 110%;
  opacity: 0;
  transition: opacity 0.6s ease-in-out, transform 0.8s ease-in-out;
}

.img-1 {
  transform: translate(0, -50px);
}

.img-2 {
  transform: scale(0.4, 0.5);
}

.img-3 {
  transform: scale(0.3) rotate(-20deg);
}

.image.show {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease-in-out, transform 0.8s ease-in-out;
}

.text-slider {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.text-wrap {
  max-height: 2.2rem;
  overflow: hidden;
  margin-bottom: 2.5rem;
}

.text-group {
  display: flex;
  flex-direction: column;
  text-align: center;
  transform: translateY(0);
  transition: transform 0.5s ease-in-out;
}

.text-group h2 {
  line-height: 2.2rem;
  font-weight: 600;
  font-size: 1.6rem;
}

.bullets {
  display: flex;
  align-items: center;
  justify-content: center;
}

.bullets span {
  display: block;
  width: 0.5rem;
  height: 0.5rem;
  background-color: #aaa;
  margin: 0 0.25rem;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}

.bullets span.active {
  width: 1.1rem;
  background-color: #151111;
  border-radius: 1rem;
  transition: all 0.3s ease-in-out;
}

.form-check {
  display: flex;
  align-items: center;
  margin-top: 1rem;
}

.form-check input[type="checkbox"] {
  cursor: pointer;
}

.form-check label {
  position: static;
  transform: none;
  margin-left: 0.5rem;
  font-size: 0.7rem;
  color: #333;
  cursor: pointer;
  user-select: none;
}

.form-check a {
  color: #42bddc;
  text-decoration: none;
  transition: color 0.3s;
}

.form-check a:hover {
  color: #dc4242;
}

/* Core mobile responsiveness improvements */
@media (max-width: 850px) {
  .box {
    height: auto;
    max-width: 550px;
    overflow: hidden;
  }

  .inner-box {
    position: static;
    transform: none;
    width: revert;
    height: revert;
    padding: 2rem;
  }

  .forms-wrap {
    position: revert;
    width: 100%;
    height: auto;
  }

  form {
    max-width: revert;
    padding: 1.5rem 2.5rem 2rem;
    transition: transform 0.8s ease-in-out, opacity 0.45s linear;
  }

  .heading {
    margin: 2rem 0;
  }

  form.sign-up-form {
    transform: translateX(100%);
  }

  main.sign-up-mode form.sign-in-form {
    transform: translateX(-100%);
  }

  main.sign-up-mode form.sign-up-form {
    transform: translateX(0%);
  }

  .carousel {
    position: revert;
    height: auto;
    width: 100%;
    padding: 3rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .images-wrapper {
    display: none;
  }

  .text-slider {
    width: 100%;
  }
  
  .carousel-content {
    padding: 1rem;
  }
}

/* Mobile view (tablets and large phones) */
@media (max-width: 768px) {
  .box {
    max-width: 90%;
    height: auto;
    margin: 0 auto;
  }
  
  .forms-wrap {
    height: auto;
  }
}

/* Small mobile phones and portrait orientation */
@media (max-width: 530px) {
  /* Mobile form container styling */
  main {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
    min-height: 100vh;
    justify-content: flex-start;
    overflow-y: hidden;
  }
  
  .box {
    border-radius: 2rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 95%;
    max-width: 100%;
    margin: 0 auto;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    height: auto;
    min-height: 600px;
  }
  
  /* Restructure form and carousel layout */
  .inner-box {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    height: auto !important;
    padding: 1.5rem 1.5rem 0;
    overflow: hidden;
  }
  
  .forms-wrap {
    position: revert;
    width: 100%;
    height: auto;
    min-height: 500px;
    max-height: none;
  }
  
  /* Clean up form styling */
  form {
    padding: 0;
    height: auto;
    min-height: auto;
    overflow: hidden;
  }
  
  /* Adjust sign-up form */
  form.sign-up-form {
    padding-bottom: 1rem;
    overflow: hidden;
    height: auto;
  }
  
  /* Constrain height of signup fields */
  .signup-fields {
    max-height: none;
    overflow: hidden;
  }
  
  /* Make carousel appear as a banner at bottom */
  .carousel {
    width: 100%;
    position: revert;
    height: 100px;
    padding: 0.8rem 1rem;
    margin-top: 0;
    background: rgba(245, 245, 245, 0.8);
    border-radius: 0 0 2rem 2rem;
    flex-direction: column;
    align-items: center;
    box-shadow: none;
    overflow: hidden;
  }
}

/* Extra small devices */
@media (max-width: 380px) {
  main {
    padding: 0.3rem 0;
  }
  
  .box {
    width: 98%;
    border-radius: 1.5rem;
    min-height: 580px;
  }
  
  .inner-box {
    padding: 1rem 1rem 0;
  }
  
  .forms-wrap {
    min-height: 480px;
  }
  
  .logo img {
    width: 30px;
  }
  
  .logo h4 {
    font-size: 1.3rem;
  }
  
  .heading h2 {
    font-size: 1.5rem;
  }
  
  .carousel {
    height: 80px;
    padding: 0.5rem;
  }
}

/* Handle different device orientations */
@media (max-height: 700px) and (max-width: 530px) {
  .box {
    min-height: 550px;
  }
  
  .forms-wrap {
    min-height: 450px;
  }
  
  .carousel {
    height: 80px;
  }
  
  .sign-in-form .logo {
    margin-bottom: 0.8rem;
  }
  
  .sign-in-form .heading {
    margin-bottom: 1.2rem;
  }
  
  .sign-in-form .input-wrap {
    margin-bottom: 1rem;
  }
}

/* Special class applied via JavaScript for mobile */
main.mobile-view {
  display: block !important;
  overflow-y: hidden;
}

main.mobile-view .forms-wrap {
  position: relative;
  transform: none !important;
  overflow: hidden !important;
}

main.mobile-view.sign-up-mode .forms-wrap {
  transform: none !important;
}

main.mobile-view form.sign-up-form {
  opacity: 0;
  pointer-events: none;
  display: none;
  transform: none !important;
}

main.mobile-view.sign-up-mode form.sign-up-form {
  opacity: 1;
  pointer-events: all;
  display: block;
  transform: none !important;
}

/* Style for active mobile sign-up mode */
body.mobile-signup-active {
  overflow-y: hidden !important;
  height: 100vh;
  min-height: 100vh;
}

body.mobile-signup-active main {
  min-height: 100vh;
  height: auto;
  overflow: hidden !important;
}

body.mobile-signup-active .forms-wrap,
body.mobile-signup-active form.sign-up-form {
  display: block;
  height: auto;
  overflow: hidden !important;
}

/* Apply dynamic heights based on viewport */
@media screen and (max-width: 530px) {
  .box {
    height: var(--vh, 100vh);
  }
}



