/* ==========================================================
   thi.laixeanninh.vn – lớp giao diện chung (design tokens)
   Phong cách: nghiêm túc, đáng tin (xanh công an đậm), điểm nhấn vàng.
   ========================================================== */
:root {
    --c-navy: #0b3d91;
    --c-navy-dark: #072a66;
    --c-blue: #1565c0;
    --c-gold: #ffc107;
    --c-gold-dark: #e0a800;
    --c-zalo: #0068ff;
    --c-call: #16a34a;
    --c-red: #c62828;
    --c-text: #1f2937;
    --c-muted: #5b6472;
    --c-bg: #f4f6fb;
    --c-surface: #ffffff;
    --c-border: #e3e8f0;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 10px rgba(11, 61, 145, .08);
    --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
    --mobile-bar-h: 60px;
}

body {
    font-family: var(--font);
    color: var(--c-text);
    background: var(--c-bg);
    line-height: 1.6;
}

/* Bootstrap primary -> màu thương hiệu */
.text-primary { color: var(--c-navy) !important; }
.bg-primary { background-color: var(--c-navy) !important; }
.btn-primary { background-color: var(--c-navy); border-color: var(--c-navy); }
.btn-primary:hover, .btn-primary:focus { background-color: var(--c-navy-dark); border-color: var(--c-navy-dark); }

/* Focus rõ ràng cho bàn phím */
a:focus-visible, button:focus-visible, .btn:focus-visible, select:focus-visible, input:focus-visible {
    outline: 3px solid var(--c-gold);
    outline-offset: 2px;
    box-shadow: none;
}

.skip-link {
    position: absolute; left: -9999px; top: 8px; z-index: 2000;
    background: var(--c-gold); color: #000; padding: 8px 14px; border-radius: var(--radius-sm); font-weight: 600;
}
.skip-link:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header { background: linear-gradient(90deg, var(--c-navy-dark), var(--c-navy)); box-shadow: var(--shadow); }
.site-header .navbar { padding: .5rem 0; }
.navbar-brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; }
.brand-mark {
    width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
    background: var(--c-gold); color: var(--c-navy-dark); font-size: 1.1rem;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; font-size: 1.02rem; }
