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

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

body {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #5f2c82, #49a09d);
  flex-direction: column;
  padding-top: 80px;
}

.heading {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 30px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 1px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* CONTAINER */
.container {
  position: relative;
  width: 850px;
  height: 500px;
  background: rgba(255,255,255,0.1);
  border-radius: 20px;
  overflow: hidden;
  backdrop-filter: blur(20px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

/* FORM BASE */
.form-container {
  position: absolute;
  width: 50%;
  height: 100%;
  top: 0;
  transition: all 0.6s ease-in-out;
  display: flex;
  justify-content: center;
  align-items: center;
}
.forgot {
    font-size: 13px;
    color: #ddd;
    text-decoration: none;
    text-align: right;
}

.forgot:hover {
    color: #fff;
}

/* LOGIN */
.sign-in-container {
  left: 0;
  width: 50%;
  z-index: 2;
}

/* show and hide the paasword */
.password-field {
  position: relative;
  width: 100%;
}

.password-field input {
  width: 100%;
  padding-right: 45px; 
}

.toggle-password {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;

  font-size: 18px;
  z-index: 10;              
  user-select: none;
  pointer-events: auto;   
}

.toggle-password:hover {
  opacity: 1;
}

/* BUTTON */
#loginBtn,
#signupBtn {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* LOADER (hidden by default) */
.loader {
  width: 18px;
  height: 18px;
  border: 3px solid transparent;
  border-top: 3px solid #333;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  position: absolute;
  display: none;
}

/* SPIN ANIMATION */
@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

/* LOADING STATE */
.loading .btn-text {
  opacity: 0;
}

.loading .loader {
  display: block;
}

/* SUCCESS ICON */
.btn-success {
  display: none;
  color: green;
  font-size: 18px;
  position: absolute;
}

/* LOADING */
.loading .btn-text {
  opacity: 0;
}

.loading .loader {
  display: block;
}

/* SUCCESS STATE */
.success {
  background: #4CAF50 !important;
  color: white;
}

.success .btn-success {
  display: block;
}

.success .loader {
  display: none;
}

/* ERROR STATE */
.error {
  background: #ff4d4d !important;
  color: white;
  animation: shake 0.4s;
}

/* SHAKE ANIMATION */
@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
  100% { transform: translateX(0); }
}

/* SIGNUP (hidden by default properly) */
.sign-up-container {
  left: 0;
  width: 50%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1;
}

/* WHEN ACTIVE */
.container.right-panel-active .sign-in-container {
  transform: translateX(100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.container.right-panel-active .sign-up-container {
  transform: translateX(100%);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 5;
}

/* FORM STYLE */
form {
  width: 80%;
  display: flex;
  flex-direction: column;
  gap: 15px;
  text-align: center;
}

h2 {
  color: #fff;
  margin-bottom: 10px;
}

input {
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: rgba(255,255,255,0.2);
  color: #fff;
  outline: none;
}
input:focus {
  outline: none;
  border: 1px solid #fff;
  box-shadow: 0 0 8px rgba(255,255,255,0.5);
}

input::placeholder {
  color: #ddd;
}

button {
  padding: 12px;
  border-radius: 25px;
  border: none;
  background: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
}

button:hover {
  transform: scale(1.05);
}

/* OVERLAY */
.overlay-container {
  position: absolute;
  left: 50%;
  width: 50%;
  height: 100%;
  overflow: hidden;
  transition: transform 0.6s ease-in-out;
}

.overlay {
  position: relative;
  left: -100%;
  width: 200%;
  height: 100%;
  display: flex;
  background: linear-gradient(135deg, #ff6a88, #ff99ac);
  color: white;
  transition: transform 0.6s ease-in-out;
}

/* PANELS */
.overlay-panel {
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 15px;
  text-align: center;
  padding: 40px;
}

.overlay-panel h1 {
  font-size: 28px;
}

.overlay-panel p {
  font-size: 14px;
}

/* BUTTON */
.ghost {
  background: transparent;
  border: 1px solid white;
  color: white;
}

/* MOVE OVERLAY */
.container.right-panel-active .overlay-container {
  transform: translateX(-100%);
}

.container.right-panel-active .overlay {
  transform: translateX(50%);
}

/* TOAST */
#toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #333;
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  opacity: 0;
  transition: 0.3s;
}

#toast.show {
  opacity: 1;
}

/* Error msg */
.error-msg {
  color: #ff4d4d;
  font-size: 12px;
  text-align: left;
  margin-top: -10px;
  margin-bottom: 5px;
  display: none;
}

.input-error {
  border: 1px solid #ff4d4d !important;
  box-shadow: 0 0 6px rgba(255, 77, 77, 0.5);
}
.input-success {
  border: 1px solid #4CAF50 !important;
  box-shadow: 0 0 6px rgba(76, 175, 80, 0.6);
}

/* forgotpaasword logics */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  justify-content: center;
  align-items: center;
}

.modal-box {
  background: #3168d5;
  padding: 20px;
  border-radius: 10px;
  width: 300px;
  text-align: center;
}
.modal-box input,button{
  margin: 4px;
}
.modal-box p{
  cursor: pointer;
}

/* =========================
   🔥 CLEAN MOBILE RESET
========================= */
@media (max-width: 768px) {

  /* REMOVE DESKTOP COMPLETELY */
  .overlay-container,
  .overlay {
    display: none !important;
  }

  .container {
    width: 100% !important;
    height: auto !important;
    background: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  /* RESET ALL TRANSFORMS */
  .form-container,
  .sign-in-container,
  .sign-up-container {
    position: relative !important;
    width: 100% !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
  }

  /* SHOW ONLY ONE FORM */
  .sign-in-container {
    display: block;
  }

  .sign-up-container {
    display: none;
  }

  .container.right-panel-active .sign-in-container {
    display: none;
  }

  .container.right-panel-active .sign-up-container {
    display: block;
  }

}

@media (max-width: 768px) {

  body {
    padding: 20px;
    align-items: flex-start;
  }

  .heading {
    position: static;
    transform: none;
    text-align: center;
    margin-bottom: 20px;
  }

  form {
    width: 100%;
    padding: 25px;
    border-radius: 20px;

    /* 🔥 CLEAN LOOK */
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(20px);

    display: flex;
    flex-direction: column;
    gap: 15px;
  }

  h2 {
    text-align: center;
    font-size: 22px;
  }

  input {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
  }

  button {
    width: 100%;
    padding: 12px;
    border-radius: 25px;
  }

  /* 🔥 FIX FORGOT */
  .forgot {
    display: block;
    text-align: right;
    margin-top: -5px;
    font-size: 13px;
  }

  /* 🔥 FIX EXTRA BUTTON SPACING */
  form button + button {
    margin-top: 0;
  }

}

/* 🔥 FIX FORGOT PASSWORD */
.forgot {
  background: none !important;
  border: none !important;
  padding: 0 !important;

  color: #ddd;
  font-size: 13px;
  text-align: right;
  cursor: pointer;

  display: block;
  margin-top: 5px;
}

.forgot:hover {
  color: #fff;
  text-decoration: underline;
}

/* 🔥 LINK STYLE (NOT BUTTON) */
.link-btn {
  background: none !important;
  border: none !important;
  padding: 0 !important;

  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

/* 🔥 SWITCH TEXT CLEAN UI */
.mobile-switch-box {
  text-align: center;
  margin-top: 18px;
  font-size: 14px;
  color: #ccc;
}

.mobile-switch-box span {
  display: block;
  margin-bottom: 5px;
}

.mobile-switch-box button {
  background: none !important;
  border: none !important;
  color: #fff;
  text-shadow: 0 0 8px rgba(255,255,255,0.4);
  font-weight: 600;
  cursor: pointer;
}

.mobile-switch-box button:hover {
  text-decoration: underline;
}

/* 🔥 HIDE MOBILE SWITCH ON DESKTOP */
.mobile-switch-box {
  display: none;
}

/* 🔥 SHOW ONLY IN MOBILE */
@media (max-width: 768px) {
  .mobile-switch-box {
    display: block;
  }
}

