/* HỌC NỐT — design system "Aurora" (sáng/tối, hiệu ứng nhẹ) */
:root {
  --bg: #f5f6fb;
  --bg-soft: #eef0fa;
  --surface: #ffffff;
  --surface-2: #f8f9fe;
  --ink: #12142b;
  --ink-2: #3a3f5c;
  --muted: #6b7090;
  --line: #e4e7f4;
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-ink: #3730a3;
  --brand-soft: #eceafd;
  --pink: #ec4899;
  --teal: #14b8a6;
  --ok: #16a34a;
  --ok-soft: #dcfce7;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --orange: #d9622b;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(18,20,43,.05), 0 4px 14px rgba(18,20,43,.05);
  --shadow: 0 10px 30px rgba(55,48,163,.10), 0 2px 6px rgba(18,20,43,.05);
  --shadow-lg: 0 24px 60px rgba(55,48,163,.18);
  --grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #ec4899 120%);
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d0f1f;
  --bg-soft: #14172c;
  --surface: #161a33;
  --surface-2: #1b2040;
  --ink: #eceefc;
  --ink-2: #c4c9e6;
  --muted: #8f95bb;
  --line: #262b4f;
  --brand: #8b83ff;
  --brand-2: #a78bfa;
  --brand-ink: #c7c2ff;
  --brand-soft: #232859;
  --ok-soft: #12351f;
  --warn-soft: #3a2c0b;
  --danger-soft: #3d1414;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.25);
  --shadow: 0 10px 30px rgba(0,0,0,.4);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.55);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f1f; --bg-soft: #14172c; --surface: #161a33; --surface-2: #1b2040;
    --ink: #eceefc; --ink-2: #c4c9e6; --muted: #8f95bb; --line: #262b4f;
    --brand: #8b83ff; --brand-2: #a78bfa; --brand-ink: #c7c2ff; --brand-soft: #232859;
    --ok-soft: #12351f; --warn-soft: #3a2c0b; --danger-soft: #3d1414;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.25);
    --shadow: 0 10px 30px rgba(0,0,0,.4); --shadow-lg: 0 24px 60px rgba(0,0,0,.55);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  line-height: 1.6; min-height: 100vh; font-size: 15.5px;
  background-image:
    radial-gradient(900px 500px at 8% -8%, rgba(124,58,237,.10), transparent 60%),
    radial-gradient(800px 480px at 100% 0%, rgba(79,70,229,.10), transparent 55%);
  background-repeat: no-repeat;
  animation: pageIn .45s ease both;
}
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
a { color: var(--brand); text-decoration: none; transition: color .15s; }
a:hover { color: var(--brand-2); }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { line-height: 1.22; letter-spacing: -.015em; margin: 0 0 .5rem; font-weight: 750; }
h1 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); font-weight: 800; }
h2 { font-size: clamp(1.25rem, 2.2vw, 1.55rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .8rem; }
code { background: var(--brand-soft); color: var(--brand-ink); padding: .12rem .4rem; border-radius: 6px; font-size: .88em; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 2px; border-radius: 8px; }
::selection { background: color-mix(in srgb, var(--brand) 28%, transparent); }
.ico { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -.18em; }

.wrap { width: min(1160px, calc(100% - 2rem)); margin-inline: auto; }
.main { padding: 1.5rem 0 4rem; min-height: 62vh; }
.narrow { width: min(680px, 100%); margin-inline: auto; }
.muted { color: var(--muted); }
.tiny { font-size: .82rem; }
.mt { margin-top: 1.5rem; } .mb { margin-bottom: 1rem; } .mb-0 { margin-bottom: 0; }
.row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: .8rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.hide-sm { }
.text-center { text-align: center; }
.empty { color: var(--muted); text-align: center; padding: 2.4rem 1rem; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.kicker, .eyebrow { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); background: var(--brand-soft); padding: .28rem .7rem; border-radius: 999px; margin-bottom: .8rem; }
.lead { font-size: 1.08rem; color: var(--ink-2); max-width: 62ch; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.list { padding-left: 1.2rem; } .list li { margin: .3rem 0; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 60; background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); border-bottom: 1px solid var(--line); transition: box-shadow .2s; }
.site-header.is-scrolled { box-shadow: 0 6px 24px rgba(18,20,43,.08); }
.header-inner { display: flex; align-items: center; gap: 1rem; padding: .65rem 0; }
.logo { display: inline-flex; align-items: center; gap: .6rem; font-weight: 800; color: var(--ink) !important; letter-spacing: -.02em; }
.logo-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--grad); color: #fff; font-size: .8rem; font-weight: 800; box-shadow: 0 6px 16px rgba(79,70,229,.35); transition: transform .25s; }
.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.06); }
.nav-links { display: flex; align-items: center; gap: .2rem; margin-left: 1rem; flex: 1; }
.nav-link { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .8rem; border-radius: 999px; color: var(--ink-2); font-weight: 600; font-size: .92rem; transition: background .15s, color .15s; }
.nav-link:hover { background: var(--brand-soft); color: var(--brand-ink); }
.nav-link.is-active { background: var(--brand-soft); color: var(--brand-ink); }
.nav-premium .ico { color: #f59e0b; }
.header-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); cursor: pointer; transition: transform .15s, background .15s, border-color .15s; }
.icon-btn:hover { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); transform: translateY(-1px); }
.icon-btn .ico { width: 1.2rem; height: 1.2rem; }
.ico-sun { display: none; } :root[data-theme="dark"] .ico-sun { display: inline; } :root[data-theme="dark"] .ico-moon { display: none; }
.dot-badge { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .68rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--surface); animation: pop .4s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
.nav-toggle { display: none; }
.user-menu { position: relative; }
.avatar-btn { border: 0; background: none; padding: 0; cursor: pointer; }
.avatar-circle { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 800; box-shadow: 0 4px 12px rgba(79,70,229,.3); }
.avatar-circle.is-premium { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px #f59e0b; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 10px); width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: .4rem; z-index: 70; animation: menuIn .16s ease both; }
.menu-pop[hidden] { display: none; }
@keyframes menuIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.menu-head { display: flex; flex-direction: column; gap: .15rem; padding: .7rem .8rem .8rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .6rem .8rem; border-radius: 10px; color: var(--ink-2); background: none; border: 0; font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; text-align: left; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--brand-soft); color: var(--brand-ink); }