.brand-text small { font-weight: 500; font-size: .72rem; color: rgba(255,255,255,.8); letter-spacing: .02em; }
.site-header .nav-link { color: rgba(255,255,255,.92) !important; font-weight: 500; padding: .6rem .7rem !important; white-space: nowrap; }
@media (max-width: 1199.98px) {
    .site-header .navbar-collapse { padding: .5rem 0 1rem; }
    .site-header .dropdown-menu { background: rgba(255,255,255,.98); }
}
.site-header .nav-link:hover { color: #fff !important; }
.btn-cta { background: var(--c-gold); color: #1a1a1a; font-weight: 700; border: 0; }
.btn-cta:hover { background: var(--c-gold-dark); color: #000; }
.nav-cta { padding: .45rem .9rem; margin: .25rem 0; }
.dropdown-menu { border-radius: var(--radius-sm); border-color: var(--c-border); box-shadow: var(--shadow); }
.dropdown-item { padding: .55rem 1rem; }

/* ---------- Breadcrumb ---------- */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem; padding: .75rem 0 0; margin: 0; font-size: .875rem; color: var(--c-muted); }
.crumbs li + li::before { content: "›"; margin-right: .35rem; color: #9aa3b2; }
.crumbs a { color: var(--c-blue); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ---------- Mở đầu trang ---------- */
.page-intro { max-width: 860px; margin: 1.25rem auto .5rem; text-align: center; }
.page-intro h1 { font-size: clamp(1.45rem, 3.6vw, 2.1rem); font-weight: 700; color: var(--c-navy); margin-bottom: .6rem; line-height: 1.3; }
.page-intro .lead-text { font-size: 1rem; color: var(--c-text); margin-bottom: .4rem; }
.page-intro .meta-line { font-size: .8rem; color: var(--c-muted); margin: 0; }
@media (max-width: 575.98px) {
    .page-intro { text-align: left; }
    .page-intro .lead-text { font-size: .95rem; }
}
/* Template cũ có mt-5 ngay sau phần mở đầu -> thu gọn khoảng trắng */
.page-intro + .container.mt-5, .page-intro + .container { margin-top: 1rem !important; }

/* ---------- CTA cuối trang ---------- */
.cta-band { margin-top: 2.5rem; margin-bottom: 2rem; }
.cta-band-inner {
    background: linear-gradient(120deg, var(--c-navy-dark), var(--c-blue));
    color: #fff; border-radius: var(--radius); padding: 1.5rem; display: flex; flex-wrap: wrap;
    gap: 1rem; align-items: center; justify-content: space-between; box-shadow: var(--shadow);
}
.cta-band h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: .3rem; }
.cta-band p { margin: 0; color: rgba(255,255,255,.9); font-size: .95rem; }
.cta-band-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.btn-zalo { background: var(--c-zalo); color: #fff; font-weight: 600; border: 0; }
.btn-zalo:hover { background: #0052cc; color: #fff; }
.cta-band .btn { min-height: 44px; display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1.1rem; }

/* CTA chèn sau khi nộp bài thi */
.exam-cta { margin: 1rem 0; padding: 1rem 1.1rem; border-radius: var(--radius); border: 1px solid var(--c-border); background: #fff; box-shadow: var(--shadow); }
.exam-cta.pass { border-left: 5px solid var(--c-call); }
.exam-cta.fail { border-left: 5px solid var(--c-gold-dark); }
.exam-cta p { margin-bottom: .6rem; }
.exam-cta .btn { min-height: 44px; margin: .2rem .3rem .2rem 0; }

/* ---------- Footer ---------- */
.site-footer { background: #0a1f44; color: rgba(255,255,255,.85); padding: 2rem 0 1.25rem; margin-top: 2rem; font-size: .92rem; }
.site-footer a { color: #fff; }
.site-footer p { margin-bottom: .45rem; }
.site-footer i { width: 1.2em; color: var(--c-gold); }
.footer-title { font-weight: 700; color: #fff; margin-bottom: .6rem !important; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .35rem; }
.footer-links a { color: rgba(255,255,255,.85); text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-note { margin-top: 1.25rem; font-size: .78rem; color: rgba(255,255,255,.6); border-top: 1px solid rgba(255,255,255,.12); padding-top: .9rem; }

/* ---------- FAQ trang chủ ---------- */
.faq-section { max-width: 860px; margin: 2.5rem auto 0; }
.faq-section h2 { text-align: center; font-weight: 700; color: var(--c-navy); font-size: 1.5rem; margin-bottom: 1rem; }
.faq-section details { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-sm); margin-bottom: .6rem; padding: .2rem 1rem; }
.faq-section summary { cursor: pointer; font-weight: 600; padding: .7rem 0; list-style: none; min-height: 44px; }
.faq-section summary::-webkit-details-marker { display: none; }
.faq-section summary::after { content: "+"; float: right; font-weight: 700; color: var(--c-blue); }
.faq-section details[open] summary::after { content: "–"; }
.faq-section details p { margin: 0 0 .8rem; color: var(--c-text); }

/* ---------- Thanh liên hệ mobile ---------- */
.mobile-cta { display: none; }
@media (max-width: 991.98px) {
    .mobile-cta {
        display: grid; grid-template-columns: 1fr 1fr 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
        height: var(--mobile-bar-h); background: #fff; box-shadow: 0 -2px 12px rgba(0,0,0,.12);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .mobile-cta a {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
        text-decoration: none; font-size: .78rem; font-weight: 600; color: #fff;
    }
    .mobile-cta i { font-size: 1.1rem; }
    .mc-zalo { background: var(--c-zalo); }
    .mc-call { background: var(--c-call); }
    .mc-reg { background: var(--c-gold); color: #1a1a1a !important; }
    body { padding-bottom: calc(var(--mobile-bar-h) + env(safe-area-inset-bottom)); }
    /* Thanh đếm giờ thi dính trên cùng không bị che */
    .sticky-timer { z-index: 1020; }
}

/* ---------- Trang 404 ---------- */
.notfound { text-align: center; max-width: 640px; margin: 3rem auto; }
.notfound .code { font-size: 4rem; font-weight: 800; color: var(--c-navy); line-height: 1; }
.notfound .links { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .6rem; margin-top: 1.5rem; }
.notfound .links a { display: block; padding: .8rem; background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-sm); text-decoration: none; font-weight: 600; }

/* Giảm chuyển động khi người dùng yêu cầu */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
