@font-face {
  font-family: 'My Font';
  src: url('../lib/font/1FTV-HF-Gesco.ttf') format('truetype');
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'My Font', serif;
}

body,
html {
  width: 100%;
  height: 100%;
  background-image: url('../IMG/back.jfif');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ground {
  position: fixed;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0);
  backdrop-filter: blur(2px);
  z-index: 0;
}

.container {
  width: 80%;
  max-width: 900px;
  height: 80%;
  display: flex;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(10, 77, 60, 0.5);
  backdrop-filter: blur(5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  z-index: 1;
  position: relative;
}

.left {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  clip-path: ellipse(100% 100% at 0% 20%);
  transition: all 0.8s ease;
  z-index: 2;
}

.left img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.alt-login {
  text-align: center;
  margin: 15px 0 10px;
  color: #FFEFD6;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 15px;
}

.social-icons img {
  width: 32px;
  height: 32px;
  cursor: pointer;
  transition: transform 0.2s;
}

.social-icons img:hover {
  transform: scale(1.1);
}

.forgot-link {
  display: block;
  width: 100%;
  text-align: right;
  font-size: 0.9em;
  margin: 15px 0 10px;
  text-decoration: none;
  color: #FFEFD6;
}

.forgot-link:hover {
  text-decoration: underline;
}

.forms {
  flex: 1;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  z-index: 1;
}

.container.register-active .left {
  transform: translateX(100%);
  clip-path: ellipse(100% 100% at 100% 80%);
}

#register-form {
  left: 10%;
  position: fixed;
  opacity: 0;
  transform: translateX(-100%);
  pointer-events: none;
  margin-left: -5%;
  width: 40%;
}

#login-form {
  opacity: 1;
  transform: translateX(0);
}

.container.register-active #login-form {
  opacity: 0;
  transform: translateX(-100%);
  pointer-events: none;
}

.container.register-active #register-form {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 80%;
  padding: 20px;
  border-radius: 20px;
  position: relative;
  background-color: rgba(255, 239, 214, 0); /* nền form trong suốt */
  color: #FFEFD6;
}

.title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -1px;
  position: relative;
  display: flex;
  align-items: center;
  padding-left: 30%;
  color: #C70E1C;
}

.message,
.signin {
  font-size: 14.5px;
  color: rgba(255, 239, 214, 0.8);
}

.signin {
  text-align: center;
}

.signin a {
  color: #FCB92C;
  text-decoration:none;
}

.signin a:hover {
  text-decoration: underline;
}

.flex {
  display: flex;
  width: 100%;
  gap: 6px;
}

.form label {
  position: relative;
}

.form label .input {
  background-color: rgba(51, 51, 51, 0.1);
  color: #FFEFD6;
  width: 100%;
  padding: 20px 5px 5px 10px;
  outline: 0;
  border: 1px solid rgba(105, 105, 105, 0.5);
  border-radius: 10px;
}

.form label .input + span {
  color: rgba(255, 239, 214, 0.5);
  position: absolute;
  left: 10px;
  top: 0;
  font-size: 0.9em;
  cursor: text;
  transition: 0.3s ease;
}

.form label .input:placeholder-shown + span {
  top: 12.5px;
  font-size: 0.9em;
}

.form label .input:focus + span,
.form label .input:valid + span {
  color: #FCB92C;
  top: 0;
  font-size: 0.7em;
  font-weight: 600;
}

.input {
  font-size: medium;
}

.submit {
  border: none;
  outline: none;
  padding: 10px;
  width: 60%;
  border-radius: 10px;
  color: #fff;
  margin-left: 20%;
  font-size: 16px;
  background-color: #C70E1C;
}

.submit:hover {
  background-color: #FCB92C;
}

.password-label {
  position: relative;
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  cursor: pointer;
  opacity: 0.7;
}

.toggle-password:hover {
  opacity: 1;
}

/* Responsive chỉnh lại cho Mobile */
/* Tối ưu cho màn hình nhỏ */
@media (max-width: 1020px) {
  .container {
    flex-direction: column; /* Đặt lại chiều hướng các phần tử thành cột */
    height: auto;
    width: 90%;
    max-width: 500px;
    padding: 20px;
  }

  .left {
    width: 100%;
    height: auto;
    clip-path: ellipse(100% 100% at 50% 50%);
    transform: translateX(0);
  }

  .forms {
    width: 100%;
    padding: 20px;
    position: relative;
    justify-content: flex-start; /* Đảm bảo các phần tử được căn chỉnh hợp lý */
    align-items: flex-start;
  }

  #register-form,
  #login-form {
    position: relative;
    left: 0;
    margin: 0 auto;
    width: 100%;
  }

  .form {
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
  }

  .form label .input {
    padding: 15px 10px 5px 10px;
  }

  .submit {
    width: 100%;
    font-size: 16px;
    padding: 12px;
    margin-top: 20px;
    border-radius: 10px;
  }

  .social-icons {
    display: flex;
    justify-content: center;
    gap: 12px; /* Điều chỉnh khoảng cách giữa các icon */
    margin-top: 20px;
  }

  .social-icons img {
    width: 30px; /* Giảm kích thước icon mạng xã hội */
    height: 30px;
  }

  .title {
    font-size: 24px;
  }

  .message,
  .signin {
    font-size: 13px;
  }
}

@media screen and (max-width: 768px) {
  .container {
    width: 90%;
    height: 60%;
  }

  .form {
    width: 100%;
    padding: 1em;
  }

  #register-form {
    position: absolute; /* ✅ Thay vì fixed */
    left: 0;
    opacity: 0;
    transform: translateX(-100%);
    pointer-events: none;
    width: 100%;
    margin-left: 0; /* hoặc bỏ nếu không cần */
  }

  .input {
    font-size: 1em;
  }

  .submit {
    font-size: 0.75em;
    width: 60%;
  }

  .title {
    font-size: 1.2em;
    left: 2rem;
  }

  .left {
    display: none;
  }

  .social-icons img {
    width: 1.5em;
    height: 1.5em;
  }

}
