/* --- Cài đặt chung & Biến màu --- */
:root {
    --primary-blue: #0077FF;
    --dark-blue: #0056b3;
    --light-blue-bg: #E0F2FF;
    --wave-blue: #3B82F6;
    --purple: #6D28D9;
    --primary-orange: #F59E0B;
    --secondary-red: #EF4444;
    --white: #FFFFFF;
    --text-dark: #333;
    --gradient-main: linear-gradient(90deg, #3B82F6 0%, #6D28D9 100%);
    --gradient-btn: linear-gradient(90deg, #F59E0B 0%, #EF4444 100%);
    --shadow-main: 0 8px 32px rgba(59,130,246,0.15);
    --shadow-btn: 0 4px 16px rgba(245,158,11,0.18);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Montserrat', 'Poppins', sans-serif;
    background: var(--gradient-main);
    color: var(--text-dark);
    min-height: 100vh;
}
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- Top Bar Header --- */
.top-bar { background: var(--gradient-main); color: white; padding: 16px 0; font-size: 1rem; box-shadow: var(--shadow-main); border-bottom-left-radius: 30px; border-bottom-right-radius: 30px; }
.top-bar-content { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.top-bar .logo img { height: 45px; display: block; }
.top-bar-text { flex-grow: 1; text-align: left; margin: 0; }
.top-bar-button { background: var(--gradient-btn); color: white; text-decoration: none; font-weight: 800; text-align: center; padding: 12px 32px; border-radius: 16px; border: none; box-shadow: var(--shadow-btn); flex-shrink: 0; transition: transform 0.2s, box-shadow 0.2s, background 0.3s; font-size: 1.1rem; letter-spacing: 1px; }
.top-bar-button:hover { background: linear-gradient(90deg, #EF4444 0%, #F59E0B 100%); transform: scale(1.08); box-shadow: 0 8px 24px rgba(245,158,11,0.25); }

/* --- Hero Section & Form Đăng ký --- */
.hero-section {
    background-color: var(--white);
    background-image:
        linear-gradient(rgba(224, 242, 255, 0.8), rgba(224, 242, 255, 0.8)),
        linear-gradient(90deg, #e0f2ff 1px, transparent 1px),
        linear-gradient(#e0f2ff 1px, transparent 1px);
    background-size: 1.5rem 1.5rem;
    padding-top: 50px;
    padding-bottom: 50px;
    position: relative;
    overflow: hidden;
}
.hero-content {
    position: relative;
}
.hero-illustration {
    position: relative;
    width: 100%;
    max-width: none;
    min-height: 600px;
}
.hero-illustration > img {
    width: 100%;
    height: 600px;
    object-fit: cover;
    display: block;
}

/* === ĐỊNH VỊ CHO DESKTOP === */
.rules-text {
    position: absolute;
    top: 8%;
    left: 6%;
    width: 48%;
    z-index: 2;
}
.rules-text h2 {
    color: #F59E0B;
    font-size: 1.7rem;
    font-weight: 800;
    margin-bottom: 14px;
    text-align: left;
}
.rules-text ul {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 14px;
    list-style: none;
    padding-left: 0;
}
.registration-form {
    position: absolute;
    top: 0.2%;
    right: 1%;
    width: 38%;
    min-width: 340px;
    z-index: 2;
}
/* === KẾT THÚC ĐỊNH VỊ CHO DESKTOP === */

.form-container { 
    background: rgba(255,255,255,0.98);
    background-image: var(--gradient-main);
    padding: 28px 18px 24px 18px;
    border-radius: 24px;
    color: var(--text-dark);
    text-align: center;
    box-shadow: 0 12px 40px rgba(59,130,246,0.18);
    border: 2px solid var(--primary-orange);
}
.form-container h2 { 
    font-size: 2.1rem; font-weight: 900; color: var(--primary-orange);
    line-height: 1.3; text-shadow: 0 2px 8px rgba(245,158,11,0.18); margin-bottom: 18px;
}
.countdown-timer { display: flex; justify-content: center; gap: 10px; margin-bottom: 25px; }
.time-unit { display: flex; flex-direction: column; align-items: center; }
.time-unit span { background-color: var(--white); color: var(--purple); font-size: 1.5rem; font-weight: 700; padding: 5px 8px; border-radius: 8px; min-width: 40px; line-height: 1; }
.time-unit label { font-size: 0.7rem; margin-top: 5px; }
.form-container form input, .form-container form select { 
    width: 100%; padding: 14px 18px; margin-bottom: 18px; border: 2px solid var(--primary-blue);
    border-radius: 12px; font-size: 1.05rem; font-family: 'Poppins', sans-serif;
    box-shadow: 0 2px 8px rgba(59,130,246,0.08); background: rgba(255,255,255,0.95); color: var(--text-dark);
}
.form-container form select { 
    appearance: none; 
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236D28D9'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); 
    background-repeat: no-repeat; background-position: right 15px center; background-size: 20px; 
}
.form-container form input:focus, .form-container form select:focus { 
    outline: none; border-color: var(--primary-orange); box-shadow: 0 0 0 2px rgba(245,158,11,0.15);
}
.cta-button { 
    width: 100%; padding: 18px; border: none; border-radius: 16px; font-size: 1.2rem; font-weight: 800;
    cursor: pointer; transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
    box-shadow: var(--shadow-btn); background: var(--gradient-btn); letter-spacing: 1px;
}
.cta-button:hover { 
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 12px 32px rgba(245,158,11,0.25);
    background: linear-gradient(90deg, #EF4444 0%, #F59E0B 100%);
}

/* --- Quick Navigation --- */
.quick-nav { 
    background-color: var(--wave-blue); padding: 20px 0; text-align: center; 
    border-bottom-left-radius: 50% 20%; border-bottom-right-radius: 50% 20%; 
    position: relative; top: -50px; z-index: 10; 
}
.nav-button { background-color: var(--primary-blue); color: var(--white); text-decoration: none; padding: 12px 30px; margin: 0 10px; border-radius: 50px; font-weight: 600; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15); transition: background-color 0.3s; }
.nav-button:hover { background-color: var(--dark-blue); }

/* --- Sections --- */
.awards-section-simple { background-color: #0d4e99; padding-bottom: 60px; text-align: center; line-height: 0; }
.awards-section-simple .container { padding: 0; max-width: 100%; }
.awards-section-simple img { width: 100%; max-width: 1200px; display: block; margin: 0 auto; }
.benefits-section { background-color: var(--white); padding: 60px 0; }
.benefits-content { display: flex; align-items: center; gap: 50px; }
.benefits-image img { max-width: 100%; border-radius: 20px; }

/* --- Nút CTA trên hình benefits --- */
.benefits-cta {
    background: var(--gradient-btn); color: #fff; font-family: 'Montserrat', 'Poppins', sans-serif;
    font-size: 1.25rem; font-weight: 900; border-radius: 14px; padding: 18px 48px;
    box-shadow: 0 8px 32px rgba(245,158,11,0.18); letter-spacing: 1.5px; text-decoration: none;
    z-index: 10; display: inline-block; transition: all 0.2s ease; position: absolute;
    right: 22%; bottom: 6%;
}
.benefits-cta:hover { transform: scale(1.03); box-shadow: 0 12px 36px rgba(245,158,11,0.24); }


/* ==================================================== */
/* =============== RESPONSIVE TỔNG THỂ =============== */
/* ==================================================== */

@media (max-width: 992px) {
    /* === BỐ CỤC MỚI CHO TOP BAR TRÊN MOBILE === */
    .top-bar-content {
        display: flex;
        flex-wrap: wrap; /* Cho phép các mục xuống dòng */
        justify-content: space-between; /* Đẩy logo và nút về 2 phía */
        align-items: center; /* Căn giữa logo và nút theo chiều dọc */
        row-gap: 15px; /* Khoảng cách giữa hàng trên và hàng dưới */
    }
    .top-bar .logo {
        order: 1; /* Logo đầu tiên */
    }
    .top-bar-button {
        order: 2; /* Nút thứ hai */
        margin-top: 0; /* Bỏ margin cũ */
    }
    .top-bar-text {
        order: 3; /* Chữ nằm cuối cùng */
        width: 100%; /* Chiếm toàn bộ chiều rộng để tự xuống dòng */
        text-align: center; /* Căn giữa chữ */
        font-size: 0.9rem;
        line-height: 1.5;
        margin-top: 0;
    }
    .top-bar .logo img {
        height: 50px; /* Làm cho logo to hơn một chút */
    }
    /* === KẾT THÚC BỐ CỤC TOP BAR === */
    
    .hero-illustration {
        display: flex;
        flex-direction: column;
        align-items: center;
        height: auto;
        min-height: auto;
        position: relative;
        padding-top: 20px;
    }
    .rules-text, .registration-form, .hero-illustration > img {
        position: static;
        width: 90%;
        max-width: 450px;
        right: auto; top: auto; left: auto;
    }

    .rules-text { 
        order: 1; 
        margin-bottom: 0;
        position: absolute;
        top: 20px;
        width: 100%;
        text-align: center;
        z-index: 3;
        padding: 0 20px;
    }
    .rules-text h2 {
        font-size: 1.5rem;
        line-height: 1.3;
        text-align: center;
        margin-bottom: 10px;
        color: var(--primary-orange);
    }
    .rules-text ul {
        font-size: 0.95rem;
        list-style: none;
        padding-left: 0;
        text-align: center;
        color: #555;
    }
    .rules-text ul li {
        margin-bottom: 5px;
    }

    .hero-illustration > img { 
        order: 2;
        width: 100%;
        height: auto;
        object-fit: contain;
        margin-bottom: 30px;
    }
    .registration-form { 
        order: 3;
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .rules-text h2 { font-size: 1.3rem; }
    .rules-text ul { font-size: 0.85rem; }
    .registration-form { max-width: 90%; }
    
    .quick-nav { top: -30px; padding: 15px 0; }
    .quick-nav .container { gap: 10px; }
    .nav-button {
        font-size: 0.9rem; padding: 10px 20px; margin: 0 5px;
        flex-grow: 1; max-width: 150px;
    }

    /* === Điều chỉnh CTA ở phần benefits-section cho mobile === */
    .benefits-section {
        padding: 30px 0; /* Giảm padding tổng thể của section */
    }
    .benefits-cta {
        font-size: 0.7rem;      /* Chữ nhỏ hơn đáng kể */
        font-weight: 700;       /* Chữ bớt đậm, thanh thoát hơn */
        padding: 8px 18px;      /* Giảm đệm viền để nút gọn lại */
        border-radius: 6px;     /* Bo góc ít hơn cho phù hợp */
        letter-spacing: 0.3px;  /* Tăng nhẹ khoảng cách chữ cho dễ đọc */
        bottom: 3%;             /* Điều chỉnh lại vị trí một chút cho cân đối */
        left: 60%;
        transform: translateX(-50%);
        width: auto;
        white-space: nowrap;
    }
    /* === Kết thúc điều chỉnh CTA === */

    /* Adjust spacing for mobile view */
    .hero-section {
        padding-top: 20px;
        padding-bottom: 20px;
    }

    .hero-illustration img {
        margin-bottom: 10px;
    }

    .registration-form {
        margin-top: 10px;
    }
}

/* Adjust quick navigation to avoid overlapping form */
.quick-nav {
    position: relative;
    z-index: 1;
}

/* Add margin to form container to avoid overlap */
.form-container {
    margin-top: 20px;
}

/* Popup Overlay */
#thankyou-popup {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.4);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 15px;
}

/* Popup Content */
#thankyou-popup .popup-content {
  background: #fff;
  padding: 24px 20px;
  border-radius: 16px;
  box-shadow: 0 6px 28px rgba(0,0,0,0.2);
  text-align: center;
  max-width: 420px;
  width: 100%;
  font-family: 'Montserrat', sans-serif;
  color: #333;
  animation: fadeIn 0.3s ease;
}

/* Heading */
#thankyou-popup h2 {
  color: #0077FF;
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 12px;
}

#thankyou-popup .highlight {
  color: #F59E0B;
  font-weight: 700;
}

/* Account box */
#thankyou-popup .account-box {
  margin: 16px 0;
  padding: 12px;
  border: 2px dashed #0077FF;
  border-radius: 10px;
  background: #E0F2FF;
  text-align: left;
  font-size: 0.95rem;
}

/* Note text */
#thankyou-popup .note {
  margin: 12px 0;
  font-size: 0.95rem;
}

#thankyou-popup h3 {
  margin-top: 18px;
  color: #6D28D9;
  font-size: 1rem;
  font-weight: 600;
}

/* List */
#thankyou-popup ul {
  text-align: left;
  margin: 10px auto;
  padding-left: 20px;
  font-size: 0.9rem;
  line-height: 1.5;
  max-width: 360px;
}

/* QR Box */
#thankyou-popup .qr-box {
  margin-top: 16px;
}

#thankyou-popup .qr-box img {
  width: 110px;
  height: 110px;
  border: 2px solid #0077FF;
  border-radius: 8px;
  margin-top: 8px;
}

/* Button */
#thankyou-popup .close-btn {
  margin-top: 20px;
  padding: 10px 24px;
  border-radius: 8px;
  background: #F59E0B;
  color: #fff;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s ease;
}

#thankyou-popup .close-btn:hover {
  background: #d98207;
}

/* Animation */
@keyframes fadeIn {
  from {opacity: 0; transform: scale(0.9);}
  to {opacity: 1; transform: scale(1);}
}

/* Responsive */
@media (max-width: 480px) {
  #thankyou-popup .popup-content {
    padding: 20px 16px;
    font-size: 0.9rem;
  }

  #thankyou-popup h2 {
    font-size: 1.1rem;
  }

  #thankyou-popup ul {
    font-size: 0.85rem;
  }
}

/* Adjust hero-illustration for responsive images */
.hero-illustration img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* === PHẦN ĐÃ SỬA LỖI === */
@media (max-width: 768px) {
    .hero-illustration > img {
        content: url('image9.png');
    }
}

@media (min-width: 769px) {
    .hero-illustration > img {
        content: url('image8.png');
    }
}