/* ============================================================
   Trang giấy tờ: điều khoản, bảo mật, thanh toán, miễn trừ.
   Cùng một khung chữ dài như bài viết blog, thêm mục lục dính
   đầu trang ở màn rộng.
   ============================================================ */

.legal-narrow {
  max-width: 780px;
}

/* ---------- đầu trang ---------- */

.legal-head {
  margin-bottom: 26px;
}
.legal-head .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.legal-head h1 {
  font-size: 1.9rem;
  line-height: 1.25;
  margin: 8px 0 10px;
}
@media (min-width: 720px) {
  .legal-head h1 {
    font-size: 2.4rem;
  }
}
.legal-lead {
  font-size: 1.05rem;
  line-height: 1.75;
  margin: 0;
}
.legal-updated {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 16px 0 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-size: 0.9rem;
  font-weight: 600;
}

/* ---------- mục lục ---------- */

.legal-toc {
  padding: 20px 22px;
  margin-bottom: 34px;
}
.legal-toc-title {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--primary-deep);
  margin: 0 0 10px;
}
.legal-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
@media (min-width: 640px) {
  .legal-toc ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 22px;
  }
}
.legal-toc a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.96rem;
  line-height: 1.5;
}
.legal-toc a:hover,
.legal-toc a:focus-visible {
  color: var(--primary-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- thân bài ----------
   Giãn dòng rộng + dòng ~70 ký tự: văn bản pháp lý đã khô rồi, chữ chen chúc
   nữa thì không ai đọc hết. */

.legal-content {
  font-size: 1.04rem;
  line-height: 1.8;
}
.legal-section + .legal-section {
  margin-top: 2.4em;
}
/* scroll-margin để bấm mục lục xong tiêu đề không dính sát mép trên */
.legal-section {
  scroll-margin-top: 24px;
}
.legal-section h2 {
  font-family: var(--font-head);
  font-size: 1.35rem;
  line-height: 1.35;
  color: var(--primary-deep);
  margin: 0 0 0.7em;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--line);
}
.legal-content p,
.legal-content ul,
.legal-content ol {
  margin: 0 0 1.05em;
}
.legal-content > .legal-section > *:last-child {
  margin-bottom: 0;
}
.legal-content ul,
.legal-content ol {
  padding-left: 1.35em;
}
.legal-content li + li {
  margin-top: 0.5em;
}
.legal-content a {
  color: var(--primary-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal-content strong {
  color: var(--ink);
  font-weight: 700;
}
.legal-content code {
  background: var(--bg-soft);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.9em;
  word-break: break-word;
}

/* Ghi chú mềm — mấy đoạn "xin bạn lưu ý" cần nổi hơn chữ thường một chút */
.legal-content .legal-note {
  background: var(--bg-soft);
  border-left: 4px solid var(--pink);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  font-size: 0.98rem;
}

/* Bảng: khung phải có min-width:0 thì mới co được trong grid/flex, nếu không
   bảng 500px kéo phình cả trang trên điện thoại (xem SPEC §12). */
.legal-table {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  margin: 0 0 1.05em;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.legal-table table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.legal-table th,
.legal-table td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.legal-table th {
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-family: var(--font-head);
  font-weight: 700;
  white-space: nowrap;
}
.legal-table tr:last-child td {
  border-bottom: 0;
}

/* ---------- hộp liên hệ ---------- */

.legal-contact {
  margin-top: 44px;
  padding: 26px 22px;
  text-align: center;
}
.legal-contact h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  margin: 0 0 8px;
}
.legal-contact p {
  margin: 0 0 18px;
}
.legal-contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.legal-contact-actions .btn {
  word-break: break-word;
}

/* ---------- điều hướng chéo ---------- */

.legal-others {
  margin-top: 40px;
}
.legal-others-title {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--primary-deep);
  margin: 0 0 14px;
}
.legal-others-grid {
  display: grid;
  gap: 12px;
}
@media (min-width: 640px) {
  .legal-others-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.legal-other {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.legal-other:hover,
.legal-other:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.legal-other .icon {
  flex: none;
  margin-top: 2px;
  color: var(--primary-deep);
}
.legal-other strong {
  display: block;
  font-family: var(--font-head);
  color: var(--primary-deep);
  margin-bottom: 2px;
}
.legal-other em {
  font-style: normal;
  font-size: 0.94rem;
  line-height: 1.5;
}
