/* f-callbox terms – nhận diện Gcalls / Callbox (tím #673ab7). Responsive, sáng/tối. */
:root {
  --brand: #673ab7;
  --brand-600: #5e35b1;
  --brand-dark: #4527a0;
  --brand-deep: #2a1659;
  --brand-soft: #ede7f6;
  --brand-light: #f6f2fc;
  --accent: #b39ddb;
  --bg: #f7f5fb;
  --surface: #ffffff;
  --fg: #1f1b2e;
  --muted: #615b73;
  --border: #e6e0f2;
  --link: #5e35b1;
  --mark: #fff3bf;
  --shadow: 0 1px 2px rgba(42, 22, 89, .06), 0 8px 24px rgba(42, 22, 89, .08);
  --header-h: 64px;
  --sidebar-w: 290px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #9575cd;
    --brand-600: #a58bd8;
    --brand-dark: #b39ddb;
    --brand-deep: #120a26;
    --brand-soft: #2b2045;
    --brand-light: #1e1730;
    --accent: #7e57c2;
    --bg: #110d1b;
    --surface: #1a1427;
    --fg: #eeeaf6;
    --muted: #aaa3bd;
    --border: #2e2542;
    --link: #c5b3ef;
    --mark: #5c4a00;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body.terms-page {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.7 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
        "Noto Sans", "Noto Sans SC", "Noto Sans JP", "Noto Sans KR", "PingFang SC", "Hiragino Sans", "Malgun Gothic", sans-serif;
}
a { color: var(--link); text-underline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 60; }
.skip:focus { left: 8px; }

