/* ==========================================
   GIAO DIỆN TRANG CHỦ (LANDING PAGE)
   ========================================== */
:root {
    --c-primary: #4f46e5;
    --c-primary-hover: #4338ca;
    --c-bg-main: #f1f5f9;
    --c-bg-panel: #ffffff;
    --c-text-h: #1e293b;
    --c-text-p: #64748b;
    --c-border: rgba(226, 232, 240, 0.7);
    --r-lg: 16px;
    --r-md: 8px;
    --s-premium: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --s-hover: 0 20px 25px -5px rgba(79, 70, 229, 0.1), 0 10px 10px -5px rgba(79, 70, 229, 0.04);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
body { background-color: var(--c-bg-main); color: var(--c-text-p); line-height: 1.6; overflow-x: hidden; }
a { text-decoration: none; }

/* NAVBAR */
.navbar { display: flex; justify-content: space-between; align-items: center; padding: 15px 5%; background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px); position: fixed; width: 100%; top: 0; z-index: 1000; border-bottom: 1px solid rgba(226, 232, 240, 0.4); box-shadow: 0 1px 3px rgba(0,0,0,0.03); }
.logo { font-size: 24px; font-weight: 800; color: var(--c-text-h); display: flex; align-items: center; gap: 10px; }
.logo i { color: var(--c-primary); }
.nav-links { display: flex; gap: 30px; }
.nav-links a { color: var(--c-text-h); font-weight: 500; font-size: 15px; transition: 0.3s; }
.nav-links a:hover { color: var(--c-primary); }

