/* ==========================================================
 * Trang chủ tracnghiem — landing (ThemeOnlineTestHome.tpl)
 * Mọi selector nằm trong .tn-home để không ảnh hưởng trang khác.
 * ========================================================== */
.tn-home {
	--tn-green: #22a838;
	--tn-green-600: #1a8a2e;
	--tn-green-800: #0f5c1f;
	--tn-green-50: #eaf7ed;
	--tn-ink: #14211a;
	--tn-text: #3d4a42;
	--tn-muted: #6b7770;
	--tn-line: #e3e9e5;
	--tn-bg: #f6f8f7;
	--tn-card: #ffffff;
	--tn-amber: #f59e0b;
	--tn-radius: 16px;
	--tn-shadow: 0 1px 2px rgba(16, 40, 24, .05), 0 6px 18px rgba(16, 40, 24, .06);
	--tn-shadow-lg: 0 18px 40px rgba(16, 40, 24, .14);
	color: var(--tn-text);
	font-size: 15px;
	line-height: 1.55;
	margin: 0 0 24px;
}
.tn-home *,
.tn-home *::before,
.tn-home *::after { box-sizing: border-box; }
.tn-home a { text-decoration: none; }
.tn-home h1, .tn-home h2, .tn-home h3 { color: var(--tn-ink); margin: 0; font-weight: 700; letter-spacing: -.01em; }

