:root {
    /* "Modern Professional" Palette (Slate & Indigo) - TRUST & TECH */
    --primary: #4F46E5;
    /* Indigo 600 - Main Brand Color */
    --primary-dark: #4338CA;
    /* Indigo 700 */
    --accent: #06B6D4;
    /* Cyan 500 - Secondary/Highlight */

    /* Gradients */
    --gradient-hero: linear-gradient(180deg, #EEF2FF 0%, #F8FAFC 100%);

    /* Typography - Inter / Slate */
    --text-head: #1E1B4B;
    /* Indigo 950 (Authority, Sharp) */
    --text-body: #334155;
    /* Slate 700 (Readable, Soft Black) */
    --text-sub: #64748B;
    /* Slate 500 (Subtext, Date, Caption) */

    --bg-body: #F8FAFC;
    /* Slate 50 (Very Clean Gray) */
    --bg-white: #FFFFFF;

    --border: #E2E8F0;
    /* Slate 200 */

    /* Footer */
    --footer-bg: #1E1B4B;
    /* Indigo 950 (Really Dark Blue) */
    --footer-text: #94A3B8;
    /* Slate 400 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    /* Make text crisp */
}

/* --- LOGO TEXT STYLING --- */
.logo-edu {
    color: #1E1B4B;
    /* Tím Than Đậm (Dark Navy) */
    font-weight: 800;
    /* ExtraBold - Rất đậm */
}

.logo-mate {
    color: #4F46E5;
    /* Tím Sáng (Indigo) */
    font-weight: 700;
    /* Bold - Đậm vừa */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-head);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
    /* Tighten headings slightly */
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: all 0.2s;
    font-weight: 500;
}

a:hover {
    color: var(--primary-dark);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* --- STORE BADGES (Nút tải App chuẩn xịn) --- */
.store-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: #111827;
    /* Đen than (Chuẩn Apple/Google) */
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: 12px;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 160px;
}

.store-btn:hover {
    background: #000000;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
}

.store-btn i {
    font-size: 1.5rem;
}

.store-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.1;
}

.store-subtitle {
    font-size: 0.65rem;
    text-transform: uppercase;
    opacity: 0.8;
}

.store-title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* BUTTONS - General */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--primary);
    color: white !important;
    /* Force white text */
    border: 1px solid transparent;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-outline {
    background: white;
    border: 1px solid #CBD5E1;
    color: var(--text-head);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #F8FAFC;
}

/* White Button (For Header) */
.btn-white {
    background: white;
    color: var(--primary);
    border: 1px solid #E2E8F0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-white:hover {
    background: #F8FAFC;
    color: var(--primary-dark);
    border-color: #CBD5E1;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* --- HEADER --- */
header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-head);
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-body);
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--primary);
}