/* ---------- Buttons / forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .62rem 1.15rem; border-radius: 12px; border: 1px solid transparent; background: var(--grad); color: #fff !important; font: inherit; font-weight: 700; font-size: .93rem; cursor: pointer; box-shadow: 0 6px 16px rgba(79,70,229,.28); transition: transform .15s, box-shadow .2s, filter .2s; line-height: 1.2; text-decoration: none; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(79,70,229,.34); filter: brightness(1.05); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; }
.btn-ghost { background: var(--surface); color: var(--ink) !important; border-color: var(--line); box-shadow: none; }
.btn-ghost:hover { background: var(--brand-soft); border-color: transparent; box-shadow: none; color: var(--brand-ink) !important; }
.btn-danger { background: var(--danger); box-shadow: 0 6px 16px rgba(220,38,38,.25); }
.btn-ok { background: linear-gradient(135deg, #16a34a, #22c55e); box-shadow: 0 6px 16px rgba(22,163,74,.28); }
.btn-warn { background: linear-gradient(135deg, #f59e0b, #f97316); box-shadow: 0 6px 16px rgba(245,158,11,.3); }
.btn-sm { padding: .4rem .8rem; font-size: .84rem; border-radius: 10px; }
.btn-lg { padding: .85rem 1.6rem; font-size: 1.02rem; border-radius: 14px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--brand); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.inline-form { display: inline; margin: 0; }
label { display: block; font-weight: 600; font-size: .9rem; color: var(--ink-2); }
input, select, textarea { width: 100%; margin-top: .35rem; padding: .7rem .9rem; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
input[type=checkbox], input[type=radio] { width: auto; margin: 0; accent-color: var(--brand); }
textarea { min-height: 110px; resize: vertical; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.error { color: var(--danger); font-size: .84rem; font-weight: 600; }
.search { display: flex; gap: .6rem; flex-wrap: wrap; margin: 1rem 0 1.5rem; }
.search input, .search select { margin: 0; flex: 1 1 200px; width: auto; }
.search-box { position: relative; flex: 1 1 260px; }
.search-box .ico { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-box input { padding-left: 2.5rem; margin: 0; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }

/* ---------- Cards ---------- */
.card, .panel, .card-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-sm); }
a.card { display: flex; flex-direction: column; gap: .3rem; color: var(--ink); transition: transform .2s, box-shadow .25s, border-color .2s; }
a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); color: var(--ink); }
.card-form { display: flex; flex-direction: column; gap: .9rem; }
.soft-card { background: var(--surface-2); box-shadow: none; }
.success-card { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .6rem; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-size: .74rem; font-weight: 700; }
.badge-ok { background: var(--ok-soft); color: var(--ok); } .badge-warn { background: var(--warn-soft); color: var(--warn); } .badge-bad { background: var(--danger-soft); color: var(--danger); }
.badge-premium { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #5b3a00; }
.badge-drive { background: var(--ok-soft); color: var(--ok); }
.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .75rem; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .82rem; font-weight: 600; color: var(--ink-2); }
.crumbs { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; font-size: .88rem; color: var(--muted); margin-bottom: 1rem; }
.crumbs a { color: var(--muted); font-weight: 600; } .crumbs a:hover { color: var(--brand); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-hero { margin-bottom: 1.5rem; }

/* flash toast */
.flash { position: relative; display: flex; align-items: center; gap: .6rem; padding: .85rem 2.6rem .85rem 1.1rem; border-radius: 14px; margin-bottom: 1.2rem; font-weight: 600; border: 1px solid transparent; animation: slideDown .35s ease both; }
.flash-success { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.flash-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.flash-info { background: var(--brand-soft); color: var(--brand-ink); }
.flash-x { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); background: none; border: 0; font-size: 1.3rem; cursor: pointer; color: inherit; opacity: .6; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); padding: .75rem 1rem; white-space: nowrap; }
.table td { padding: .8rem 1rem; border-top: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .12s; } .table tbody tr:hover { background: var(--surface-2); }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- Hero (home) ---------- */
.hero-modern { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 2.5rem; align-items: center; padding: 3.2rem 0 2.5rem; }
.hero-modern h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.08; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }
.hero-meta { display: flex; gap: 1.6rem; flex-wrap: wrap; margin-top: 2rem; }
.hero-meta strong { display: block; font-size: 1.6rem; font-weight: 800; }
.hero-meta span { color: var(--muted); font-size: .85rem; }
.hero-art { position: relative; min-height: 360px; }
.blob { position: absolute; border-radius: 50%; filter: blur(50px); opacity: .55; animation: float 9s ease-in-out infinite; }
.blob.b1 { width: 260px; height: 260px; background: #7c3aed; top: 0; right: 10%; }
.blob.b2 { width: 220px; height: 220px; background: #ec4899; bottom: 0; left: 5%; animation-delay: -3s; }
.blob.b3 { width: 180px; height: 180px; background: #14b8a6; top: 40%; right: -4%; animation-delay: -6s; }
@keyframes float { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(14px,-18px) scale(1.06); } 66% { transform: translate(-12px,10px) scale(.96); } }
.float-card { position: absolute; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 18px; padding: 1rem 1.2rem; box-shadow: var(--shadow-lg); animation: bob 6s ease-in-out infinite; }
.float-card strong { display: block; } .float-card small { color: var(--muted); }
.float-card.f1 { top: 6%; left: 4%; } .float-card.f2 { top: 38%; right: 0; animation-delay: -2s; } .float-card.f3 { bottom: 4%; left: 14%; animation-delay: -4s; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.fc-ico { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--grad); color: #fff; margin-bottom: .5rem; }
.section-title { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: 2.8rem 0 1.1rem; flex-wrap: wrap; }
.section-title h2 { margin: 0; }
.feature-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; }
.feature-card { position: relative; overflow: hidden; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 1.5rem; color: var(--ink); box-shadow: var(--shadow-sm); transition: transform .25s, box-shadow .3s; }
.feature-card::after { content: ""; position: absolute; inset: auto -30% -60% auto; width: 180px; height: 180px; background: var(--grad); opacity: .08; border-radius: 50%; transition: transform .4s, opacity .3s; }
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); color: var(--ink); }
.feature-card:hover::after { transform: scale(1.6); opacity: .14; }
.f-ico { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); margin-bottom: .9rem; }
.f-ico .ico { width: 1.5rem; height: 1.5rem; }
.feature-card h3 { margin-bottom: .3rem; } .feature-card p { color: var(--muted); font-size: .92rem; margin: 0; }
.cta-band { position: relative; overflow: hidden; border-radius: 26px; background: var(--grad); color: #fff; padding: 2.6rem 2rem; text-align: center; margin-top: 3rem; box-shadow: var(--shadow-lg); }
.cta-band::before, .cta-band::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.12); }
.cta-band::before { width: 260px; height: 260px; top: -90px; left: -60px; } .cta-band::after { width: 200px; height: 200px; bottom: -80px; right: -40px; }
.cta-band h2 { color: #fff; position: relative; } .cta-band p, .cta-band .btn { position: relative; }
.cta-band .btn { background: #fff; color: var(--brand-ink) !important; box-shadow: 0 10px 26px rgba(0,0,0,.2); }

/* ---------- Subject hub cards ---------- */
.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.subject-card { --h: 250; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: .5rem; min-height: 168px; padding: 1.25rem; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow-sm); transition: transform .25s, box-shadow .3s, border-color .2s; }
.subject-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, hsl(var(--h) 80% 60%), hsl(calc(var(--h) + 40) 85% 62%)); }
.subject-card::after { content: ""; position: absolute; width: 150px; height: 150px; right: -50px; bottom: -60px; border-radius: 50%; background: hsl(var(--h) 80% 60% / .14); transition: transform .4s; }
.subject-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: hsl(var(--h) 70% 62% / .6); color: var(--ink); }
.subject-card:hover::after { transform: scale(1.7); }
.subject-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: hsl(var(--h) 80% 60% / .16); color: hsl(var(--h) 70% 48%); }
:root[data-theme="dark"] .subject-ico { color: hsl(var(--h) 85% 72%); }
.subject-ico .ico { width: 1.5rem; height: 1.5rem; }
.subject-card h3 { margin: .3rem 0 0; font-size: 1.08rem; }
.subject-meta { margin-top: auto; display: flex; gap: .5rem; flex-wrap: wrap; position: relative; z-index: 1; }
.subject-code { font-size: .76rem; font-weight: 700; color: var(--muted); letter-spacing: .05em; }
.go-arrow { position: absolute; right: 1rem; top: 1.1rem; opacity: 0; transform: translateX(-6px); transition: .25s; color: var(--brand); }
.subject-card:hover .go-arrow, .item-row:hover .go-arrow { opacity: 1; transform: none; }