/* ---------- Buttons ---------- */
.tn-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 12px 22px; border-radius: 999px; border: 1.5px solid transparent;
	font-weight: 600; font-size: 15px; line-height: 1.2; cursor: pointer;
	transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease;
	white-space: nowrap;
}
.tn-btn:hover { transform: translateY(-1px); }
.tn-btn:focus-visible, .tn-tab:focus-visible, .tn-home a:focus-visible { outline: 3px solid rgba(34, 168, 56, .45); outline-offset: 2px; }
.tn-btn--primary { background: var(--tn-green); color: #fff !important; box-shadow: 0 6px 16px rgba(34, 168, 56, .3); }
.tn-btn--primary:hover { background: var(--tn-green-600); }
.tn-btn--ghost { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .45); color: #fff !important; }
.tn-btn--ghost:hover { background: rgba(255, 255, 255, .24); }
.tn-btn--dark { background: var(--tn-ink); color: #fff !important; }
.tn-btn--dark:hover { background: #000; }
.tn-btn--light { background: #fff; color: var(--tn-green-800) !important; }
.tn-btn--outline-light { border-color: rgba(255, 255, 255, .6); color: #fff !important; }
.tn-btn--outline-light:hover { background: rgba(255, 255, 255, .12); }
.tn-btn--sm { padding: 8px 14px; font-size: 13.5px; }
.tn-link { color: var(--tn-green-600) !important; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.tn-link:hover { color: var(--tn-green-800) !important; text-decoration: underline; }

/* ---------- Hero ---------- */
.tn-hero {
	position: relative; overflow: hidden; border-radius: 24px;
	background: linear-gradient(135deg, #0f5c1f 0%, #1a8a2e 45%, #22a838 100%);
	color: #fff; margin-bottom: 20px;
}
.tn-hero__bg {
	position: absolute; inset: 0; pointer-events: none;
	background:
		radial-gradient(520px 320px at 92% 12%, rgba(255, 255, 255, .18), transparent 60%),
		radial-gradient(420px 260px at 8% 110%, rgba(255, 214, 102, .22), transparent 60%),
		repeating-linear-gradient(0deg, rgba(255, 255, 255, .045) 0 1px, transparent 1px 28px),
		repeating-linear-gradient(90deg, rgba(255, 255, 255, .045) 0 1px, transparent 1px 28px);
}
.tn-hero__inner {
	position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center;
	padding: 56px 52px;
}
.tn-eyebrow {
	display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px;
	background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28);
	font-size: 13px; font-weight: 600; letter-spacing: .02em;
}
.tn-eyebrow .fa { color: #ffd666; }
.tn-hero .tn-hero__title { color: #fff; font-size: 44px; line-height: 1.12; margin: 18px 0 16px; font-weight: 800; }
.tn-hero__title span {
	color: #ffd666;
	background: linear-gradient(transparent 68%, rgba(255, 214, 102, .28) 68%);
}
.tn-hero__lead { font-size: 17px; line-height: 1.6; color: rgba(255, 255, 255, .9); max-width: 560px; margin: 0 0 26px; }
.tn-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.tn-hero .tn-btn--primary { background: #fff; color: var(--tn-green-800) !important; box-shadow: 0 8px 22px rgba(0, 0, 0, .18); }
.tn-hero .tn-btn--primary:hover { background: #f2fff4; }

.tn-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 26px; }
.tn-chips__label { font-size: 13px; color: rgba(255, 255, 255, .75); margin-right: 2px; }
.tn-chip {
	padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 500;
	background: rgba(0, 0, 0, .14); color: #fff !important; border: 1px solid rgba(255, 255, 255, .18);
	transition: background-color .15s ease;
}
.tn-chip:hover { background: rgba(255, 255, 255, .22); }

/* Hero visual: thẻ câu hỏi mẫu */
.tn-hero__visual { position: relative; padding: 18px 26px; }
.tn-quiz {
	background: #fff; color: var(--tn-text); border-radius: 20px; padding: 22px;
	box-shadow: var(--tn-shadow-lg); transform: rotate(1.5deg);
}
.tn-quiz__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: 13px; }
.tn-quiz__badge { background: var(--tn-green-50); color: var(--tn-green-600); font-weight: 700; padding: 4px 10px; border-radius: 8px; }
.tn-quiz__timer { color: var(--tn-muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.tn-quiz__progress { height: 6px; background: #edf1ee; border-radius: 99px; overflow: hidden; margin-bottom: 16px; }
.tn-quiz__progress span { display: block; width: 18%; height: 100%; background: var(--tn-green); border-radius: inherit; }
.tn-quiz__q { font-weight: 700; color: var(--tn-ink); font-size: 16px; margin: 0 0 14px; }
.tn-quiz__opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tn-quiz__opts li {
	display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px;
	border: 1.5px solid var(--tn-line); font-size: 14.5px;
}
.tn-quiz__opts b {
	display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px;
	background: #f1f4f2; color: var(--tn-muted); font-size: 13px;
}
.tn-quiz__opts li.is-correct { border-color: var(--tn-green); background: var(--tn-green-50); color: var(--tn-green-800); font-weight: 600; }
.tn-quiz__opts li.is-correct b { background: var(--tn-green); color: #fff; }
.tn-quiz__opts li.is-correct .fa { margin-left: auto; color: var(--tn-green); }

.tn-float {
	position: absolute; display: flex; align-items: center; gap: 10px;
	background: #fff; color: var(--tn-ink); padding: 10px 14px; border-radius: 14px;
	box-shadow: var(--tn-shadow-lg); animation: tn-bob 5s ease-in-out infinite;
}
.tn-float .fa { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; font-size: 17px; }
.tn-float strong { display: block; font-size: 16px; line-height: 1.1; }
.tn-float small { color: var(--tn-muted); font-size: 12px; }
.tn-float--score { left: -6px; bottom: -4px; }
.tn-float--score .fa { background: #fff4d6; color: var(--tn-amber); }
.tn-float--streak { right: -4px; top: -6px; animation-delay: -2.5s; }
.tn-float--streak .fa { background: #ffe8e1; color: #ef5a2a; }
@keyframes tn-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------- Stats ---------- */
.tn-stats {
	display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
	background: var(--tn-card); border: 1px solid var(--tn-line); border-radius: var(--tn-radius);
	box-shadow: var(--tn-shadow); margin-bottom: 36px; overflow: hidden;
}
.tn-stat { display: flex; align-items: center; gap: 14px; padding: 20px 22px; }
.tn-stat + .tn-stat { border-left: 1px solid var(--tn-line); }
.tn-stat .fa {
	display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px;
	background: var(--tn-green-50); color: var(--tn-green); font-size: 20px;
}
.tn-stat strong { display: block; font-size: 24px; line-height: 1.1; color: var(--tn-ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.tn-stat span { font-size: 13.5px; color: var(--tn-muted); }

/* ---------- Section ---------- */
.tn-section { margin-bottom: 40px; }
.tn-section__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.tn-section__head--center { justify-content: center; text-align: center; }
.tn-section__title { font-size: 26px; line-height: 1.25; }
.tn-section__sub { margin: 4px 0 0; color: var(--tn-muted); font-size: 15px; }

/* ---------- Groups ---------- */
.tn-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tn-group {
	--tone: var(--tn-green); --tone-bg: var(--tn-green-50);
	display: flex; align-items: center; gap: 14px; padding: 16px;
	background: var(--tn-card); border: 1px solid var(--tn-line); border-radius: var(--tn-radius);
	color: var(--tn-ink) !important; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.tn-group:hover { transform: translateY(-3px); box-shadow: var(--tn-shadow); border-color: var(--tone); }
.tn-group__icon {
	display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 14px;
	background: var(--tone-bg); color: var(--tone); font-size: 21px;
}
.tn-group__body { min-width: 0; flex: 1; }
.tn-group__title { display: block; font-weight: 700; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-group__meta { display: block; font-size: 13px; color: var(--tn-muted); }
.tn-group__arrow { color: #b5c0b9; font-size: 20px; transition: transform .18s ease, color .18s ease; }
.tn-group:hover .tn-group__arrow { color: var(--tone); transform: translateX(3px); }
.tn-tone-1 { --tone: #2563eb; --tone-bg: #e8effe; }
.tn-tone-2 { --tone: #7c3aed; --tone-bg: #f1eafe; }
.tn-tone-3 { --tone: #e11d48; --tone-bg: #fde8ed; }
.tn-tone-4 { --tone: #d97706; --tone-bg: #fdf1dc; }
.tn-tone-5 { --tone: #0891b2; --tone-bg: #e1f5f9; }

/* ---------- Tabs ---------- */
.tn-tabs { display: inline-flex; padding: 4px; background: #edf1ee; border-radius: 999px; gap: 2px; }
.tn-tab {
	border: 0; background: transparent; padding: 8px 16px; border-radius: 999px;
	font-size: 14px; font-weight: 600; color: var(--tn-muted); cursor: pointer; transition: all .15s ease;
}
.tn-tab .fa { margin-right: 4px; }
.tn-tab:hover { color: var(--tn-ink); }
.tn-tab.is-active { background: #fff; color: var(--tn-green-600); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }

/* ---------- Exam cards ---------- */
.tn-exams { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tn-exams[hidden] { display: none; }
.tn-exam {
	display: flex; flex-direction: column; padding: 18px;
	background: var(--tn-card); border: 1px solid var(--tn-line); border-radius: var(--tn-radius);
	transition: transform .18s ease, box-shadow .18s ease;
}
.tn-exam:hover { transform: translateY(-3px); box-shadow: var(--tn-shadow-lg); }
.tn-exam__top { display: flex; align-items: center; gap: 8px; min-height: 22px; margin-bottom: 10px; }
.tn-exam__group {
	font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
	color: var(--tn-green-600) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tn-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; margin-left: auto; }
.tn-tag--new { background: #fff1e6; color: #ea580c; }
.tn-exam__title { font-size: 16.5px; line-height: 1.4; margin-bottom: 12px; flex: 1; }
.tn-exam__title a {
	color: var(--tn-ink) !important;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tn-exam__title a:hover { color: var(--tn-green-600) !important; }
.tn-exam__meta { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--tn-muted); }
.tn-exam__meta .fa { color: #9aa79f; margin-right: 3px; }
.tn-exam__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px dashed var(--tn-line); }
.tn-price { font-weight: 700; font-size: 14px; color: #b45309; }
.tn-price .fa { font-size: 12px; }
.tn-price--free { color: var(--tn-green-600); }
.tn-empty { grid-column: 1 / -1; text-align: center; color: var(--tn-muted); padding: 36px; background: var(--tn-card); border: 1px dashed var(--tn-line); border-radius: var(--tn-radius); margin: 0; }

/* ---------- Modes ---------- */
.tn-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tn-mode { position: relative; overflow: hidden; padding: 30px; border-radius: 20px; border: 1px solid var(--tn-line); }
.tn-mode--exam { background: linear-gradient(160deg, #eaf7ed 0%, #ffffff 70%); }
.tn-mode--bank { background: linear-gradient(160deg, #fff6e0 0%, #ffffff 70%); }
.tn-mode__icon {
	display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px;
	background: var(--tn-green); color: #fff; font-size: 22px; margin-bottom: 16px;
	box-shadow: 0 8px 18px rgba(34, 168, 56, .28);
}
.tn-mode--bank .tn-mode__icon { background: var(--tn-amber); box-shadow: 0 8px 18px rgba(245, 158, 11, .3); }
.tn-mode h3 { font-size: 22px; margin-bottom: 8px; }
.tn-mode p { margin: 0 0 14px; }
.tn-mode ul { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 6px; }
.tn-mode li .fa { color: var(--tn-green); margin-right: 8px; }
.tn-mode--bank li .fa { color: var(--tn-amber); }
.tn-mode__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }

/* ---------- Topics ---------- */
.tn-topics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tn-topic {
	display: flex; flex-direction: column; gap: 4px; padding: 16px 18px;
	background: var(--tn-card); border: 1px solid var(--tn-line); border-left: 4px solid var(--tn-amber);
	border-radius: 12px; transition: box-shadow .18s ease, transform .18s ease;
}
.tn-topic:hover { box-shadow: var(--tn-shadow); transform: translateY(-2px); }
.tn-topic__title { color: var(--tn-ink); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tn-topic__num { font-size: 13px; color: var(--tn-muted); }

/* ---------- Steps ---------- */
.tn-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: none; }
.tn-steps li { position: relative; padding: 26px 24px; background: var(--tn-card); border: 1px solid var(--tn-line); border-radius: var(--tn-radius); }
.tn-steps__num {
	display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
	background: var(--tn-ink); color: #fff; font-weight: 800; margin-bottom: 14px;
}
.tn-steps li:nth-child(2) .tn-steps__num { background: var(--tn-green); }
.tn-steps li:nth-child(3) .tn-steps__num { background: var(--tn-amber); }
.tn-steps h3 { font-size: 17px; margin-bottom: 6px; }
.tn-steps p { margin: 0; color: var(--tn-muted); }

/* ---------- CTA ---------- */
.tn-cta {
	display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
	padding: 34px 40px; border-radius: 22px; color: #fff;
	background: radial-gradient(400px 200px at 100% 0%, rgba(255, 214, 102, .25), transparent 70%), linear-gradient(120deg, #14211a 0%, #0f5c1f 100%);
}
.tn-cta h2 { color: #fff; font-size: 24px; margin-bottom: 6px; }
.tn-cta p { margin: 0; color: rgba(255, 255, 255, .8); }
.tn-cta__actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.tn-hero__inner { padding: 44px 36px; gap: 24px; }
	.tn-hero .tn-hero__title { font-size: 38px; }
	.tn-topics { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 991px) {
	.tn-hero__inner { grid-template-columns: 1fr; }
	.tn-hero__visual { max-width: 440px; width: 100%; margin: 8px auto 0; }
	.tn-stats { grid-template-columns: repeat(2, 1fr); }
	.tn-stat:nth-child(3) { border-left: 0; }
	.tn-stat:nth-child(n+3) { border-top: 1px solid var(--tn-line); }
	.tn-exams { grid-template-columns: repeat(2, 1fr); }
	.tn-topics { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
	.tn-home { font-size: 14.5px; }
	.tn-hero { border-radius: 18px; }
	.tn-hero__inner { padding: 32px 20px; }
	.tn-hero .tn-hero__title { font-size: 30px; }
	.tn-hero__lead { font-size: 15.5px; }
	.tn-hero__actions .tn-btn { flex: 1 1 auto; }
	.tn-hero__visual { padding: 14px 10px; }
	.tn-float--streak { right: 0; }
	.tn-stat { padding: 16px; gap: 10px; }
	.tn-stat .fa { width: 38px; height: 38px; font-size: 17px; }
	.tn-group__icon { width: 42px; height: 42px; font-size: 19px; }
	.tn-stat strong { font-size: 20px; }
	.tn-section { margin-bottom: 32px; }
	.tn-section__title { font-size: 21px; }
	.tn-groups { grid-template-columns: 1fr 1fr; gap: 10px; }
	.tn-group { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
	.tn-group__title { white-space: normal; }
	.tn-group__arrow { display: none; }
	.tn-exams, .tn-modes, .tn-steps { grid-template-columns: 1fr; }
	.tn-mode { padding: 24px 20px; }
	.tn-cta { padding: 28px 22px; }
	.tn-cta .tn-btn { width: 100%; }
	.tn-cta__actions { width: 100%; }
}
@media (max-width: 420px) {
	.tn-topics { grid-template-columns: 1fr; }
	.tn-float { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.tn-home *, .tn-home *::before, .tn-home *::after { animation: none !important; transition: none !important; }
}