/* Header */
.t-header {
  position: sticky; top: 0; z-index: 30; height: var(--header-h);
  display: flex; align-items: center; gap: 12px; padding: 0 24px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(42, 22, 89, .04);
}
.t-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: linear-gradient(90deg, var(--brand-dark), var(--brand), var(--accent));
}
.t-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--fg); min-width: 0; }
.t-brand img { height: 34px; width: auto; display: block; }
.t-brand span {
  font-weight: 600; font-size: 14px; color: var(--brand); background: var(--brand-soft);
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
.t-spacer { flex: 1; }
.t-lang { display: flex; align-items: center; gap: 6px; color: var(--brand); }
.t-lang svg { flex: none; }
.t-lang select {
  appearance: none; font: inherit; font-size: 14px; font-weight: 500; color: var(--fg); background-color: var(--brand-light);
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 32px 8px 12px; max-width: 46vw; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--brand) 50%), linear-gradient(135deg, var(--brand) 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
.t-lang select:hover { border-color: var(--accent); }
.t-menu-btn {
  display: none; align-items: center; justify-content: center; width: 42px; height: 42px; flex: none;
  border: 0; border-radius: 12px; background: var(--brand); color: #fff; cursor: pointer;
}
.t-menu-btn:hover { background: var(--brand-dark); }
.t-menu-btn:focus-visible, .t-lang select:focus-visible, .t-nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Hero */
.t-hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(900px 300px at 85% -40%, rgba(179, 157, 219, .55), transparent 60%),
    radial-gradient(600px 260px at 0% 120%, rgba(94, 53, 177, .9), transparent 70%),
    linear-gradient(120deg, var(--brand-deep) 0%, #4527a0 45%, #673ab7 100%);
}
.t-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .14;
  background-image: radial-gradient(rgba(255,255,255,.9) 1px, transparent 1px); background-size: 22px 22px;
  mask-image: linear-gradient(90deg, transparent 40%, #000);
}
.t-hero-in { position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; padding: 40px 24px 44px calc(24px + var(--sidebar-w) + 40px); }
.t-eyebrow { margin: 0 0 8px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #d9ccf3; }
.t-hero h1 { margin: 0; font-size: clamp(26px, 4vw, 40px); line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
.t-hero .terms-meta {
  display: inline-block; margin: 14px 0 0; padding: 5px 12px; border-radius: 999px; font-size: 14px;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); color: #f3eefc;
}

/* Layout */
.t-layout { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); gap: 32px; max-width: 1200px; margin: -24px auto 0; padding: 0 24px; position: relative; z-index: 2; }
.t-nav {
  position: sticky; top: calc(var(--header-h) + 16px); align-self: start; max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto;
  padding: 18px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
}
.t-nav h2 { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin: 2px 0 10px 12px; }
.t-nav ul { list-style: none; margin: 0; padding: 0; }
.t-nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin: 2px 0; border-radius: 10px;
  color: var(--fg); text-decoration: none; font-size: 15px; line-height: 1.35; transition: background .15s, color .15s;
}
.t-nav a svg { color: var(--accent); flex: none; }
.t-nav a:hover { background: var(--brand-light); color: var(--brand); }
.t-nav a:hover svg { color: var(--brand); }
.t-nav a[aria-current="page"] {
  background: linear-gradient(120deg, var(--brand-dark), var(--brand)); color: #fff; font-weight: 600;
  box-shadow: 0 4px 12px rgba(103, 58, 183, .3);
}
.t-nav a[aria-current="page"] svg { color: #fff; }
.t-contact { margin: 18px 4px 0; padding: 14px; border-radius: 12px; background: var(--brand-light); font-size: 14px; color: var(--muted); line-height: 1.6; }
.t-contact strong { color: var(--brand-dark); display: block; margin-bottom: 4px; }
.t-nav .t-contact a { display: inline; padding: 0; margin: 0; font-size: inherit; color: var(--link); background: none; box-shadow: none; word-break: break-all; }

.t-main { min-width: 0; padding-bottom: 48px; }
.t-notice {
  background: #fff8e6; border: 1px solid #f4dfa6; border-left: 4px solid #f0b429; color: #5b4300;
  border-radius: 12px; padding: 10px 14px; font-size: 14px; margin: 0 0 16px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .t-notice { background: #2a2210; border-color: #4a3c14; color: #f3dc9b; } }

/* Document */
.terms-doc {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
  padding: 36px 44px 44px;
}
.terms-doc > :first-child { margin-top: 0; }
.terms-doc h1 { font-size: 28px; line-height: 1.25; margin: 0 0 6px; }
.terms-doc h2 {
  position: relative; font-size: 20px; line-height: 1.35; margin: 34px 0 10px; padding-left: 14px; color: var(--brand-dark);
}
.terms-doc h2::before { content: ""; position: absolute; left: 0; top: .2em; bottom: .2em; width: 4px; border-radius: 4px; background: linear-gradient(var(--brand), var(--accent)); }
.terms-doc h3 { font-size: 17px; margin: 22px 0 6px; color: var(--brand); }
.terms-doc .terms-meta { color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.terms-doc ul, .terms-doc ol { padding-left: 1.3em; }
.terms-doc li { margin: 5px 0; }
.terms-doc li::marker { color: var(--brand); }
.terms-doc strong { color: var(--fg); }
.terms-doc table { border-collapse: separate; border-spacing: 0; width: 100%; margin: 16px 0; font-size: 15px; display: block; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.terms-doc th, .terms-doc td { border-bottom: 1px solid var(--border); padding: 10px 14px; text-align: left; vertical-align: top; }
.terms-doc tr:last-child td { border-bottom: 0; }
.terms-doc th { background: var(--brand); color: #fff; font-weight: 600; }
.terms-doc tbody tr:nth-child(even) td { background: var(--brand-light); }
.terms-todo { background: var(--mark); color: inherit; padding: 0 2px; }

/* Index cards */
.t-cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.t-cards a {
  display: flex; flex-direction: column; gap: 12px; padding: 18px; height: 100%;
  border: 1px solid var(--border); border-radius: 14px; text-decoration: none; color: var(--fg); background: var(--surface);
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.t-cards a:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 10px 24px rgba(103, 58, 183, .16); }
.t-card-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--brand-dark), var(--brand)); }

/* Footer */
.t-footer { background: var(--brand-deep); color: #cfc3ea; font-size: 14px; line-height: 1.6; }
.t-footer-in { max-width: 1200px; margin: 0 auto; padding: 28px 24px; display: flex; flex-wrap: wrap; gap: 18px 48px; justify-content: space-between; }
.t-footer strong { color: #fff; }
.t-footer a { color: #fff; }
.t-backdrop { display: none; }

/* Mobile: ngăn kéo danh mục */
@media (max-width: 900px) {
  .t-header { padding: 0 12px; }
  .t-menu-btn { display: inline-flex; }
  .t-brand img { height: 28px; }
  .t-brand span { display: none; }
  .t-hero-in { padding: 28px 16px 40px; }
  .t-layout { display: block; padding: 0 12px; margin-top: -22px; z-index: auto; }
  .t-nav {
    position: fixed; z-index: 40; top: 0; left: 0; bottom: 0; width: min(86vw, 320px); max-height: none; height: 100%;
    border-radius: 0 16px 16px 0; transform: translateX(-105%); transition: transform .22s ease; padding-top: 20px;
  }
  body.t-nav-open { overflow: hidden; }
  body.t-nav-open .t-nav { transform: none; }
  body.t-nav-open .t-backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(20, 10, 45, .45); }
  .terms-doc { padding: 22px 18px 28px; border-radius: 14px; }
  .terms-doc h2 { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { .t-nav, .t-cards a { transition: none; } }
