/* eOTP — trang pháp lý (/terms, /privacy, /en/terms, /en/privacy).
   Nạp SAU assets/lp-<md5 8>.css (landing): biến màu, nền #EEF2FC, thanh phụ, nav kính nổi, nút, footer panel xanh
   đều dùng chung từ lp.css — file này chỉ thêm phần thân văn bản pháp lý (tiền tố .lg-).
   Sửa file này thì PHẢI đổi dấu legal-<md5 8>.css trong 4 file legal/*.html + legal/en/*.html.
   Khuôn: thẻ trắng bo 24 không bóng (như thẻ infobip trong lp.css), khối đọc ≤ 860px căn giữa. Không thêm màu ngoài bảng
   (#0779B5 = sắc đậm của #28B8F8 cho chữ link trên nền trắng, đủ tương phản). */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.lg { position: relative; z-index: 1; padding: 24px 0 96px; --lg-text: #1B1A19; --lg-line: #E5EEF5; --lg-link: #0779B5; }
.lg-wrap { width: min(860px, calc(100% - 48px)); margin-inline: auto; }

/* ---------- Đầu văn bản (trên nền loang, ngoài thẻ) ---------- */
.lg-head { padding: 40px 0 40px; text-align: center; }
.lg-pill {
  display: inline-flex; align-items: center; min-height: 36px; padding: 6px 16px; border-radius: 999px;
  background: var(--glass-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: var(--glass-border); box-shadow: 0 4px 16px rgba(17, 17, 17, .06), inset 0 1px 0 rgba(255, 255, 255, .95);
  font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--ink);
}
.lg-title { margin: 20px 0 0; font-size: 48px; line-height: 1.16; font-weight: 600; letter-spacing: -1px; color: var(--ink); text-wrap: balance; }
.lg-meta { margin: 16px 0 0; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.lg-meta b { color: var(--ink); font-weight: 600; }

/* ---------- Thẻ đọc ---------- */
.lg-card { padding: 56px 64px 48px; background: #fff; border-radius: 24px; color: var(--lg-text); overflow-wrap: anywhere; }
.lg-card p, .lg-card li, .lg-card dd { font-size: 17px; line-height: 1.7; color: var(--lg-text); text-wrap: pretty; }
.lg-card p { margin: 0 0 16px; }
.lg-card b, .lg-card strong { color: var(--ink); font-weight: 600; }
.lg-card a { color: var(--lg-link); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(7, 121, 181, .35); }
.lg-card a:hover { text-decoration-color: currentColor; }
.lg-card .lg-lead { font-size: 18px; }
.lg-card .lg-meta { margin: 20px 0 0; font-size: 15px; color: var(--ink-2); }

/* Hộp ghi chú */
.lg-note { margin: 8px 0 24px; padding: 16px 20px; border-radius: 16px; background: var(--blue-soft); }
.lg-card .lg-note p, .lg-card .lg-note li { font-size: 15.5px; line-height: 1.6; text-wrap: wrap; }
.lg-note p:last-child, .lg-note ul:last-child { margin-bottom: 0; }

/* ---------- Mục lục: thẻ 2 cột ---------- */
.lg-toc { margin: 32px 0 8px; padding: 24px; border-radius: 20px; background: var(--bg); }
.lg-card .lg-toc-title { margin: 0 0 14px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.lg-toc ol { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lg-card .lg-toc li { margin: 0; font-size: 15px; line-height: 1.4; }
.lg-card .lg-toc a {
  display: flex; gap: 10px; height: 100%; padding: 12px 14px; border-radius: 14px; background: #fff;
  font-size: 15px; font-weight: 500; line-height: 1.4; color: var(--ink); text-decoration: none; transition: background .2s, color .2s;
}
.lg-card .lg-toc a:hover { background: var(--blue-soft); color: var(--lg-link); }
.lg-n { flex: none; min-width: 24px; color: var(--blue-d); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Mục nội dung ---------- */
.lg-sec { margin-top: 40px; padding-top: 40px; border-top: 1px solid var(--lg-line); scroll-margin-top: 120px; }
.lg-sec h2 { margin: 0 0 18px; font-size: 28px; line-height: 1.25; font-weight: 600; letter-spacing: -.4px; color: var(--ink); text-wrap: balance; }
.lg-sec h3 { margin: 28px 0 10px; font-size: 20px; line-height: 1.35; font-weight: 600; color: var(--ink); }
.lg-sec ul, .lg-sec ol { margin: 0 0 16px; padding-left: 24px; }
.lg-sec li { margin: 0 0 8px; }
.lg-sec li::marker { color: var(--blue-d); font-weight: 600; }
.lg-sec dl { margin: 0 0 16px; }
.lg-sec dt { margin-top: 14px; font-size: 17px; font-weight: 600; color: var(--ink); }
.lg-sec dd { margin: 4px 0 0; padding-left: 16px; border-left: 2px solid var(--blue-soft); }

/* Bảng */
.lg-table-wrap { margin: 8px 0 20px; overflow-x: auto; border: 1px solid var(--lg-line); border-radius: 16px; }
.lg-card table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.55; }
.lg-card th, .lg-card td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--lg-line); color: var(--lg-text); overflow-wrap: normal; }
.lg-card thead th { background: var(--bg); color: var(--ink); font-size: 14px; font-weight: 600; }
.lg-card tbody tr:last-child td { border-bottom: 0; }

/* Liên hệ + về đầu trang */
.lg-sec .lg-contact { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 6px; }
.lg-contact li { margin: 0; }
.lg-pending { color: var(--ink-2); font-style: italic; }
.lg-card .lg-top {
  display: inline-flex; align-items: center; height: 40px; margin-top: 20px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--ink); color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; transition: background .2s;
}
.lg-card .lg-top:hover { background: rgba(17, 17, 17, .05); }

/* Mục lục: JS cuối trang bọc nội dung <nav.lg-toc> vào <details.lg-toc-d> (tiêu đề nằm trong <summary>).
   Màn rộng: luôn mở, summary trông y như tiêu đề cũ. ≤760: thu gọn mặc định, chạm "Mục lục" để mở. */
.lg-toc-d > summary { display: block; list-style: none; }
.lg-toc-d > summary::-webkit-details-marker { display: none; }

/* ---------- Màn vừa ---------- */
@media (max-width: 1100px) {
  .lg-card { padding: 48px 48px 40px; }
}

/* ---------- iPad + điện thoại (< 1280): đoạn văn ≤ ~75 ký tự/dòng; bảng còn rộng hơn khung thì cuộn ngang có mờ mép ---------- */
@media (max-width: 1279px) {
  .lg-card > .lg-lead, .lg-sec > p, .lg-sec > ul, .lg-sec > ol, .lg-sec > dl, .lg-note > p, .lg-note > ul { max-width: 36em; }
  .lg-table-wrap {
    background:
      linear-gradient(90deg, #fff 30%, rgba(255, 255, 255, 0)) left / 32px 100% no-repeat local,
      linear-gradient(270deg, #fff 30%, rgba(255, 255, 255, 0)) right / 32px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(17, 17, 17, .16), rgba(17, 17, 17, 0)) left / 14px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(17, 17, 17, .16), rgba(17, 17, 17, 0)) right / 14px 100% no-repeat scroll;
    -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  }
}
@media (max-width: 1023px) {
  /* Dạng bảng (761–1023, hoặc ≤760 khi không có JS): ô không hẹp dưới 140px, bảng ≥ 600px → cuộn trong khung */
  .lg-card table { min-width: 600px; }
  .lg-card th, .lg-card td { min-width: 140px; }
}

/* ---------- Di động ---------- */
@media (max-width: 760px) {
  .lg { padding: 8px 0 64px; }
  .lg-wrap { width: calc(100% - 32px); }
  .lg-head { padding: 28px 0 28px; }
  .lg-pill { font-size: 13px; }
  .lg-title { margin-top: 16px; font-size: 34px; line-height: 1.2; letter-spacing: -.5px; }
  .lg-meta { font-size: 14px; }
  .lg-card { padding: 28px 20px 28px; border-radius: 20px; }
  .lg-card p, .lg-card li, .lg-card dd { font-size: 16px; }
  .lg-card .lg-lead { font-size: 17px; }
  .lg-toc { padding: 16px; margin-top: 24px; }
  .lg-toc ol { grid-template-columns: minmax(0, 1fr); }
  .lg-sec { margin-top: 32px; padding-top: 32px; scroll-margin-top: 84px; }
  .lg-sec h2 { font-size: 22px; }
  .lg-sec h3 { font-size: 18px; }
  .lg-sec dt { font-size: 16px; }
  .lg-card table { font-size: 14px; }
  .lg-card th, .lg-card td { padding: 10px 12px; }
  .lg-sec { scroll-margin-top: 112px; }
  .lg-sec ul, .lg-sec ol { padding-left: 20px; }
  .lg-sec li ul, .lg-sec li ol { padding-left: 18px; }

  /* Mục lục thu gọn (chỉ khi JS đã bọc <details>) */
  .lg-toc.is-fold { padding: 0 16px; }
  .lg-toc-d > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .lg-card .lg-toc-d > summary .lg-toc-title { margin: 0; font-size: 14px; }
  .lg-toc-d > summary::after {
    content: ""; flex: none; width: 9px; height: 9px; margin-right: 4px; border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2);
    transform: translateY(-3px) rotate(45deg); transition: transform .2s;
  }
  .lg-toc-d[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
  .lg-toc-d[open] > ol { padding-bottom: 16px; }

  /* Bảng → thẻ dọc (bê khuôn docs/docs.css): mỗi hàng một thẻ, mỗi ô có nhãn cột phía trên (JS chép <th> vào data-label).
     Không có JS thì giữ dạng bảng 600px cuộn ngang trong khung, có mờ mép. */
  .lg-card table.is-stack { min-width: 0; }
  .lg-card table.is-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lg-card table.is-stack, .lg-card table.is-stack tbody, .lg-card table.is-stack tr { display: block; width: 100%; }
  .lg-card table.is-stack tr { padding: 14px 16px; border-bottom: 1px solid var(--lg-line); }
  .lg-card table.is-stack tbody tr:last-child { border-bottom: 0; }
  .lg-card table.is-stack td { display: block; min-width: 0; padding: 0; border: 0; font-size: 16px; line-height: 1.55; overflow-wrap: anywhere; }
  .lg-card table.is-stack td + td { margin-top: 10px; }
  .lg-card table.is-stack td:first-child { font-weight: 600; color: var(--ink); }
  .lg-card table.is-stack td::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 13px; font-weight: 700; line-height: 1.4; color: var(--ink-2); }
  .lg-card table.is-stack td:empty { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .lg-card .lg-toc a, .lg-card .lg-top, .lg-toc-d > summary::after { transition: none; }
}
