/* GI8 Đăng Nhập — giao diện nhẹ, không phông chữ ngoài, hỗ trợ đầy đủ tiếng Việt */
:root {
  --navy-950: #070f22;
  --navy-900: #0a1630;
  --navy-800: #0f2147;
  --navy-700: #18305f;
  --gold-300: #f0cf7e;
  --gold-400: #e0b85a;
  --gold-ink: #7a5a10;
  --paper: #f6f7fa;
  --card: #ffffff;
  --ink: #13203a;
  --muted: #45516a;
  --line: #dbe0ea;
  --warn-bg: #fff6e0;
  --warn-line: #d9a93a;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; }
a { color: #1d3f8f; text-underline-offset: 3px; }
a:hover { color: var(--navy-900); }
h1, h2, h3 { line-height: 1.3; color: var(--navy-900); letter-spacing: -0.005em; }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.85rem); margin: 2.6rem 0 0.9rem; }
h3 { font-size: 1.2rem; margin: 1.8rem 0 0.6rem; }
p, ul, ol { margin: 0 0 1rem; }
li { margin-bottom: 0.4rem; }
code { font-size: 0.92em; background: #eceff5; padding: 0.1em 0.35em; border-radius: 4px; word-break: break-word; }
kbd { font: 600 0.85em var(--font); border: 1px solid #b9c1d1; border-bottom-width: 2px; border-radius: 4px; padding: 0.05em 0.4em; background: #fff; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 24px; } }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Tiêu điểm bàn phím rõ ràng */
:focus-visible { outline: 3px solid var(--navy-800); outline-offset: 3px; border-radius: 4px; }
.on-dark :focus-visible { outline-color: var(--gold-300); }
main:focus { outline: none; }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--gold-400); color: var(--navy-950); padding: 0.6rem 1rem;
  font-weight: 700; border-radius: 8px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* Vùng nền tối */
.on-dark { background: var(--navy-900); color: #e8ecf5; }
.on-dark h1, .on-dark h2, .on-dark h3 { color: #fff; }
.on-dark a { color: var(--gold-300); }
.on-dark a:hover { color: #fff; }

.notice-bar { background: var(--navy-950); font-size: 0.85rem; line-height: 1.5; border-bottom: 1px solid rgba(224,184,90,0.25); }
.notice-bar p { margin: 0; padding: 0.45rem 0; color: #c9d2e3; }
.notice-bar strong { color: var(--gold-300); margin-right: 0.35rem; }

/* Đầu trang */
.site-header { border-bottom: 1px solid rgba(255,255,255,0.08); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 0.65rem; text-decoration: none; color: #fff !important; padding: 0.5rem 0; }
.brand-logo { flex: none; display: block; height: 38px; width: auto; }
@media (min-width: 720px) { .brand-logo { height: 42px; } }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 800; font-size: 1.1rem; }
.brand-tag { font-size: 0.78rem; color: #b8c2d6; }

.nav-toggle {
  display: none; align-items: center; gap: 0.5rem;
  background: transparent; color: #fff; font: 600 0.95rem var(--font);
  border: 1px solid rgba(255,255,255,0.3); border-radius: 8px; padding: 0.5rem 0.8rem; cursor: pointer; min-height: 44px;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 18px; height: 2px; background: currentColor; position: relative; content: "";
}
.nav-toggle-bars::before { position: absolute; top: -6px; }
.nav-toggle-bars::after { position: absolute; top: 6px; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; }
.site-nav li { margin: 0; }
.site-nav a {
  display: block; padding: 0.55rem 0.75rem; border-radius: 8px; text-decoration: none;
  color: #e8ecf5; font-weight: 600; font-size: 0.95rem;
}
.site-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.site-nav a[aria-current="page"] { color: var(--gold-300); box-shadow: inset 0 -2px 0 var(--gold-400); border-radius: 8px 8px 0 0; }

@media (max-width: 899px) {
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav { display: none; width: 100%; padding-bottom: 0.75rem; }
  .js .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { padding: 0.75rem 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.08); border-radius: 0; }
  .site-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--gold-400); padding-left: 0.85rem; border-radius: 0; }
}

/* Nút */
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px;
  padding: 0.7rem 1.3rem; border-radius: 10px; font-weight: 700; font-size: 1rem;
  text-decoration: none; border: 2px solid transparent; line-height: 1.3; text-align: center;
}
.btn-gold { background: var(--gold-400); color: var(--navy-950) !important; }
.btn-gold:hover { background: var(--gold-300); }
.btn-outline { border-color: rgba(240,207,126,0.7); color: #fff !important; }
.btn-outline:hover { background: rgba(255,255,255,0.08); }
.btn-navy { background: var(--navy-800); color: #fff !important; }
.btn-navy:hover { background: var(--navy-700); }

/* Hero trang chủ */
.hero { padding: 2.5rem 0 3rem; background: linear-gradient(180deg, var(--navy-900), var(--navy-800)); }
.hero-inner { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 900px) { .hero-inner { grid-template-columns: 1.45fr 1fr; gap: 3rem; } .hero { padding: 3.5rem 0 4rem; } }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; font-weight: 700; color: var(--gold-300); margin-bottom: 0.6rem; }
.hero h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem); margin: 0 0 1rem; }
.lead { font-size: 1.12rem; color: #d3dae8; max-width: 62ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
@media (max-width: 480px) { .hero-actions .btn { flex: 1 1 100%; } }
.hero-note {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(224,184,90,0.35);
  border-radius: var(--radius); padding: 1.25rem 1.4rem;
}
.hero-note h2 { font-size: 1.1rem; margin: 0 0 0.6rem; }
.hero-note p { color: #dbe1ec; }

.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { position: relative; padding-left: 1.7rem; }
.check-list li::before {
  content: ""; position: absolute; left: 0.15rem; top: 0.5em; width: 0.9rem; height: 0.5rem;
  border-left: 2px solid var(--gold-400); border-bottom: 2px solid var(--gold-400); transform: rotate(-45deg);
}
.check-list--light li::before { border-color: var(--gold-ink); }

/* Trang con */
.page-hero { padding: 1.5rem 0 2.25rem; background: linear-gradient(180deg, var(--navy-900), var(--navy-800)); }
.page-hero h1 { font-size: clamp(1.6rem, 1.15rem + 2vw, 2.4rem); margin: 0.75rem 0 0.75rem; max-width: 30ch; }
.page-dates { font-size: 0.9rem; color: #b8c2d6; margin: 0; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; margin: 0; padding: 0; font-size: 0.9rem; }
.breadcrumbs li { margin: 0; color: #c3cbdb; }
.breadcrumbs li + li::before { content: "›"; margin: 0 0.5rem; color: #8f9bb3; }

/* Bố cục nội dung */
.home-layout, .article-layout { padding-top: 2rem; padding-bottom: 3.5rem; }
.home-layout { display: grid; gap: 1.5rem; }
@media (min-width: 1000px) {
  .home-layout { grid-template-columns: 250px minmax(0, 1fr); gap: 3rem; align-items: start; }
  .home-layout > .toc { position: sticky; top: 1rem; }
}
.prose { max-width: 780px; min-width: 0; }
.prose > section:first-child h2, .prose > section:first-of-type > h2:first-child { margin-top: 0.5rem; }

.toc {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.25rem; font-size: 0.97rem;
}
.toc-title { font-size: 1rem; margin: 0 0 0.5rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.toc ol { margin: 0; padding-left: 1.25rem; }
.toc li { margin: 0.2rem 0; }
.toc a { text-decoration: none; padding: 0.15rem 0; }
.toc a:hover { text-decoration: underline; }
.toc--compact { margin-bottom: 1.5rem; }
@media (min-width: 720px) { .toc--compact ol { columns: 2; column-gap: 2rem; } }

/* Khối nhấn mạnh */
.callout, .note, .warning, .login-status {
  border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1.25rem 0;
}
.callout { background: #eef2fa; border-left: 4px solid var(--navy-700); }
.callout p:last-child, .login-status p:last-child { margin-bottom: 0; }
.note { background: #eef2fa; color: var(--muted); font-size: 0.97rem; }
.warning { background: var(--warn-bg); border-left: 4px solid var(--warn-line); }
.login-status { background: var(--card); border: 1px dashed #9aa6bf; }
.login-status--ready { border-style: solid; border-color: var(--gold-400); }
.login-status .btn { margin-top: 0.5rem; }

.figure { margin: 1.5rem 0; }
.figure img { display: block; width: 100%; border-radius: var(--radius); border: 1px solid var(--line); background: var(--navy-900); }
.figure figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 0.5rem; }

.steps { padding-left: 1.4rem; }
.steps li { margin-bottom: 0.75rem; padding-left: 0.25rem; }
.steps li::marker { font-weight: 800; color: var(--gold-ink); }

.cta-row { margin-top: 1.25rem; }

/* Bảng đáp ứng */
.table-wrap { margin: 1.25rem 0; }
.rtable { width: 100%; border-collapse: collapse; background: var(--card); font-size: 0.96rem; border-radius: var(--radius); overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.rtable caption { text-align: left; font-weight: 700; padding: 0 0 0.6rem; color: var(--navy-900); caption-side: top; }
.rtable th, .rtable td { padding: 0.8rem 0.9rem; vertical-align: top; text-align: left; border-bottom: 1px solid var(--line); }
.rtable thead th { background: var(--navy-900); color: #fff; font-size: 0.9rem; }
.rtable tbody th { font-weight: 700; color: var(--navy-900); width: 18%; }
.rtable tbody tr:nth-child(even) { background: #f9fafc; }
.rtable tbody tr:last-child > * { border-bottom: 0; }

@media (max-width: 760px) {
  .rtable, .rtable tbody, .rtable tr, .rtable th, .rtable td { display: block; width: 100%; }
  .rtable { box-shadow: none; background: transparent; }
  .rtable thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .rtable caption { display: block; }
  .rtable tbody tr { background: var(--card) !important; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 0.9rem; overflow: hidden; }
  .rtable tbody th { width: 100%; background: var(--navy-800); color: #fff; font-size: 1rem; border-bottom: 0; }
  .rtable td { border-bottom: 1px solid var(--line); padding: 0.7rem 0.9rem; }
  .rtable td::before {
    content: attr(data-label); display: block; font-size: 0.78rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em; color: var(--gold-ink); margin-bottom: 0.2rem;
  }
}

/* Thẻ */
.card-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 1.25rem 0; }
.card { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--gold-400); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.card h3 { margin-top: 0; font-size: 1.08rem; }
.card p { margin: 0; font-size: 0.97rem; }

.guide-cards { list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.guide-cards li { margin: 0; }
.guide-card {
  display: flex; flex-direction: column; gap: 0.35rem; height: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; text-decoration: none; color: var(--ink);
}
.guide-card strong { color: #1d3f8f; font-size: 1.05rem; }
.guide-card strong::after { content: " →"; }
.guide-card span { font-size: 0.95rem; color: var(--muted); }
.guide-card:hover { border-color: var(--navy-700); }
.guide-card:hover strong { text-decoration: underline; }

/* Câu hỏi thường gặp */
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 0.7rem; }
.faq summary {
  cursor: pointer; padding: 0.95rem 2.6rem 0.95rem 1.1rem; font-weight: 700; color: var(--navy-900);
  position: relative; list-style: none; min-height: 48px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 1.1rem; top: 0.8rem; font-size: 1.3rem; color: var(--gold-ink); }
.faq details[open] summary::after { content: "−"; }
.faq-answer { padding: 0 1.1rem 0.4rem; }

.contact-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.4rem; margin-top: 2.5rem; }
.contact-box h2 { margin-top: 0; }
.contact-email { font-size: 1.2rem; font-weight: 700; word-break: break-all; }

.related { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.related h2 { margin-top: 0; font-size: 1.3rem; }
.link-list { padding-left: 1.2rem; }
.link-list span { color: var(--muted); }

/* Chân trang */
.site-footer { padding: 2.75rem 0 1.5rem; font-size: 0.95rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1.2fr; } }
.footer-brand { font-weight: 800; font-size: 1.1rem; color: #fff; }
.footer-heading { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold-300) !important; margin: 0 0 0.75rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.45rem; }
.site-footer a { color: #e8ecf5; }
.site-footer a:hover { color: var(--gold-300); }
.site-footer p { color: #c3cbdb; }
.footer-small { font-size: 0.88rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); margin-top: 2rem; padding-top: 1.25rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; font-size: 0.88rem; }
.footer-bottom p { margin: 0; }
.age-tag { display: inline-block; border: 1.5px solid var(--gold-400); color: var(--gold-300); border-radius: 6px; padding: 0 0.35rem; font-weight: 800; margin-right: 0.35rem; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media print {
  .notice-bar, .site-header, .site-footer, .toc, .hero-actions { display: none; }
  body { background: #fff; }
}
