/* --- Cài đặt chung --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', sans-serif;
  background: #e5eefb;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  overflow-x: hidden; 
}

/* --- Lớp nền logo lặp lại --- */
.bg-logo-bg {
  pointer-events: none;
  position: fixed;
  z-index: 0;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.bg-logo-bg-inner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 200vw;
  height: 200vh;
  transform: translate(-50%, -50%) rotate(-10deg);
  background-image: url('https://i.postimg.cc/yd4v4YHG/EZ-LOGO-31.png');
  background-repeat: repeat;
  background-size: 120px auto;
  opacity: 0.07;
  will-change: transform;
}

.container {
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 14px 28px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);
  position: relative;
  overflow: hidden;
  width: 768px;
  max-width: 100%;
  min-height: 520px;
  z-index: 1;
}

/* --- Cấu trúc Form & Overlay --- */
.form-container {
  position: absolute;
  top: 0;
  height: 100%;
  transition: all 0.6s ease-in-out;
}

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

.sign-up {
  left: 0;
  width: 50%;
  opacity: 0;
  z-index: 1;
}

.overlay-container {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 100%;
  overflow: hidden;
  transition: transform 0.6s ease-in-out;
  z-index: 100;
}

.overlay {
  background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
  color: #FFFFFF;
  position: relative;
  left: -100%;
  height: 100%;
  width: 200%;
  transform: translateX(0);
  transition: transform 0.6s ease-in-out;
}

.overlay-panel {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 0 40px;
  text-align: center;
  top: 0;
  height: 100%;
  width: 50%;
  transform: translateX(0);
  transition: transform 0.6s ease-in-out;
}

/* --- Logic Hiệu ứng Chuyển đổi --- */
.container.right-panel-active .sign-in { 
  transform: translateX(100%); 
  opacity: 0;
}
.container.right-panel-active .sign-up {
  transform: translateX(100%);
  opacity: 1;
  z-index: 5;
  animation: show 0.6s;
}
.container.right-panel-active .overlay-container { transform: translateX(-100%); }
.container.right-panel-active .overlay { transform: translateX(50%); }
.overlay-left { transform: translateX(-20%); }
.container.right-panel-active .overlay-left { transform: translateX(0); }
.overlay-right { right: 0; transform: translateX(0); }
.container.right-panel-active .overlay-right { transform: translateX(20%); }

@keyframes show {
  0%, 49.99% { opacity: 0; z-index: 1; }
  50%, 100% { opacity: 1; z-index: 5; }
}

/* --- Cải tiến Text và Hiệu ứng --- */
form {
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 0 50px;
  height: 100%;
  text-align: center;
}

form h1 {
  font-weight: 700;
  margin-bottom: 20px;
  background: linear-gradient(90deg, #2563eb 0%, #1d4ed8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fadeInDown 0.8s ease-out;
}

.overlay-panel h1 {
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);
  animation: fadeInDown 0.8s ease-out 0.2s;
  animation-fill-mode: backwards;
}

.overlay-panel p {
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.5px;
  margin: 20px 0 30px;
  animation: fadeInUp 0.8s ease-out 0.4s;
  animation-fill-mode: backwards;
}

input {
  background-color: #f3f4f6;
  border: 1px solid #d1d5db;
  padding: 12px 15px;
  margin: 8px 0;
  width: 100%;
  border-radius: 5px;
  font-family: 'Poppins', sans-serif;
  transition: all 0.3s ease;
}

input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
  outline: none;
}

button {
  border-radius: 20px;
  border: 1px solid #2563eb;
  background-color: #2563eb;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 45px;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  margin-top: 20px;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

button:hover {
  background-color: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

button:active {
  transform: scale(0.95);
}

button:focus {
  outline: none;
}

button.ghost {
  background-color: transparent;
  border-color: #FFFFFF;
  box-shadow: none;
}

button.ghost:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(0);
  box-shadow: none;
}

.logo {
  margin-bottom: 20px;
}

.logo img {
  max-width: 150px;
  height: auto;
}

/* --- Keyframes cho Animations --- */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

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

