/* =====================================================================
   Trang chủ Hệ thống học tập trực tuyến LOD (/tructuyen/index.php) — 8/10/2026
   Tệp riêng của trang chủ (các trang thi / quản trị vẫn dùng app.css).
   ===================================================================== */
:root {
    --ink: #0f172a;
    --ink-2: #1e293b;
    --muted: #5b6475;
    --line: #e3e8f2;
    --bg: #f4f6fb;
    --card: #ffffff;
    --brand: #1d4ed8;
    --brand-deep: #1e3a8a;
    --brand-soft: #eef3ff;
    --final: #ea580c;
    --final-deep: #c2410c;
    --final-soft: #fff7ed;
    --radius: 16px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 2px 8px rgba(15, 23, 42, .04);
    --shadow-md: 0 10px 28px rgba(30, 58, 138, .12), 0 2px 6px rgba(15, 23, 42, .06);
    --font: "Be Vietnam Pro", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
/* text-size-adjust: iPhone xoay ngang không tự phóng to chữ. */
html { scroll-behavior: smooth; scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body.lms {
    margin: 0;
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: inherit; }
svg { width: 1em; height: 1em; flex: none; }

/* ---------- Thanh trên cùng ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--line);
}
.topbar-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    min-width: 0;
}
.brand-logo { width: 44px; height: 44px; object-fit: contain; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text small {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}
.brand-text strong { font-size: 1.12rem; font-weight: 800; color: var(--brand-deep); letter-spacing: .01em; }
.brand-text strong em { font-style: normal; font-weight: 600; color: var(--ink-2); }

.toplinks { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tl {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    color: #fff;
    font-size: .86rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .14);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.tl b { font-weight: 700; }
.tl .short { display: none; }
@media (hover: hover) {
    /* Chỉ máy có chuột: iPhone / iPad coi lần chạm là "hover" và giữ nguyên hiệu ứng sau khi chạm. */
    .tl:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(15, 23, 42, .2); filter: brightness(1.05); }
}
.tl:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
.tl-jlpt { background: linear-gradient(135deg, #e63946, #c1121f); }
.tl-jft { background: linear-gradient(135deg, #f59e0b, #d97706); }
.tl-irodori { background: linear-gradient(135deg, #0d9488, #0f766e); }
.tl-orient { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
.tl-login { background: linear-gradient(135deg, #1e3a8a, #172554); }
/* Nút "🎁 Đăng ký miễn phí" của khách (28/10/2026 — index.php $dkNut): xanh lá như chữ Free, viền sáng để nổi giữa các nút màu; khách đã đăng nhập →
   nút trắng "👤 Tên · Trang của tôi". Điện thoại: cả 1 hàng dưới 5 nút (khối @media 760px). */
.tl-dk { background: linear-gradient(135deg, #16a34a, #166534); box-shadow: 0 0 0 3px rgba(34, 197, 94, .3), 0 4px 12px rgba(22, 101, 52, .35); }
.tl-kh { background: #fff; color: #166534; border: 2px solid #22c55e; box-shadow: none; }
/* Có nút thứ 6 (Đăng ký / khách): nút Định hướng dùng chữ ngắn như trên điện thoại để thanh đầu trang (dính trên đầu) vẫn 1 dòng trên máy tính */
.toplinks.co-dk .tl-orient .full { display: none; }
.toplinks.co-dk .tl-orient .short { display: inline; }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(900px 380px at 88% -10%, rgba(96, 165, 250, .45), transparent 60%),
        radial-gradient(600px 300px at -5% 110%, rgba(251, 146, 60, .25), transparent 60%),
        linear-gradient(135deg, #0b1f4d 0%, #1a3a9c 55%, #2457d6 100%);
}
.hero::after { /* lưới chấm mờ trang trí */
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0; /* không dùng inset: iPhone iOS < 14.5 chưa hiểu */
    background-image: radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1.2px);
    background-size: 22px 22px;
    mask-image: linear-gradient(90deg, transparent 30%, #000 85%);
    -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 85%);
    pointer-events: none;
}
.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
    padding: 48px 16px 76px;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 36px;
    align-items: center;
}
.hero-eyebrow {
    display: inline-block;
    margin: 0 0 12px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .22);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.hero h1 {
    margin: 0 0 12px;
    font-size: clamp(1.75rem, 4.2vw, 2.7rem);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -.01em;
}
.hero-lead { margin: 0 0 24px; max-width: 600px; font-size: 1.02rem; color: rgba(255, 255, 255, .88); }
.hero-lead b { color: #fff; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: #fff; color: var(--brand-deep); box-shadow: 0 8px 20px rgba(2, 6, 23, .25); }
.btn-ghost { color: #fff; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .35); }
@media (hover: hover) {
    .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(2, 6, 23, .3); }
    .btn-ghost:hover { background: rgba(255, 255, 255, .18); }
}
.btn:active, .tl:active, .tile:active, .chip:active, .htab:active { transform: scale(.98); } /* phản hồi khi chạm trên điện thoại */
.btn:focus-visible { outline: 3px solid #fde68a; outline-offset: 2px; }

.hero-stats {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.hero-stats div {
    padding: 16px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .18);
    backdrop-filter: blur(4px);
}
.hero-stats dt { font-size: .78rem; font-weight: 600; color: rgba(255, 255, 255, .78); }
.hero-stats dd { margin: 2px 0 0; font-size: 1.9rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }

/* ---------- Nội dung ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 0 16px 48px; }

.steps {
    list-style: none;
    margin: -40px 0 28px;
    padding: 0;
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.steps li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    font-size: .85rem;
    color: var(--muted);
}
.steps b { display: block; color: var(--ink); font-size: .95rem; margin-bottom: 2px; }
.steps small { display: block; font-size: inherit; }
.step-ic {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: 12px;
    background: var(--brand-soft);
    color: var(--brand);
}
.step-ic svg { width: 22px; height: 22px; }

.board-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px 24px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.board-head h2 { margin: 0; font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; }
.board-head p { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 1 340px;
    min-width: 0;
}
.search svg { position: absolute; left: 14px; width: 18px; height: 18px; color: #94a3b8; pointer-events: none; }
.search input {
    width: 100%;
    padding: 11px 14px 11px 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
    font: inherit;
    font-size: 16px; /* >= 16px: Safari iPhone KHÔNG tự phóng to trang khi chạm vào ô */
    color: var(--ink);
    box-shadow: var(--shadow-sm);
    -webkit-appearance: none;
    appearance: none;
}
.search input::-webkit-search-decoration { -webkit-appearance: none; }
.search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(37, 99, 235, .15); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink-2);
    font: inherit;
    font-size: .86rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.chip small {
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #eef2f8;
    color: var(--muted);
    font-size: .74rem;
    text-align: center;
}
@media (hover: hover) { .chip:hover { border-color: #b8c6e6; } }
.chip.is-active { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }
.chip.is-active small { background: rgba(255, 255, 255, .2); color: #fff; }
.chip:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }

.group {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    padding: 20px 20px 8px;
    margin-bottom: 20px;
    scroll-margin-top: 90px;
}
.group-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.group-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 800;
}
.group-head h3 { margin: 0; font-size: 1.3rem; font-weight: 800; letter-spacing: .02em; color: var(--brand-deep); }
.group-head p { margin: 0; color: var(--muted); font-size: .85rem; }

.part { margin-bottom: 14px; }
.part-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin: 4px 0 10px;
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--brand);
}
.part-title svg { width: 16px; height: 16px; }
.part-title small {
    font-size: .78rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: var(--muted);
}
.part.is-final .part-title { color: var(--final-deep); }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: 12px;
}
.tile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 14px 14px 14px 14px;
    border-radius: 14px;
    border: 1px solid #e1e7f5;
    background: linear-gradient(180deg, #fbfcff, #f6f8fe);
    text-decoration: none;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
@media (hover: hover) {
    .tile:hover {
        transform: translateY(-2px);
        border-color: #9db4ee;
        background: #fff;
        box-shadow: var(--shadow-md);
    }
    .tile:hover .tile-go { transform: translateX(2px); background: var(--brand); color: #fff; }
    .part.is-final .tile:hover { border-color: #f6ad78; background: #fff; box-shadow: 0 10px 28px rgba(194, 65, 12, .14); }
    .part.is-final .tile:hover .tile-go { background: var(--final); color: #fff; }
}
.tile:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
.tile-num {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex: none;
    border-radius: 13px;
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: #fff;
    font-size: 1.2rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 6px 14px rgba(30, 64, 175, .28);
}
.tile-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.tile-title { font-weight: 700; font-size: .96rem; line-height: 1.3; color: var(--ink); }
.tile-desc {
    font-size: .8rem;
    line-height: 1.4;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tile-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; font-size: .76rem; font-weight: 600; color: #475569; }
.tile-meta span { display: inline-flex; align-items: center; gap: 4px; }
.tile-meta svg { width: 14px; height: 14px; color: var(--brand); }
.tile-go {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 50%;
    color: var(--brand);
    background: var(--brand-soft);
    transition: transform .16s ease, background .16s ease, color .16s ease;
}
.tile-go svg { width: 16px; height: 16px; }

.part.is-final .tile { border-color: #fbd9bd; background: linear-gradient(180deg, #fffaf5, #fff4ea); }
.part.is-final .tile-num { background: linear-gradient(135deg, #fb923c, #c2410c); box-shadow: 0 6px 14px rgba(194, 65, 12, .3); }
.part.is-final .tile-meta svg { color: var(--final); }
.part.is-final .tile-go { color: var(--final-deep); background: #ffedd5; }

.empty {
    margin: 8px 0 20px;
    padding: 28px 16px;
    text-align: center;
    color: var(--muted);
    background: var(--card);
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius);
}

/* ---------- Bảng vinh danh toàn hệ thống (data/honor_board.php) ---------- */
.src-center { background: #1e3a8a; }
.src-jft { background: #d97706; }
.src-jlpt { background: #c1121f; }
.honor {
    margin: 0 0 28px;
    background: var(--card);
    border: 1px solid #f1dfa3;
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    scroll-margin-top: 90px;
}
.honor-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #fffaeb 0%, #fff1c2 60%, #fde68a 100%);
    border-bottom: 1px solid #f1dfa3;
}
.honor-ic {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: none;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(180, 120, 0, .18);
    font-size: 1.5rem;
    line-height: 1;
}
.honor-head h2 { margin: 0; font-size: 1.25rem; font-weight: 800; color: #7c2d12; letter-spacing: -.01em; }
.honor-head p { margin: 2px 0 0; font-size: .84rem; color: #92400e; }
.honor-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px 6px; }
.htab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink-2);
    font: inherit;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.htab.is-active { background: #7c2d12; border-color: #7c2d12; color: #fff; }
.htab:focus-visible { outline: 3px solid #fcd34d; outline-offset: 2px; }
.src-dot { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }
.honor-panel { padding: 8px 12px 14px; }
.honor-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(5, auto);
    grid-auto-flow: column; /* máy tính: cột trái hạng 1–5, cột phải hạng 6–10 */
    gap: 4px 16px;
}
.honor-list.is-short { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; }
.honor-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 9px 10px;
    border-radius: 14px;
    border: 1px solid transparent;
}
.honor-row + .honor-row { border-top-color: #f1f4f9; }
.honor-row.is-first { background: linear-gradient(90deg, #fffbeb, #fff); border-color: #fde68a; }
.h-rank { width: 30px; flex: none; text-align: center; font-weight: 800; font-size: 1rem; color: #94a3b8; font-variant-numeric: tabular-nums; }
.honor-row:nth-child(-n+3) .h-rank { font-size: 1.45rem; line-height: 1; }
.h-ava {
    position: relative;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex: none;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    box-shadow: 0 0 0 2px #fff, 0 2px 8px rgba(15, 23, 42, .14);
}
.honor-row.is-first .h-ava { box-shadow: 0 0 0 2px #f59e0b, 0 3px 10px rgba(245, 158, 11, .35); }
.h-ini { font-weight: 800; font-size: .92rem; color: var(--brand-deep); }
.h-ava img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.h-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.h-name { font-weight: 700; font-size: .97rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; font-size: .76rem; color: var(--muted); }
.h-src { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; color: #fff; font-size: .7rem; font-weight: 700; line-height: 1.5; }
.h-class { font-weight: 600; color: #334155; }
.h-exam { font-size: .76rem; color: #475569; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-score { flex: none; text-align: right; line-height: 1.15; }
.h-score b { display: block; font-size: 1.15rem; font-weight: 800; color: #15803d; font-variant-numeric: tabular-nums; }
.h-score small { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.honor-empty { margin: 6px 8px 4px; padding: 16px; text-align: center; color: var(--muted); font-size: .9rem; background: #fafafa; border-radius: 12px; }
.honor-more {
    display: none;
    margin: 8px auto 2px;
    padding: 8px 18px;
    border-radius: 999px;
    border: 1px solid #f1dfa3;
    background: #fffbeb;
    color: #92400e;
    font: inherit;
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
@media (max-width: 900px) {
    /* máy tính bảng / điện thoại: 1 cột, hiện 5 em đầu + nút "Xem thêm" */
    .honor-list { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; }
    .honor-list:not(.show-all) .is-extra { display: none; }
    .honor-more { display: block; }
}
@media (max-width: 760px) {
    .honor { border-radius: 16px; margin-bottom: 22px; }
    .honor-head { padding: 12px 14px; gap: 10px; }
    .honor-ic { width: 38px; height: 38px; border-radius: 11px; font-size: 1.2rem; }
    .honor-head h2 { font-size: 1.05rem; }
    .honor-head p { font-size: .76rem; }
    .honor-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 10px 10px 4px; gap: 5px; }
    .htab { justify-content: center; padding: 7px 3px; font-size: .76rem; gap: 4px; white-space: nowrap; }
    .src-dot { width: 7px; height: 7px; }
    .honor-panel { padding: 6px 6px 12px; }
    .honor-row { gap: 9px; padding: 8px 6px; }
    .h-rank { width: 24px; font-size: .9rem; }
    .honor-row:nth-child(-n+3) .h-rank { font-size: 1.2rem; }
    .h-ava { width: 42px; height: 42px; }
    .h-name { font-size: .92rem; }
    .h-meta, .h-exam { font-size: .72rem; }
    .h-score b { font-size: 1rem; }
    .h-score small { font-size: .68rem; }
}

/* ---------- Chân trang ---------- */
.footer { background: #0b1736; color: rgba(255, 255, 255, .78); }
.footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 26px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 28px;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand img { background: #fff; border-radius: 10px; padding: 3px; }
.footer-brand span { display: flex; flex-direction: column; line-height: 1.25; }
.footer-brand b { color: #fff; font-size: .9rem; }
.footer-brand small { font-size: .78rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .86rem; }
.footer-links a { text-decoration: none; color: rgba(255, 255, 255, .82); }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-copy { width: 100%; margin: 4px 0 0; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .8rem; }

/* ---------- Máy tính bảng / điện thoại ---------- */
@media (max-width: 960px) {
    .hero-inner { grid-template-columns: 1fr; gap: 24px; padding: 36px 16px 68px; }
    .hero-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    /* Điện thoại: thu gọn phần đầu để danh sách bài lên gần màn hình đầu tiên. */
    .topbar { position: static; }
    .topbar-inner { padding: 8px 16px 10px; gap: 8px; }
    .brand-logo { width: 38px; height: 38px; }
    .toplinks { width: 100%; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; align-items: stretch; }
    .tl { flex-direction: column; justify-content: center; gap: 1px; padding: 6px 2px; border-radius: 11px; font-size: .68rem; white-space: normal; text-align: center; line-height: 1.15; }
    .tl span { font-size: 1rem; }
    .tl .full { display: none; }
    .tl .short { display: inline; }
    .tl-dk, .tl-kh { grid-column: 1 / -1; flex-direction: row; gap: 6px; padding: 9px 10px; font-size: .92rem; }
    .tl-dk span, .tl-kh span { font-size: 1.05rem; }
    .hero-inner { gap: 16px; padding: 22px 16px 54px; }
    .hero-eyebrow { margin-bottom: 8px; font-size: .66rem; padding: 4px 10px; }
    .hero h1 { margin-bottom: 8px; font-size: 1.6rem; }
    .hero-lead { margin-bottom: 16px; font-size: .9rem; }
    .hero-cta { gap: 8px; }
    .btn { flex: 1 1 0; justify-content: center; padding: 11px 10px; font-size: .88rem; border-radius: 11px; white-space: nowrap; }
    .btn .d-only { display: none; }
    .hero-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
    .hero-stats div { padding: 8px 6px; border-radius: 10px; text-align: center; }
    .hero-stats dt { font-size: .62rem; line-height: 1.2; }
    .hero-stats dd { font-size: 1.2rem; }
    .steps { margin: -34px 0 22px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
    .steps li { flex-direction: column; text-align: center; gap: 6px; padding: 10px 6px; font-size: .74rem; border-radius: 12px; }
    .steps b { font-size: .74rem; line-height: 1.25; margin: 0; }
    .steps small { display: none; }
    .step-ic { width: 34px; height: 34px; border-radius: 10px; }
    .step-ic svg { width: 18px; height: 18px; }
    .search { flex: 1 1 100%; }
    .group { padding: 16px 12px 4px; border-radius: 16px; }
    .group-head h3 { font-size: 1.15rem; }
    .grid { grid-template-columns: 1fr; gap: 10px; }
    .tile { padding: 12px; gap: 12px; }
    .tile-num { width: 44px; height: 44px; font-size: 1.1rem; }
    .tile-desc { -webkit-line-clamp: 2; }
}
@media (max-width: 380px) {
    .brand-text small { font-size: .6rem; }
    .brand-text strong { font-size: 1rem; }
    .tl { font-size: .66rem; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Học thử miễn phí (22/10/2026 — data/hoc_thu.php): mục Free của các web LOD + lời mời đăng ký học ---------- */
.free-hub {
    position: relative;
    z-index: 2;
    margin: -40px 0 22px;
    padding: 18px 20px;
    background: var(--card);
    border: 2px solid #32d583;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}
.free-hub + .steps { margin-top: 0; }
.free-hub-head { display: flex; gap: 14px; align-items: flex-start; }
.free-hub-head h2 { margin: 0 0 4px; font-size: 1.15rem; color: #054f31; }
.free-hub-head p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.55; }
/* Hướng dẫn ngắn cho 2 nhóm + nhãn bước "1 Chọn môn" (trên thẻ) / "2 Bấm số" (đầu khung) ngay chỗ bấm (24/10/2026 — người dùng: "trên điện thoại nó hơi bé,
   bấm khó và hướng dẫn chưa dễ hiểu … khó biết chọn các tab") */
.fh-ai { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 4px; color: #344054; font-size: .92rem; line-height: 1.5; }
.fh-ai li { display: flex; gap: 8px; align-items: flex-start; }
.fh-ai b { color: #054f31; }
.free-hub-head p.fh-da-co { margin-top: 6px; font-size: .88rem; }
/* Nút lớn "🎁 Đăng ký miễn phí" ngay dưới 2 dòng hướng dẫn (28/10/2026 — thay dòng chữ "Đã đăng ký rồi? Đăng nhập" khi máy này đăng ký được) */
.free-hub-head p.fh-dk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; color: #344054; font-size: .88rem; }
.fh-dk-nut {
    display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 22px; border-radius: 12px;
    background: linear-gradient(135deg, #16a34a, #166534); color: #fff; font-size: 1rem; font-weight: 800; text-decoration: none;
    box-shadow: 0 6px 16px rgba(22, 101, 52, .3);
}
.free-hub-head p.fh-dk a.fh-dk-nut { color: #fff; text-decoration: none; }
@media (hover: hover) { .fh-dk-nut:hover { filter: brightness(1.08); } }
.fh-dk-nut:focus-visible { outline: 3px solid #86efac; outline-offset: 2px; }
@media (max-width: 760px) { .fh-dk-nut { width: 100%; } }
.fh-buoc { display: flex; align-items: center; gap: 8px; margin: 14px 0 8px; color: #054f31; font-size: .95rem; line-height: 1.4; }
.fh-buoc .fh-so { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #067647; color: #fff; font-weight: 800; font-size: .85rem; }
.free-hub-group .fh-buoc { margin: 0 0 10px; }
.fh-buoc + .fh-tabs { margin-top: 0; }
.free-pill {
    flex: none;
    padding: 4px 12px;
    border-radius: 999px;
    background: #12b76a;
    color: #fff;
    font-weight: 800;
    font-size: .85rem;
    letter-spacing: .02em;
}
/* Mỗi hệ thống 1 THẺ, mỗi lần hiện 1 khung (22/10/2026 08:4x — người dùng: "ngắn hơn nhưng cho cuộn để xem"): khung chiếm cả bề ngang, các dòng xếp lưới */
.free-hub-groups { margin-top: 0; }
.free-hub-group { padding: 12px 14px; border: 1px solid #a6f4c5; border-radius: 12px; background: #f6fef9; }
.free-hub-group ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; }
.free-hub-group li a {
    display: block;
    padding: 8px 10px;
    border: 1px solid #d1fadf;
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    text-decoration: none;
}
.free-hub-group li b { display: block; font-size: .9rem; }
.free-hub-group li small { display: block; color: var(--muted); font-size: .78rem; margin-top: 2px; }
@media (hover: hover) { .free-hub-group li a:hover { border-color: #12b76a; box-shadow: 0 4px 12px rgba(6, 118, 71, .12); } }
/* Mỗi phần 1 dòng: tên phần + số câu / phút + các nút "số 1", "Bài 2"… (22/10/2026 — Free 5 mục đầu mỗi phần, data/hoc_thu.php ht_nhom_muc) */
.free-hub-group li.free-hub-row { padding: 8px 10px; border: 1px solid #d1fadf; border-radius: 10px; background: #fff; }
.free-hub-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 7px; }
.free-hub-tien-to { margin-right: 2px; color: #067647; font-size: .82rem; font-weight: 600; }
.free-hub-group .free-hub-chips a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    min-height: 32px;
    padding: 3px 9px;
    border: 1px solid #a6f4c5;
    border-radius: 999px;
    background: #ecfdf3;
    color: #054f31;
    font-weight: 700;
    font-size: .85rem;
    white-space: nowrap;
}
@media (hover: hover) { .free-hub-group .free-hub-chips a:hover { border-color: #12b76a; background: #d1fadf; box-shadow: none; } }
/* Thẻ chọn hệ thống + khung cao cố định cuộn bên trong (index.php, JS cuối trang). Thanh cuộn tự ẩn trên Mac / điện thoại → mép dưới mờ dần
   + nút "xem thêm" báo còn dòng bên dưới; khung chỉ dư dưới 90px thì JS giãn cho vừa (không bắt cuộn vì 1–2 dòng). */
.fh-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; }
.fh-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border: 1px solid #a6f4c5;
    border-radius: 999px;
    background: #fff;
    color: #054f31;
    font: inherit;
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.fh-tab b { font-weight: 700; }
.fh-tab .fh-short { display: none; }
.fh-tab small { min-width: 24px; padding: 1px 7px; border-radius: 999px; background: #ecfdf3; color: #067647; font-size: .76rem; font-weight: 800; text-align: center; }
.fh-tab.is-active { background: #067647; border-color: #067647; color: #fff; }
.fh-tab.is-active::before { content: "✓"; font-weight: 800; }
.fh-tab.is-active small { background: rgba(255, 255, 255, .22); color: #fff; }
.fh-tab:focus-visible { outline: 3px solid #fcd34d; outline-offset: 2px; }
@media (hover: hover) { .fh-tab:not(.is-active):hover { border-color: #12b76a; background: #f6fef9; } }
.fh-khung { position: relative; }
.fh-khung::after {
    content: "";
    position: absolute;
    left: 0;
    right: 10px;
    bottom: 0;
    height: 48px;
    background: linear-gradient(rgba(246, 254, 249, 0), #f6fef9 85%);
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
}
.fh-khung.co-them::after { opacity: 1; }
.fh-cuon {
    max-height: 440px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: #75e0a7 transparent;
}
.fh-cuon::-webkit-scrollbar { width: 8px; }
.fh-cuon::-webkit-scrollbar-thumb { background: #a6f4c5; border-radius: 8px; }
.fh-cuon:focus-visible { outline: 3px solid #a6f4c5; outline-offset: 2px; border-radius: 10px; }
.fh-chan { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin-top: 10px; font-size: .85rem; }
.fh-them {
    padding: 5px 12px;
    border: 1px dashed #12b76a;
    border-radius: 999px;
    background: #ecfdf3;
    color: #067647;
    font: inherit;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
}
.fh-them[hidden] { display: none; }
.fh-mo { margin-left: auto; color: #067647; font-weight: 700; text-decoration: none; }
@media (hover: hover) { .fh-mo:hover { text-decoration: underline; } }
.free-hub-cta { display: grid; gap: 4px; margin: 14px 0 0; padding-top: 12px; border-top: 1px dashed #a6f4c5; font-size: .9rem; line-height: 1.55; color: #054f31; }
.free-hub-btn {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 3px 12px;
    border-radius: 999px;
    background: #12b76a;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
/* Liên hệ đăng ký học lấy từ Kênh liên hệ (22/10/2026 — data/hoc_thu.php ht_lien_he_html): mỗi kênh 1 cụm số + ghi chú + nút, xuống dòng gọn trên điện thoại */
.free-hub-nhom { display: inline; }
.free-hub-kenh { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin: 2px 10px 2px 0; }
.free-hub-kenh small, .free-hub-nhom > small { margin-left: 4px; color: #067647; }
.free-hub-link { color: #067647; font-weight: 700; }
@media (max-width: 760px) {
    .free-hub { margin-top: -24px; padding: 12px; }
    .free-hub-head { flex-direction: column; gap: 8px; }
    .fh-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .fh-tab { justify-content: center; min-height: 48px; padding: 8px 6px; font-size: .95rem; gap: 5px; }
    .fh-tab .fh-full { display: none; }
    .fh-tab .fh-short { display: inline; }
    .fh-tab b { white-space: nowrap; }
    .fh-tab.is-active > span[aria-hidden="true"]:first-child { display: none; }   /* dấu ✓ thay biểu tượng ở thẻ đang chọn → đủ chỗ cho tên môn */
    .free-hub-group { padding: 10px; }
    .fh-cuon { max-height: min(62vh, 520px); }
    /* Nút số đủ to để bấm bằng ngón tay (≥ 44px như hướng dẫn của Apple / Google), xếp lưới cả bề ngang dòng: 5 nút / dòng ở máy 360–430px. Chữ "số" /
       "Bài" trước các nút ẩn đi (nhãn "2 Bấm số đề / bài" đầu khung đã nói); nút "Làm thử" đứng 1 mình thì kéo cả dòng. */
    .free-hub-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 8px; margin-top: 9px; }
    .free-hub-tien-to { display: none; }
    .free-hub-group .free-hub-chips a { min-width: 0; min-height: 44px; padding: 4px 6px; font-size: 1.02rem; }
    .free-hub-group .free-hub-chips a:only-of-type { grid-column: 1 / -1; }
    .fh-them { min-height: 40px; }
    .fh-mo { padding: 8px 0; }
}
/* ---------- Khách bấm từ quảng cáo TikTok (28/10/2026 — index.php $ttDau): phần đầu trang = "Thi thử JFT-Basic miễn phí" + nút lớn vào đề ngắn ---------- */
.hero-tiktok .hero-inner { grid-template-columns: minmax(0, 1fr); }
.hero-tiktok .hero-text { max-width: 640px; }
.tt-cta { flex-direction: column; align-items: stretch; max-width: 460px; }
.tt-cta .btn { flex: none; white-space: normal; }
.tt-nut { justify-content: space-between; gap: 12px; min-height: 64px; padding: 12px 18px; font-size: 1.12rem; text-align: left; }
.tt-nut span { display: flex; flex-direction: column; gap: 2px; }
.tt-nut small { font-size: .8rem; font-weight: 600; line-height: 1.35; color: var(--muted); }
.tt-nut svg { width: 24px; height: 24px; }
.tt-nut-phu { justify-content: center; }
.tt-ghi { margin: 14px 0 0; max-width: 460px; font-size: .88rem; line-height: 1.5; color: rgba(255, 255, 255, .85); }
.tt-ghi b { color: #fff; }
.tt-ghi a, .tt-xem { color: #fff; font-weight: 700; }
.tt-xem { display: inline-block; margin-top: 8px; padding: 6px 0; font-size: .9rem; }
/* "Xem tất cả đề, bài miễn phí ↓" trên máy tính: khu Học thử không chui dưới thanh đầu trang (chỉ dính trên cùng khi > 760px) */
@media (min-width: 761px) { #hoc-thu-ds { scroll-margin-top: 90px; } }
@media (max-width: 760px) {
    .tt-nut { min-height: 60px; padding: 12px 14px; font-size: 1.06rem; }
    .tt-nut-phu { padding: 11px 10px; }
}
