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

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
}
a {
  text-decoration: none;
}
ul {
  list-style: none;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #e2e2e2, #c9d6ff);
}

/* Wrapper */
.container {
  position: relative;
  width: 850px;
  height: 550px;
  margin: 20px;
  background: #fff;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.2);
}

/* Common text */
.container h1 {
  font-size: 36px;
  margin: -10px 0;
}
.container p {
  font-size: 14.5px;
  margin: 15px 0;
}
.muted {
  color: #666;
}

/* Forms */
form {
  width: 100%;
}
.form-box {
  position: absolute;
  right: 0;
  width: 50%;
  height: 100%;
  background: #fff;
  color: #333;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  z-index: 1;
  transition: 0.6s ease-in-out 1.2s, visibility 0s 1s;
}
.container.active .form-box {
  right: 50%;
}

.form-box.register {
  visibility: hidden;
}
.container.active .form-box.register {
  visibility: visible;
}

/* ===== Inputs (icon trái + toggle phải) ===== */
.input-box {
  position: relative;
  margin: 30px 0;
}
.input-box input {
  width: 100%;
  /* chừa trái 44px cho icon; mặc định chừa phải 50px cho nút mắt (nếu có) */
  padding: 13px 50px 13px 44px;
  background: #eee;
  border-radius: 8px;
  border: none;
  outline: none;
  font-size: 16px;
  color: #333;
  font-weight: 500;
}
.input-box input::placeholder {
  color: #888;
  font-weight: 400;
}

/* Icon TRÁI (user/mail/lock/...) */
.input-box i {
  position: absolute;
  left: 18px; /* chuyển sang trái */
  right: auto;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: #666;
  pointer-events: none;
}

.bx-show,
.bx-hide {
  left: 0 !important; /* sửa lại nếu dùng lại icon mắt cũ */
}

/* Nút hiện/ẩn mật khẩu ở PHẢI */
.input-box .toggle-pass {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 6px;
  line-height: 1;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  /* ẩn nhẹ khi chưa focus để gọn giao diện; bỏ 2 dòng dưới nếu muốn luôn hiện */
  opacity: 0;
  pointer-events: none;
}
.input-box:focus-within .toggle-pass {
  opacity: 1;
  pointer-events: auto;
}
.input-box .toggle-pass i {
  font-size: 20px;
}
.input-box .toggle-pass:hover {
  color: #333;
}

/* Links + Button */
.forgot-link {
  margin: -15px 0 15px;
}
.forgot-link a {
  font-size: 14.5px;
  color: #333;
}

.btn {
  width: 100%;
  height: 48px;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  background: #7494ec;
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  font-size: 16px;
  font-weight: 600;
}
.btn:hover {
  filter: brightness(0.97);
}

/* Social icons (cũ – nếu còn dùng) */
.social-icons {
  display: flex;
  justify-content: center;
}
.social-icons a {
  display: inline-flex;
  padding: 10px;
  border: 2px solid #ccc;
  border-radius: 8px;
  font-size: 24px;
  color: #333;
  margin: 0 8px;
}

/* Toggle background panel */
.toggle-box {
  position: absolute;
  inset: 0;
}
.toggle-box::before {
  content: "";
  position: absolute;
  left: -250%;
  top: 0;
  z-index: 2;
  width: 300%;
  height: 100%;
  background: #7494ec;
  border-radius: 150px;
  transition: 1.8s ease-in-out;
}
.container.active .toggle-box::before {
  left: 50%;
}

.toggle-panel {
  position: absolute;
  width: 50%;
  height: 100%;
  color: #fff;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: 0.6s ease-in-out;
}
.toggle-panel p {
  margin-bottom: 20px;
}
.toggle-panel .btn {
  width: 160px;
  height: 46px;
  background: transparent;
  border: 2px solid #fff;
  box-shadow: none;
}

.toggle-panel.toggle-left {
  left: 0;
  transition-delay: 1.2s;
}
.container.active .toggle-panel.toggle-left {
  left: -50%;
  transition-delay: 0.6s;
}

.toggle-panel.toggle-right {
  right: -50%;
  transition-delay: 0.6s;
}
.container.active .toggle-panel.toggle-right {
  right: 0;
  transition-delay: 1.2s;
}

/* Mobile */
@media (max-width: 650px) {
  .container {
    height: calc(100vh - 40px);
    width: min(96vw, 850px);
  }
  .form-box {
    bottom: 0;
    width: 100%;
    height: 70%;
    right: 0;
  }
  .container.active .form-box {
    right: 0;
    bottom: 30%;
  }

  .toggle-box::before {
    left: 0;
    top: -270%;
    width: 100%;
    height: 300%;
    border-radius: 20vw;
  }
  .container.active .toggle-box::before {
    left: 0;
    top: 70%;
  }

  .toggle-panel {
    width: 100%;
    height: 30%;
  }
  .toggle-panel.toggle-left {
    top: 0;
    left: 0;
  }
  .container.active .toggle-panel.toggle-left {
    top: -30%;
  }

  .toggle-panel.toggle-right {
    right: 0;
    bottom: -30%;
  }
  .container.active .toggle-panel.toggle-right {
    bottom: 0;
  }
}

/* Alert error */
.alert-error {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  text-align: left;
}

/* ===== Social Login Buttons ===== */
.social-login {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}
.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  outline: none;
  cursor: pointer;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 15px;
  transition: background 0.3s ease, transform 0.2s ease;
}
.social-btn i {
  font-size: 20px;
}

.social-btn.google {
  background: #fff;
  color: #444;
  border: 1px solid #ddd;
}
.social-btn.google:hover {
  background: #f5f5f5;
  transform: translateY(-1px);
}

.social-btn.facebook {
  background: #1877f2;
  color: #fff;
  border: 1px solid #1877f2;
}
.social-btn.facebook:hover {
  background: #145ac9;
  transform: translateY(-1px);
}
