/* ==== Reset + Font ==== */
* {
  box-sizing: border-box;
  font-family: 'Segoe UI', sans-serif;
}

body {
  background: #e3ecfb;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  position: relative;
}

/* ==== Sóng nền động ==== */
body::before {
  content: "";
  position: fixed;
  top: -100px;
  left: 0;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 20% 20%, #4d89ff22 0%, transparent 50%),
              radial-gradient(circle at 80% 80%, #6ea0ff22 0%, transparent 50%);
  animation: waveFlow 20s linear infinite;
  z-index: -1;
  opacity: 0.4;
}

@keyframes waveFlow {
  0% {
    transform: translateX(0) translateY(0);
  }
  50% {
    transform: translateX(-25%) translateY(5%);
  }
  100% {
    transform: translateX(0) translateY(0);
  }
}

/* ==== Login Box ==== */
.login-box {
  position: relative;
  width: 950px;
  max-width: 100%;
  height: 580px;
  background: #fff;
  border-radius: 35px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  transition: all 0.5s ease-in-out;
  animation: fadeIn 1s ease-in-out;
  margin: auto;
}

/* ==== Form Box ==== */
.form-box {
  position: absolute;
  width: 50%;
  height: 100%;
  background: #fff;
  padding: 40px;
  transition: all 0.8s ease;
  z-index: 2;
  border-radius: 35px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: slideIn 0.8s ease forwards;
}

.user-box {
  left: 0;
}

.admin-box {
  right: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%) scale(0.95);
}

.login-box.admin-mode .user-box {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-100%) scale(0.95);
}

.login-box.admin-mode .admin-box {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0%) scale(1);
}

/* ==== Overlay ==== */
.overlay {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(135deg, #4d89ff, #6ea0ff);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px;
  transition: transform 1s ease, box-shadow 0.6s ease;
  z-index: 3;
  border-radius: 35px;
  animation: gradientPulse 6s infinite ease-in-out;
}

.login-box.admin-mode .overlay {
  transform: translateX(-100%);
}

.overlay h2 {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 10px;
}

.overlay p {
  font-size: 16px;
  margin-bottom: 20px;
}

.overlay button {
  background-color: white;
  color: #4d89ff;
  border: 2px solid #fff;
  padding: 10px 24px;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.overlay button:hover {
  background-color: #fff;
  color: #4d89ff;
  border-color: #4d89ff;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(77, 137, 255, 0.4);
}

/* ==== Inputs + Submit Button ==== */
input[type="email"], input[type="password"] {
  padding: 12px;
  border: 1px solid #ced4da;
  border-radius: 10px;
  transition: 0.3s;
}

input:focus {
  border-color: #4d89ff;
  box-shadow: 0 0 6px rgba(77, 137, 255, 0.4);
}

button[type="submit"] {
  background-color: #4d89ff;
  border: none;
  transition: all 0.3s ease;
}

button[type="submit"]:hover {
  background-color: #3c75e2;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(77, 137, 255, 0.3);
}

/* ==== Error Message ==== */
.error-message {
  min-height: 24px;
  font-size: 15px;
  color: #dc3545;
  text-align: center;
  font-weight: 500;
  display: block;
}

/* ==== Animation ==== */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes gradientPulse {
  0%, 100% { background: linear-gradient(135deg, #4d89ff, #6ea0ff); }
  50% { background: linear-gradient(135deg, #6ea0ff, #4d89ff); }
}

/* ==== Fireworks ==== */
.firework {
  position: fixed;
  width: 6px;
  height: 6px;
  background: #fff;
  border-radius: 50%;
  animation: explode 700ms ease-out forwards;
  pointer-events: none;
  z-index: 9999;
}

@keyframes explode {
  0% {
    transform: scale(1);
    opacity: 1;
}  
  100% {
    transform: scale(5) translateY(-100px);
    opacity: 0;
  }
}

/* ==== Responsive ==== */
@media screen and (max-width: 768px) {
  .login-box {
    height: calc(1.2 * 100vw);
}
.user-box, .admin-box{
    transform: scale(calc(100vh / 600)); /* tỉ lệ tùy theo thiết kế gốc */
    transform-origin: top center;
  }
}

 /* === Giao diện icon === */
.contact-icons a {
  color: #fff;
  font-size: 1.6rem;
  position: relative;
  transition: transform 0.3s ease, color 0.3s ease;
}
.contact-icons a:hover {
  transform: scale(1.3);
  color: #c0c0c0;
}

/* === Tooltip đẹp khi hover === */
.contact-icons a::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -2.2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 0.85rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.contact-icons a:hover::after {
  opacity: 1;
}

/* ==== Nút nổi mở popup ==== */
.promo-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #e3ecfb;
  color: #4d89ff;
  border: none;
  font-size: 1.8rem;
  padding: 12px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
  transition: transform 0.3s ease, background 0.3s;
}

.promo-button:hover {
  background: #fff;
  transform: scale(1.1);
}

/* ==== Popup quảng cáo v2 ==== */
.promo-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(243, 244, 248, 0.98); /* sáng hơn, dễ nhìn hơn */
  display: none;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  z-index: 10000;
  padding: 80px 20px 40px;
  color: #222;
}

.promo-popup .popup-content {
  width: 95%;
  max-width: 1200px;
  background: #fff;
  padding: 50px 40px;
  border-radius: 12px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.1);
}

/* Nút đóng đẹp và nằm xa hơn */
.popup-content .close-popup {
  position: absolute;
  top: 24px;
  right: 30px;
  font-size: 32px;
  color: #999;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.popup-content .close-popup:hover {
  transform: scale(1.2);
  color: #333;
}

/* ==== Ảnh + mô tả kiểu blog ==== */
.popup-images .image-block {
  display: flex;
  margin-bottom: 60px;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
  padding: 20px 0;
  border-bottom: 1px solid #eee;
}

.image-block img {
  width: 46%;
  max-width: 600px;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.image-block.left {
  flex-direction: row;
}

.image-block.right {
  flex-direction: row-reverse;
}

.text-box {
  flex: 1;
  min-width: 260px;
}

.text-box h3 {
  color: #4d89ff;
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.text-box h5 {
  margin-top: 15px;
  font-weight: 600;
  color: #555;
}

.text-box p {
  font-size: 1rem;
  line-height: 1.6;
  color: #444;
}

/* ==== Liên hệ admin ==== */
.popup-footer {
  margin-top: 30px;
}

.popup-footer .contact-icons a {
  font-size: 1.8rem;
  color: #4d89ff;
  transition: all 0.3s;
  position: relative;
}

.popup-footer .contact-icons a:hover {
  color: #0056b3;
  transform: scale(1.2);
}

.popup-footer .contact-icons a::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -1.8rem;
  left: 50%;
  transform: translateX(-50%);
  background: #4d89ff;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
}

.popup-footer .contact-icons a:hover::after {
  opacity: 1;
}

/* ==== Ẩn thanh cuộn popup ==== */
.promo-popup::-webkit-scrollbar {
  width: 0;
  height: 0;
}
