/* =========================================================
   legal.css — style dùng chung cho các trang chính sách
   (terms.html, privacy.html). Token màu đồng bộ index.html.
   ========================================================= */

:root {
  --night-1: #050d24;
  --night-2: #0b1a3a;
  --night-3: #16285a;
  --blue: #2563eb;
  --blue-light: #3b82f6;
  --sky: #dbeafe;
  --gold: #f5d76e;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-900: #0f172a;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 10px 30px -10px rgba(11, 26, 58, 0.25);
  --container: 1180px;
}

/* ========== RESET ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 90px; }
body {
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--gray-900);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

/* ========== NÚT ========== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border-radius: 999px; font-weight: 600; font-size: 15px;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--blue); color: var(--white);
  box-shadow: 0 8px 20px -6px rgba(37, 99, 235, 0.5);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -6px rgba(37, 99, 235, 0.6); }

/* ========== HEADER ========== */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-100);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; max-width: var(--container); margin: 0 auto;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 22px; color: var(--night-2); letter-spacing: -0.5px;
}
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--night-2), var(--blue));
  display: flex; align-items: center; justify-content: center; color: var(--gold);
}
.logo-mark svg { width: 22px; height: 22px; }
.header-cta { padding: 10px 18px; font-size: 14px; }

/* ========== BĂNG TIÊU ĐỀ TRANG ========== */
.page-hero {
  background: linear-gradient(160deg, var(--night-2) 0%, var(--night-3) 100%);
  color: var(--white);
  padding: 46px 0 40px;
  position: relative;
  overflow: hidden;
}
.page-hero::after {
  content: ''; position: absolute; right: -60px; top: -60px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245,215,110,.16), transparent 68%);
}
.crumb { font-size: 14px; color: rgba(255,255,255,.6); margin-bottom: 12px; }
.crumb a:hover { color: var(--gold); }
.page-hero h1 {
  font-size: 30px; line-height: 1.25; letter-spacing: -0.6px; font-weight: 800;
  max-width: 22ch;
}
.page-hero .lede {
  margin-top: 14px; max-width: 62ch; color: rgba(255,255,255,.78); font-size: 16px;
}
.updated {
  display: inline-block; margin-top: 18px; padding: 6px 14px;
  border: 1px solid rgba(255,255,255,.22); border-radius: 999px;
  font-size: 13.5px; color: rgba(255,255,255,.8);
}

/* ========== BỐ CỤC NỘI DUNG ========== */
.legal-wrap { padding: 40px 0 70px; }
.legal-grid { display: grid; grid-template-columns: 1fr; gap: 34px; }

/* Mục lục */
.toc {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.toc h2 {
  font-size: 13px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--gray-500); font-weight: 700; margin-bottom: 12px;
}
.toc ol { list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; margin-bottom: 7px; font-size: 14.5px; }
.toc a { color: var(--gray-700); display: flex; gap: 9px; align-items: baseline; }
.toc a::before {
  content: counter(toc); font-variant-numeric: tabular-nums;
  color: var(--blue); font-weight: 700; font-size: 13px; min-width: 15px;
}
.toc a:hover { color: var(--blue); }

/* Bài viết */
.legal-body { max-width: 74ch; }
.legal-body h2 {
  font-size: 21px; font-weight: 700; color: var(--night-2);
  margin: 38px 0 12px; letter-spacing: -0.3px; scroll-margin-top: 90px;
  display: flex; gap: 12px; align-items: baseline;
}
.legal-body h2:first-of-type { margin-top: 0; }
/* Số điều khoản: dùng để trích dẫn ("theo mục 8"), không phải nhãn trang trí */
.legal-body h2 .num {
  flex: none; color: var(--gray-500); font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.legal-body h2 .num::after { content: '.'; }
.legal-body h3 {
  font-size: 16.5px; font-weight: 700; color: var(--night-3); margin: 22px 0 8px;
}
.legal-body p { margin-bottom: 14px; color: var(--gray-700); }
.legal-body ul, .legal-body ol { margin: 0 0 16px 0; padding-left: 0; list-style: none; }
.legal-body ul li {
  position: relative; padding-left: 24px; margin-bottom: 9px; color: var(--gray-700);
}
.legal-body ul li::before {
  content: ''; position: absolute; left: 8px; top: 12px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--blue-light);
}
.legal-body ol { counter-reset: li; }
.legal-body ol li {
  counter-increment: li; position: relative; padding-left: 26px;
  margin-bottom: 9px; color: var(--gray-700);
}
.legal-body ol li::before {
  content: counter(li) '.'; position: absolute; left: 0; top: 0;
  color: var(--blue); font-weight: 700; font-variant-numeric: tabular-nums;
}
.legal-body strong { color: var(--gray-900); font-weight: 600; }
.legal-body a:not(.btn) {
  color: var(--blue); font-weight: 500;
  border-bottom: 1px solid rgba(37,99,235,.3);
}
.legal-body a:not(.btn):hover { border-bottom-color: var(--blue); }