/* BUTTONS */
.btn { padding: 12px 24px; border-radius: var(--r-md); font-weight: 600; font-size: 15px; cursor: pointer; transition: all 0.3s ease; display: inline-flex; align-items: center; gap: 8px; }
.btn-primary { background: linear-gradient(135deg, #4f46e5, #6366f1); color: white; border: none; box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3); }
.btn-outline { background: rgba(255, 255, 255, 0.7); color: var(--c-text-h); border: 1px solid rgba(226, 232, 240, 0.8); }
.btn-outline:hover { border-color: var(--c-primary); color: var(--c-primary); background: #fff; }

/* HERO SECTION */
.hero { padding: 160px 5% 100px; text-align: center; background: radial-gradient(circle at top right, #fcfdfe, #e0e7ff); position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: linear-gradient(#e0e7ff 1.1px, transparent 1.1px), linear-gradient(90deg, #e0e7ff 1.1px, transparent 1.1px); background-size: 55px 55px; opacity: 0.15; z-index: 1; }
.hero * { position: relative; z-index: 2; }
.hero h1 { font-size: 3.5rem; color: var(--c-text-h); line-height: 1.2; margin-bottom: 20px; letter-spacing: -1px; }
.hero h1 span { color: var(--c-primary); }
.hero p { font-size: 1.1rem; max-width: 600px; margin: 0 auto 40px; }

/* FEATURES GRID */
.features { padding: 80px 5%; background-color: var(--c-bg-main); text-align: center; position: relative; }
.features::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 60px; background: linear-gradient(to bottom,rgba(224, 231, 255, 0.3), transparent); }
.section-title { font-size: 2.2rem; color: var(--c-text-h); margin-bottom: 15px; position: relative; }
.section-subtitle { margin-bottom: 50px; font-size: 1rem; position: relative; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; max-width: 1100px; margin: 0 auto; position: relative; z-index: 2; }
.feature-card { background-color: var(--c-bg-panel); padding: 40px 30px; border-radius: var(--r-lg); border: 1px solid rgba(226, 232, 240, 0.6); text-align: left; transition: 0.3s; box-shadow: var(--s-premium); }
.feature-card:hover { transform: translateY(-8px); box-shadow: var(--s-hover); border-color: rgba(79, 70, 229, 0.15); }
.feature-icon { width: 50px; height: 50px; background: #e0e7ff; color: var(--c-primary); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 20px; }
.feature-card h3 { color: var(--c-text-h); font-size: 1.2rem; margin-bottom: 12px; }

/* FOOTER */
footer { background-color: var(--c-bg-panel); padding: 40px 5%; text-align: center; border-top: 1px solid rgba(226, 232, 240, 0.7); font-size: 0.9rem; }

/* ==========================================
   CSS FORM ĐĂNG NHẬP / ĐĂNG KÝ
   ========================================== */
.auth-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(12px); display: none; justify-content: center; align-items: center; z-index: 2000; }
.auth-container { background: #fff; width: 100%; max-width: 430px; border-radius: 20px; padding: 45px 40px; position: relative; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3); animation: modal-slide-up 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); border: 1px solid rgba(255,255,255,0.2); }
@keyframes modal-slide-up { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.auth-close { position: absolute; top: 20px; right: 20px; font-size: 24px; color: #94a3b8; cursor: pointer; transition: 0.3s; }
.auth-close:hover { color: var(--c-primary); }
.auth-tabs { display: flex; background: #f1f5f9; padding: 5px; border-radius: 12px; margin-bottom: 30px; }
.auth-tabs button { flex: 1; padding: 10px; border: none; background: transparent; font-weight: 600; color: #64748b; cursor: pointer; border-radius: 8px; transition: 0.3s; }
.auth-tabs button.active { background: #fff; color: var(--c-primary); box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
.auth-form { display: none; }
.auth-form.active { display: block; }
.auth-header h3 { color: var(--c-text-h); font-size: 22px; margin-bottom: 5px; }
.auth-header p { font-size: 14px; margin-bottom: 25px; }
.auth-form .form-group { position: relative; margin-bottom: 15px; }
.auth-form .form-group i:not(.toggle-pass) { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.auth-form input { width: 100%; padding: 12px 15px 12px 45px; border-radius: 10px; border: 1px solid rgba(226, 232, 240, 0.8); outline: none; transition: 0.3s; }
.auth-form input:focus { border-color: var(--c-primary); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1); }
.toggle-pass { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); cursor: pointer; color: #94a3b8; }

/* FIX CỤM "GHI NHỚ TÔI" (MỚI) */
.auth-options { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 15px; }
.auth-options a { color: var(--c-primary); font-weight: 500; }
.auth-options label { display: flex; align-items: center; gap: 8px; cursor: pointer; margin-left: 5px; }
.auth-form input[type="checkbox"] { width: auto !important; padding: 0 !important; margin: 0; cursor: pointer; accent-color: var(--c-primary); transform: scale(1.15); }

.btn-auth { width: 100%; justify-content: center; margin-top: 10px; padding: 14px; }
.auth-divider { text-align: center; margin: 25px 0; position: relative; }
.auth-divider::before { content: ""; position: absolute; top: 50%; left: 0; width: 100%; height: 1px; background: var(--c-border); z-index: 1; }
.auth-divider span { background: #fff; padding: 0 15px; position: relative; z-index: 2; font-size: 13px; }
.social-login { display: flex; gap: 10px; }
.social-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border-radius: 10px; border: 1px solid rgba(226, 232, 240, 0.8); background: rgba(255,255,255,0.7); font-weight: 600; font-size: 14px; cursor: pointer; transition: 0.3s; }
.social-btn:hover { background: #f8fafc; border-color: rgba(226, 232, 240, 1); }
.social-btn:last-child { background: #1877f2; color: #fff; border: none; }
.terms-text { font-size: 12px; margin-bottom: 15px; text-align: center; }
.terms-text a { color: var(--c-primary); font-weight: 600; }
/* ==========================================
   CẬP NHẬT NÚT ĐÓNG FORM LÊN CAO HƠN
   ========================================== */
.auth-close {
    position: absolute;
    top: 10px;      /* Giảm từ 20px xuống 12px để đẩy lên cao */
    right: 15px;    /* Giảm từ 20px xuống 15px để đẩy sát ra lề phải */
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    transition: 0.3s;
    line-height: 1; /* Giúp dấu x không bị lệch dòng */
    z-index: 10;    /* Đảm bảo luôn nằm trên các thành phần khác */
}

.auth-close:hover {
    color: var(--c-primary); /* Rê chuột vào đổi màu cho sành điệu */
    transform: rotate(90deg); /* Thêm hiệu ứng xoay nhẹ cho chuyên nghiệp */
}





/* ==========================================
   PREMIUM TOAST SYSTEM (ZEN NOTIFY)
   ========================================== */
#toast-container {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast-msg {
    min-width: 300px;
    padding: 16px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transform: translateX(120%); /* Đứng ngoài màn hình */
    transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 5px solid var(--c-primary);
}

.toast-msg.show { transform: translateX(0); }

.toast-msg span { color: var(--c-text-h); font-weight: 500; font-size: 14px; }

/* Các trạng thái màu sắc */
.toast-success { border-left-color: #10b981; }
.toast-error { border-left-color: #ef4444; }
.toast-warning { border-left-color: #f59e0b; }



/* --- HIỆU ỨNG CUỘN TRANG MƯỢT MÀ --- */
html {
    scroll-behavior: smooth;
}

/* --- HIỆU ỨNG HIỆN DẦN KHI CUỘN (SCROLL REVEAL) --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- HIỆU ỨNG PHÙ VÂN (FLOATING) CHO HERO --- */
@keyframes floating {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

.hero h1, .hero p {
    animation: floating 4s ease-in-out infinite;
}

.hero p {
    animation-delay: 0.5s;
}

/* --- HIỆU ỨNG "ÁNH KIM" CHO NÚT BẤM --- */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: "";
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20%;
    height: 200%;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(30deg);
    transition: all 0.5s;
}

.btn-primary:hover::after {
    left: 120%;
}






/* ==========================================
   BẢN FIX MOBILE "MỘT PHÁT GỌN NGAY"
   ========================================== */
@media (max-width: 768px) {
    /* 1. NAVBAR: Xếp chồng Logo và Nút bấm cân đối, không đè nhau */
    .navbar {
        flex-direction: column; 
        padding: 15px;
        gap: 12px;
        height: auto;
    }
    .nav-links { display: none !important; } /* Ẩn link phụ cho đỡ rối [cite: 19] */
    .navbar > div:last-child {
        display: flex;
        width: 100%;
        justify-content: center;
        gap: 8px;
    }
    .navbar .btn {
        padding: 8px 16px; /* Thu nhỏ nút trên menu một chút */
        font-size: 13px;
    }

    /* 2. HERO: Đẩy nội dung xuống thấp để không bị thanh Menu che mất [cite: 20] */
    .hero {
        padding: 150px 20px 60px !important;
    }
    .hero h1 {
        font-size: 1.8rem !important; /* Font chữ tiêu đề vừa vặn [cite: 20] */
        line-height: 1.3;
    }
    .hero p {
        font-size: 0.95rem;
        margin-bottom: 30px;
    }

    /* 3. NÚT HERO: Ép rộng 100% để bạn bấm bằng ngón cái cực dễ [cite: 21] */
    .hero div[style*="display: flex"] {
        flex-direction: column !important;
        gap: 15px !important;
    }
    .hero .btn {
        width: 100%;
        justify-content: center;
        padding: 15px;
    }

    /* 4. MODAL: Cho vừa khít màn hình, không bị tràn lề */
    .auth-container {
        width: 92% !important;
        padding: 30px 20px !important;
        margin: 0 auto;
    }
    
    /* 5. TÍNH NĂNG: Ép về 1 cột dọc chuẩn Zen [cite: 23] */
    .feature-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
}