/* list rows (quiz / document items) */
.item-list { display: flex; flex-direction: column; gap: .7rem; }
.item-row { position: relative; display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; color: var(--ink); box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .25s, border-color .2s; }
.item-row:hover { transform: translateX(4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); color: var(--ink); }
.item-ico { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); flex: none; }
.item-body { flex: 1; min-width: 0; } .item-body strong { display: block; font-weight: 700; } .item-body p { margin: .15rem 0 0; font-size: .88rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.item-side { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.group-title { display: flex; align-items: center; gap: .6rem; margin: 1.8rem 0 .8rem; font-size: 1rem; color: var(--ink-2); }
.group-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.lock-note { display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; color: var(--muted); font-weight: 600; }

/* ---------- Auth ---------- */
.auth-shell { display: grid; place-items: center; padding: 1.5rem 0; }
.auth-card { width: min(440px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 2rem; box-shadow: var(--shadow-lg); animation: pageIn .5s ease both; }
.auth-brand { display: flex; align-items: center; gap: .9rem; margin-bottom: .8rem; }
.auth-brand h1 { font-size: 1.5rem; margin: 0; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.auth-divider { display: flex; align-items: center; gap: .8rem; color: var(--muted); font-size: .85rem; margin: 1.2rem 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-links { display: flex; justify-content: space-between; margin: 1.2rem 0 0; font-size: .9rem; }
.card-form.narrow { padding: 1.8rem; }

/* ---------- Premium ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.1rem; align-items: stretch; margin: 1.5rem 0; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: .5rem; padding: 1.6rem; background: var(--surface); border: 1.5px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-sm); transition: transform .25s, box-shadow .3s; }
.plan-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.plan-card.is-best { border-color: transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--grad) border-box; border: 2px solid transparent; box-shadow: var(--shadow); }
.plan-flag { position: absolute; top: -12px; right: 18px; background: var(--grad); color: #fff; font-size: .72rem; font-weight: 800; padding: .3rem .8rem; border-radius: 999px; box-shadow: 0 6px 14px rgba(79,70,229,.4); }
.plan-name { font-weight: 700; color: var(--ink-2); }
.price { font-size: 2.2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.price small { font-size: .9rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.plan-save { display: inline-block; font-size: .8rem; font-weight: 800; color: var(--ok); background: var(--ok-soft); padding: .2rem .6rem; border-radius: 999px; width: fit-content; }
.plan-feat { list-style: none; padding: 0; margin: .6rem 0 1rem; display: flex; flex-direction: column; gap: .4rem; font-size: .9rem; color: var(--ink-2); }
.plan-feat li::before { content: "✓"; color: var(--ok); font-weight: 800; margin-right: .5rem; }
.plan-card form { margin-top: auto; }
.pay-panel { display: grid; grid-template-columns: 300px 1fr; gap: 1.6rem; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 1.6rem; box-shadow: var(--shadow); }
.qr-frame { position: relative; background: #fff; border-radius: 18px; padding: .8rem; box-shadow: var(--shadow-sm); min-height: 276px; display: grid; place-items: center; }
.qr-frame img { width: 100%; height: auto; display: block; border-radius: 10px; }
.qr-fallback { display: none; text-align: center; color: #555; font-size: .88rem; padding: 1rem; }
.qr-frame.is-broken img { display: none; } .qr-frame.is-broken .qr-fallback { display: block; }
.pay-rows { display: flex; flex-direction: column; gap: .1rem; margin: .8rem 0 1rem; }
.pay-row { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px dashed var(--line); }
.pay-row span { color: var(--muted); } .pay-row strong { text-align: right; word-break: break-all; }
.copy-btn { cursor: pointer; border: 0; background: var(--brand-soft); color: var(--brand-ink); border-radius: 8px; font: inherit; font-size: .78rem; font-weight: 700; padding: .15rem .55rem; margin-left: .4rem; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .8rem; margin-top: 1.2rem; counter-reset: s; }
.step { position: relative; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1rem 1rem 3rem; font-size: .9rem; color: var(--ink-2); counter-increment: s; }
.step::before { content: counter(s); position: absolute; left: .9rem; top: .9rem; width: 26px; height: 26px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 800; font-size: .8rem; display: grid; place-items: center; }
.pulse { animation: pulseRing 2s infinite; }
@keyframes pulseRing { 0% { box-shadow: 0 0 0 0 rgba(79,70,229,.45); } 70% { box-shadow: 0 0 0 14px rgba(79,70,229,0); } 100% { box-shadow: 0 0 0 0 rgba(79,70,229,0); } }

/* ---------- Notifications ---------- */
.notif { display: flex; gap: 1rem; padding: 1rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); transition: transform .2s; }
.notif:hover { transform: translateX(3px); }
.notif.is-new { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); background: linear-gradient(90deg, var(--brand-soft), var(--surface) 55%); }
.notif-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; flex: none; background: var(--brand-soft); color: var(--brand); }
.notif-ico.t-premium { background: #fef3c7; color: #b45309; } .notif-ico.t-quiz { background: var(--ok-soft); color: var(--ok); }
.notif h4 { margin: 0 0 .15rem; font-size: .98rem; } .notif p { margin: 0; color: var(--ink-2); font-size: .92rem; }
.notif a.notif-link { display: inline-flex; align-items: center; gap: .3rem; margin-top: .4rem; font-size: .85rem; font-weight: 700; }

/* ---------- Leaderboard ---------- */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; align-items: end; margin: 1.4rem 0 1.6rem; }
.pod { position: relative; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 1.2rem .8rem; box-shadow: var(--shadow-sm); animation: rise .6s ease both; }
.pod.p1 { order: 2; padding-top: 2rem; padding-bottom: 1.8rem; background: linear-gradient(180deg, #fff7d6, var(--surface)); border-color: #f4d66a; box-shadow: var(--shadow); }
:root[data-theme="dark"] .pod.p1 { background: linear-gradient(180deg, #3b3210, var(--surface)); }
.pod.p2 { order: 1; animation-delay: .1s; } .pod.p3 { order: 3; animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.pod .medal { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font-weight: 800; color: #fff; margin-bottom: .5rem; font-size: 1.1rem; }
.pod.p1 .medal { background: linear-gradient(135deg, #fbbf24, #f59e0b); width: 54px; height: 54px; }
.pod.p2 .medal { background: linear-gradient(135deg, #cbd5e1, #94a3b8); } .pod.p3 .medal { background: linear-gradient(135deg, #fdba74, #c2410c); }
.pod strong { display: block; } .pod .score { font-size: 1.3rem; font-weight: 800; color: var(--brand); }
.rank-row { display: grid; grid-template-columns: 44px 1fr auto; gap: .8rem; align-items: center; padding: .75rem 1rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.rank-row + .rank-row { margin-top: .5rem; }
.rank-row.is-me { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 45%, transparent); }
.rank-n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); font-weight: 800; font-size: .88rem; color: var(--ink-2); }
.rank-row:nth-child(1) .rank-n { background: #fde68a; color: #92400e; } .rank-row:nth-child(2) .rank-n { background: #e2e8f0; color: #334155; } .rank-row:nth-child(3) .rank-n { background: #fed7aa; color: #9a3412; }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ok); margin-right: .4rem; animation: pulseRing 1.8s infinite; box-shadow: 0 0 0 0 rgba(22,163,74,.5); }

/* ---------- Quiz detail (show) ---------- */
.quiz-hero { position: relative; overflow: hidden; border-radius: 24px; padding: 2rem; background: var(--grad); color: #fff; box-shadow: var(--shadow-lg); }
.quiz-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255,255,255,.12); }
.quiz-hero h1 { color: #fff; margin-bottom: .4rem; } .quiz-hero p { color: rgba(255,255,255,.85); }
.quiz-hero .chips { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0 1.4rem; position: relative; z-index: 1; }
.quiz-hero .chip { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.25); color: #fff; }
.quiz-hero .btn { background: #fff; color: var(--brand-ink) !important; box-shadow: 0 10px 24px rgba(0,0,0,.22); position: relative; z-index: 1; }
.quiz-cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.4rem; margin-top: 1.4rem; align-items: start; }

/* ---------- Quiz attempt (bảng câu hỏi) ---------- */
body.is-quiz .main { padding-top: 1rem; }
.qz { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.6rem; align-items: start; }
.qz-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.qz-top h1 { font-size: 1.2rem; margin: 0; }
.qz-timer { display: inline-flex; align-items: center; gap: .5rem; background: var(--orange); color: #fff; padding: .6rem 1.1rem; border-radius: 6px; font-weight: 700; font-size: .95rem; box-shadow: 0 6px 16px rgba(217,98,43,.35); font-variant-numeric: tabular-nums; }
.qz-timer.is-low { background: var(--danger); animation: shake 1s infinite; }
@keyframes shake { 0%,100% { transform: none; } 10%,30%,50% { transform: translateX(-2px); } 20%,40% { transform: translateX(2px); } }
.qz-head { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; padding: .9rem 1.2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.qz-head .qn { font-size: 1.25rem; font-weight: 700; }
.qz-head .qn b { font-weight: 800; }
.qz-head .qs { font-size: .8rem; color: var(--muted); }
.qz-head .qs.is-done { color: var(--ok); font-weight: 700; }
.qz-flag { margin-left: auto; display: inline-flex; align-items: center; gap: .4rem; background: none; border: 0; font: inherit; font-weight: 700; cursor: pointer; color: var(--ink-2); padding: .3rem .5rem; border-radius: 8px; }
.qz-flag:hover { background: var(--warn-soft); }
.qz-flag.is-on { color: var(--warn); } .qz-flag.is-on .ico { fill: currentColor; }
.qz-question { padding: 1.4rem .4rem .4rem; font-size: 1.02rem; line-height: 1.7; white-space: pre-line; user-select: none; }
.qz-options { display: flex; flex-direction: column; gap: .55rem; padding: .6rem .4rem 1rem; }
.qz-opt { display: flex; align-items: flex-start; gap: .8rem; padding: .8rem 1rem; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; font-weight: 500; color: var(--ink); transition: border-color .15s, background .15s, transform .12s; user-select: none; }
.qz-opt:hover { border-color: var(--brand); background: var(--brand-soft); transform: translateX(3px); }
.qz-opt input { margin-top: .25rem; width: 1.1rem; height: 1.1rem; flex: none; }
.qz-opt .lt { font-weight: 700; color: var(--muted); min-width: 1.2rem; }
.qz-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.qz-nav { display: flex; justify-content: space-between; gap: .8rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.qz-side { position: sticky; top: 84px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 1.1rem 1.2rem 1.3rem; }
.qz-side h3 { display: flex; align-items: center; gap: .6rem; margin: 0 0 .8rem; padding-bottom: .8rem; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
.qz-star { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--orange); color: #fff; font-size: 1.3rem; line-height: 1; }
.qz-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .45rem; }
.qz-cell { position: relative; display: grid; place-items: center; height: 44px; padding: 0; background: var(--surface); border: 1.5px solid #9aa0b8; border-radius: 6px; font: inherit; font-size: .9rem; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: transform .12s, background .2s, border-color .2s, color .2s; }
.qz-cell:hover { transform: translateY(-2px); border-color: var(--brand); }
.qz-cell.is-done { background: #16a34a; border-color: #15803d; color: #fff; }
.qz-cell.is-flag::after { content: ""; position: absolute; top: -1px; right: -1px; border-style: solid; border-width: 0 14px 14px 0; border-color: transparent #f59e0b transparent transparent; border-top-right-radius: 5px; }
.qz-cell.is-current { outline: 3px solid #86c98f; outline-offset: 1px; border-color: #16a34a; }
.qz-cell.is-done.is-current { outline-color: #bbf7d0; }
.qz-legend { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin: .9rem 0 .5rem; font-size: .76rem; color: var(--muted); }
.qz-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; border: 1.5px solid #9aa0b8; }
.qz-legend i.d { background: #16a34a; border-color: #15803d; } .qz-legend i.f { background: #f59e0b; border-color: #f59e0b; }
.qz-finish { display: block; width: 100%; margin-top: .6rem; text-align: left; background: none; border: 0; font: inherit; color: var(--orange); cursor: pointer; padding: .3rem 0; font-size: .9rem; }
.qz-progress { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: .8rem; }
.qz-progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #22c55e, #16a34a); transition: width .35s ease; }
.qz-save { font-size: .78rem; color: var(--muted); display: inline-flex; align-items: center; gap: .35rem; }
.qz-save.is-err { color: var(--danger); font-weight: 700; }
.qz-q { display: none; } .qz-q.is-active { display: block; animation: pageIn .25s ease both; }
.no-js .qz-q { display: block; margin-bottom: 1.5rem; }
.modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; background: rgba(10,12,30,.55); backdrop-filter: blur(4px); padding: 1rem; }
.modal.is-open { display: grid; animation: pageIn .2s ease both; }
.modal-box { width: min(440px, 100%); background: var(--surface); border-radius: 20px; padding: 1.6rem; box-shadow: var(--shadow-lg); }
.modal-box h3 { margin-bottom: .5rem; }

/* result */
.result-hero { display: grid; grid-template-columns: 200px 1fr; gap: 2rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 1.8rem; box-shadow: var(--shadow); }
.ring { --p: 0; position: relative; width: 180px; height: 180px; border-radius: 50%; background: conic-gradient(var(--ringc, #16a34a) calc(var(--p) * 1%), var(--line) 0); display: grid; place-items: center; transition: --p 1s; }
.ring::before { content: ""; position: absolute; inset: 14px; border-radius: 50%; background: var(--surface); }
.ring-in { position: relative; text-align: center; } .ring-in strong { display: block; font-size: 2rem; font-weight: 800; line-height: 1.1; } .ring-in span { font-size: .82rem; color: var(--muted); }
.rv { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--line); border-radius: 14px; padding: 1.1rem 1.2rem; margin-top: .9rem; }
.rv.ok { border-left-color: var(--ok); } .rv.no { border-left-color: var(--danger); } .rv.skip { border-left-color: var(--warn); }
.rv-opt { display: flex; gap: .6rem; padding: .45rem .7rem; border-radius: 9px; margin-top: .35rem; background: var(--surface-2); font-size: .93rem; }
.rv-opt.is-correct { background: var(--ok-soft); color: var(--ok); font-weight: 600; } .rv-opt.is-wrong { background: var(--danger-soft); color: var(--danger); font-weight: 600; }
.rv-note { margin-top: .7rem; padding: .7rem .9rem; border-radius: 10px; background: var(--brand-soft); color: var(--brand-ink); font-size: .9rem; }

/* ---------- Documents ---------- */
.drive-viewer-wrap { border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); margin: 1rem 0; }
.drive-toolbar { padding: .6rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.drive-frame-box { position: relative; }
.drive-frame { width: 100%; height: min(78vh, 760px); border: 0; display: block; background: #fff; }
.drive-shield { position: absolute; top: 0; right: 0; width: 76px; height: 56px; }
.file-list { list-style: none; padding: 0; } .file-list li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: .5rem; }
.doc-page .lead { max-width: none; }
.avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid var(--surface); box-shadow: var(--shadow); }

/* ---------- Stat blocks (shared) ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
.stat { display: flex; flex-direction: column; gap: .15rem; padding: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.stat-n { font-size: 1.5rem; font-weight: 800; } .stat-l { color: var(--muted); font-size: .84rem; }
.msg { padding: .6rem .9rem; border-radius: 12px; background: var(--surface-2); margin: .3rem 0; }
.chat-layout { display: grid; grid-template-columns: 280px 1fr; gap: 1rem; }
.chat-list { display: flex; flex-direction: column; gap: .4rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2rem; padding: 2.4rem 0 1.4rem; }
.footer-col { display: flex; flex-direction: column; gap: .45rem; font-size: .92rem; } .footer-col strong { margin-bottom: .2rem; } .footer-col a { color: var(--muted); } .footer-col a:hover { color: var(--brand); }
.footer-bottom { padding: 1rem 0 1.6rem; border-top: 1px solid var(--line); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-modern { grid-template-columns: 1fr; padding-top: 1.6rem; } .hero-art { min-height: 260px; order: -1; }
  .quiz-cols, .pay-panel, .result-hero, .grid-2 { grid-template-columns: 1fr; }
  .qz { grid-template-columns: 1fr; } .qz-side { position: static; order: -1; }
  .qz-grid { grid-template-columns: repeat(8, 1fr); }
  .result-hero { justify-items: center; text-align: center; }
  .pay-panel { padding: 1.2rem; } .qr-frame { max-width: 320px; margin-inline: auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-grid; }
  .nav-links { position: fixed; inset: 64px 0 auto 0; flex-direction: column; align-items: stretch; margin: 0; padding: .8rem 1rem 1.2rem; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg); transform: translateY(-12px); opacity: 0; pointer-events: none; transition: .2s; }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-link { padding: .8rem 1rem; border-radius: 12px; }
  .hide-sm { display: none; }
}
@media (max-width: 560px) {
  .wrap { width: calc(100% - 1.2rem); } .main { padding-top: 1rem; }
  .podium { grid-template-columns: 1fr; } .pod.p1, .pod.p2, .pod.p3 { order: 0; }
  .qz-grid { grid-template-columns: repeat(6, 1fr); } .item-row { flex-wrap: wrap; } .item-side { width: 100%; justify-content: flex-start; }
  .footer-grid { grid-template-columns: 1fr; } .cta-band { padding: 2rem 1.2rem; }
  .qz-head { gap: .8rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .reveal { opacity: 1; transform: none; } html { scroll-behavior: auto; } }