/* --- HERO SECTION --- */
.hero {
    background: var(--gradient-hero);
    padding: 6rem 0 4rem;
    position: relative;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

/* Blobs */
.hero-blob {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    z-index: 0;
    filter: blur(40px);
}

.blob-1 {
    top: -20%;
    right: -10%;
}

.blob-2 {
    bottom: -10%;
    left: -10%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 5rem;
    position: relative;
    z-index: 1;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: 3.25rem;
    margin-bottom: 1.5rem;
    color: var(--text-head);
    letter-spacing: -0.03em;
}

.hero-text p {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    color: var(--text-body);
    max-width: 90%;
    font-weight: 400;
}

.hero-cta {
    display: flex;
    gap: 1rem;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

/* REALISTIC PHONE MOCKUP */
.phone-mockup {
    width: 300px;
    height: 600px;
    background: white;
    border-radius: 45px;
    border: 12px solid #1E1B4B;
    /* Dark Indigo Border */
    box-shadow: 0 50px 100px -20px rgba(79, 70, 229, 0.25);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.phone-mockup::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 30px;
    background: #1E1B4B;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    z-index: 3;
}

/* --- SECTIONS --- */
section {
    padding: 6rem 0;
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3.5rem;
}

.section-header h2 {
    font-size: 2.25rem;
    color: var(--text-head);
}

.section-header p {
    font-size: 1.125rem;
    color: var(--text-body);
}

/* --- CARDS (Features & Transparency) --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    border-color: #cbd5e1;
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.card p {
    flex-grow: 1;
    font-size: 0.95rem;
    line-height: 1.6;
}

.card .btn-outline {
    margin-top: 1.5rem;
    width: 100%;
    text-align: center;
    border-radius: 6px;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    background: #EFF6FF;
    /* Blue 50 */
    color: var(--primary);
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

/* --- FEATURES Custom --- */
.features {
    background: white;
}

.feature-item {
    padding: 1.5rem;
    text-align: center;
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
    display: inline-block;
}

/* --- FAQ --- */
#faq {
    background: var(--bg-body);
}

.faq-grid {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1rem;
    padding: 1.5rem;
}

.faq-item h3 {
    font-size: 1.1rem;
    color: var(--text-head);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.faq-item h3 i {
    color: var(--primary);
}

/* --- FOOTER --- */
footer {
    background: var(--footer-bg);
    /* Slate 900 */
    color: var(--footer-text);
    /* Slate 400 */
    padding: 5rem 0 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    gap: 4rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.footer-col h3 {
    color: white;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
}

.footer-col a {
    color: var(--footer-text);
}

.footer-col a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    font-size: 0.875rem;
}

/* --- LEGAL PAGE (Unified Document) --- */
.legal-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.legal-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.legal-wrapper {
    display: flex;
    gap: 0;
    max-width: 1000px;
    margin: 3rem auto;
    align-items: stretch;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border);
    /* overflow: hidden; */
    /* REMOVED to fix Sticky Sidebar */
}

/* Sidebar (Left Column) - Modern Docs Style */
.legal-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: transparent;
    border-right: 1px solid var(--border);
    padding: 3rem 0;

    /* Round corners MANUALLY for the Sidebar */
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.legal-sidebar-sticky-inner {
    position: sticky;
    top: 90px;
    padding: 0 1.5rem;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.toc-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94A3B8;
    /* Slate 400 */
    margin-bottom: 1.25rem;
    font-weight: 700;
    padding-left: 1.25rem;
    /* Align with text */
}

/* Modern Track Line */
.toc-list {
    list-style: none;
    position: relative;
    padding-left: 0;
    margin-left: 0;
}

.toc-item {
    position: relative;
}

.toc-item a {
    display: block;
    padding: 0.5rem 0 0.5rem 1.25rem;
    /* Space for the border */
    color: var(--text-body);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 2px solid #E2E8F0;
    /* Inactive track line */
    margin-left: 0;
}

.toc-item a:hover {
    color: var(--text-head);
    border-left-color: #CBD5E1;
    /* Darker grey on hover */
}

/* Active State */
.toc-item a.active {
    color: var(--primary);
    font-weight: 600;
    border-left-color: var(--primary);
    /* Blue accent line */
    background: linear-gradient(90deg, #F8FAFC 0%, white 100%);
    /* Subtle highlight */
}

/* Hide scrollbar */
.legal-sidebar-sticky-inner::-webkit-scrollbar {
    width: 4px;
}

.legal-sidebar-sticky-inner::-webkit-scrollbar-thumb {
    background-color: #E2E8F0;
    border-radius: 4px;
}

.legal-content-area {
    flex: 1;
    min-width: 0;
    background: white;
    padding: 4rem;

    /* Round corners MANUALLY for the content */
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.legal-content-area h1 {
    font-size: 2.25rem;
    color: var(--text-head);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.legal-content-area h2 {
    font-size: 1.5rem;
    color: var(--text-head);
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #E2E8F0;
}

.legal-content-area h3 {
    font-size: 1.15rem;
    margin-top: 2rem;
}

/* Highlight Box */
.highlight-box {
    background: #F1F5F9;
    /* Slate 100 */
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.highlight-box h3 {
    color: var(--text-head);
    margin-top: 0;
}

/* Data Icons */
.data-group {
    display: grid;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.data-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.data-icon-box {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: white;
    border: 1px solid #E2E8F0;
    color: var(--primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

/* --- RESPONSIVE DESIGNS --- */

/* Mobile Menu Button (Hidden on Desktop) */
.mobile-menu-btn {
    display: none !important;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-head);
    cursor: pointer;
}

/* 1. Tablet & Summarized View (Legal Page & Layouts) */
@media (max-width: 900px) {
    .legal-wrapper {
        flex-direction: column;
        border-radius: 0;
        box-shadow: none;
        background: transparent;
        border: none;
        margin: 0;
    }

    .legal-sidebar {
        display: none;
    }

    .legal-content-area {
        padding: 2rem 1.5rem;
        border-radius: 0;
    }

    .mobile-toc {
        display: block;
        background: white;
        padding: 1.5rem;
        border: 1px solid var(--border);
        border-radius: 8px;
        margin-bottom: 2rem;
    }

    .hero-text h1 {
        font-size: 2.75rem;
    }
}

@media (min-width: 901px) {
    .mobile-toc {
        display: none;
    }
}

/* 2. Mobile & Small Tablet (< 768px) */
@media (max-width: 768px) {

    /* Header & Nav */
    .mobile-menu-btn {
        display: block !important;
    }

    .nav-links {
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: white;
        flex-direction: column;
        padding: 1.5rem;
        gap: 1.5rem;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);

        /* Animation State */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
    }

    .nav-links.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-links .btn {
        width: 100%;
    }

    /* Hero */
    .hero {
        padding: 4rem 0 3rem;
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 3rem;
    }

    .hero-text h1 {
        font-size: 2.25rem;
    }

    .hero-text p {
        margin-left: auto;
        margin-right: auto;
        font-size: 1.1rem;
    }

    .hero-cta {
        justify-content: center;
        flex-wrap: wrap;
        /* Stack buttons if needed on very small screens */
    }

    /* Grids */
    .card-grid {
        grid-template-columns: 1fr;
        /* Single column on mobile */
    }

    .footer-content {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .footer-col ul {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        padding: 0;
        /* Reset default ul padding if any */
        list-style: none;
        /* Ensure no bullets */
    }

    .phone-mockup {
        width: 260px;
        height: 520px;
    }
}

/* 3. Small Mobile (< 480px) */
@media (max-width: 480px) {
    .hero-text h1 {
        font-size: 2rem;
    }

    .store-btn {
        width: 100%;
        justify-content: center;
    }

    .section-header h2 {
        font-size: 1.75rem;
    }
}