/* Hộp tóm tắt */
.summary {
  background: linear-gradient(135deg, #f8fbff, var(--gray-50));
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 22px 24px; margin-bottom: 34px;
}
.summary h2 {
  font-size: 13px !important; margin: 0 0 12px !important;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--blue); font-weight: 700;
  display: block !important;
}
.summary ul li { margin-bottom: 7px; font-size: 15px; }

/* Hộp lưu ý */
.note {
  background: #fffdf3; border: 1px solid #f0e3b5; border-radius: var(--radius);
  padding: 16px 20px; margin: 6px 0 20px; font-size: 15px; color: var(--gray-700);
}
.note strong { color: var(--night-2); }

/* Bảng */
.table-wrap { overflow-x: auto; margin: 0 0 18px; -webkit-overflow-scrolling: touch; }
.legal-body table { border-collapse: collapse; width: 100%; min-width: 480px; font-size: 14.5px; }
.legal-body th, .legal-body td {
  text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--gray-200);
  vertical-align: top;
}
.legal-body th {
  background: var(--gray-50); color: var(--night-2); font-weight: 600;
  font-size: 13.5px; white-space: nowrap;
}
.legal-body td { color: var(--gray-700); }

/* Thẻ liên hệ cuối trang */
.contact-card {
  margin-top: 40px; padding: 26px;
  background: var(--night-2); color: rgba(255,255,255,.8);
  border-radius: var(--radius-lg);
}
.contact-card h2 {
  color: var(--white) !important; font-size: 19px !important;
  margin: 0 0 10px !important; display: block !important;
}
.contact-card p { color: rgba(255,255,255,.78); margin-bottom: 8px; }
.contact-card a { color: var(--gold); font-weight: 600; }
.contact-card .btn { margin-top: 12px; }

/* ========== FOOTER ========== */
footer {
  background: var(--night-1); color: rgba(255,255,255,0.7);
  padding: 50px 0 30px; font-size: 14.5px;
}
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 30px; margin-bottom: 30px; }
.footer-col h5 { color: var(--white); font-weight: 700; margin-bottom: 14px; font-size: 15px; }
.footer-col p, .footer-col a { display: block; margin-bottom: 8px; transition: color .2s; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1); padding-top: 24px;
  text-align: center; color: rgba(255,255,255,0.5); font-size: 13.5px;
}

/* ========== NÚT ZALO NỔI ========== */
.zalo-float {
  position: fixed; bottom: 24px; right: 20px; z-index: 999;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; background: #0068ff; color: var(--white);
  border-radius: 999px; font-weight: 600; font-size: 14px;
  box-shadow: 0 10px 25px -5px rgba(0, 104, 255, 0.5);
}
.zalo-float:hover { transform: translateY(-2px); }
.zalo-float svg { width: 20px; height: 20px; }

/* ========== RESPONSIVE ========== */
@media (min-width: 640px) {
  .page-hero { padding: 60px 0 52px; }
  .page-hero h1 { font-size: 38px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .legal-wrap { padding: 56px 0 90px; }
  .legal-grid { grid-template-columns: 260px 1fr; gap: 56px; align-items: start; }
  .toc { position: sticky; top: 90px; }
  .legal-body h2 { font-size: 23px; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

/* ========== IN ẤN ========== */
@media print {
  header, footer, .zalo-float, .toc, .page-hero::after { display: none !important; }
  .page-hero { background: none; color: #000; padding: 0 0 18px; }
  .page-hero h1, .page-hero .lede, .updated { color: #000; }
  .legal-grid { display: block; }
  .contact-card { background: none; color: #000; border: 1px solid #999; }
  .contact-card h2, .contact-card p, .contact-card a { color: #000 !important; }
  body { font-size: 12pt; }
}
