/* Shared styling for Reply's legal pages (Terms + Privacy, CN + International).
   Matches the marketing site's light, quiet aesthetic (see ../styles.css) but is
   self-contained so a legal page never depends on the landing page's JS/CSS. */

:root {
  --bg: #fff;
  --fg: #151515;
  --fg-mid: #4d4d4d;
  --fg-dim: #8a8a8a;
  --line: rgba(21, 21, 21, 0.1);
  --line-strong: rgba(21, 21, 21, 0.16);
  --accent: #1778c8;
  --panel: #fbfbfa;
  --sans: "Helvetica Neue", -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Segoe UI", sans-serif;
  --wrap: 820px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  color: var(--fg);
  font-family: var(--sans);
  background:
    linear-gradient(rgba(21, 21, 21, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 21, 21, 0.022) 1px, transparent 1px),
    var(--bg);
  background-size: 22px 22px, 22px 22px, 100% 100%;
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }

/* ---- top bar ---------------------------------------------------------- */
.legal-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(18px, 5vw, 40px);
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.legal-nav .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-weight: 720;
  font-size: 15px;
}

.legal-nav .brand img { width: 30px; height: 30px; }

.legal-nav-end { display: inline-flex; align-items: center; gap: 8px; }

.legal-nav a.back,
.lang-toggle {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--fg-mid);
  font-size: 13px;
  font-weight: 640;
}

.legal-nav a.back:hover,
.lang-toggle:hover { color: var(--fg); text-decoration: none; border-color: var(--fg-dim); }

/* ---- document --------------------------------------------------------- */
.legal-wrap {
  width: min(calc(100vw - 34px), var(--wrap));
  margin: 0 auto;
  padding: clamp(40px, 7vw, 88px) 0 120px;
}

.legal-eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.legal-wrap h1 {
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.1;
  letter-spacing: -0.035em;
  font-weight: 780;
}

.legal-meta {
  margin-top: 16px;
  color: var(--fg-dim);
  font-size: 14px;
  font-weight: 620;
}

.legal-meta .entity { color: var(--fg-mid); }

.legal-lede {
  margin-top: 26px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  color: var(--fg-mid);
  font-size: 15.5px;
  line-height: 1.75;
}

.legal-lede strong { color: var(--fg); font-weight: 720; }

/* cross-links between the two jurisdiction versions */
.legal-switch {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 13.5px;
  color: var(--fg-dim);
}
.legal-switch a { font-weight: 640; }
.legal-switch .sep { color: var(--line-strong); }

section.term {
  padding: 30px 0;
  border-top: 1px solid var(--line);
}
section.term:first-of-type { border-top: none; }

section.term h2 {
  font-size: 21px;
  line-height: 1.3;
  letter-spacing: -0.02em;
  font-weight: 740;
  scroll-margin-top: 76px;
}

section.term h3 {
  margin-top: 22px;
  font-size: 16px;
  font-weight: 720;
  color: var(--fg);
}

section.term p { margin-top: 12px; color: var(--fg-mid); font-size: 15.5px; }
section.term p:first-of-type { margin-top: 16px; }

section.term ul, section.term ol { margin: 12px 0 0 0; padding-left: 22px; color: var(--fg-mid); font-size: 15.5px; }
section.term li { margin-top: 8px; }
section.term strong { color: var(--fg); font-weight: 700; }

/* recipient / data table */
.legal-table-wrap { margin-top: 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table.legal-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
table.legal-table th, table.legal-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--fg-mid);
  vertical-align: top;
}
table.legal-table th { color: var(--fg); font-weight: 720; background: var(--panel); }
table.legal-table tr:last-child td { border-bottom: none; }

.callout {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  background: #f6fafd;
  font-size: 14.5px;
  color: var(--fg-mid);
}
.callout strong { color: var(--fg); }

.legal-foot {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--fg-dim);
  font-size: 13px;
  line-height: 1.7;
}

/* language visibility — legal.js toggles [data-lang] blocks */
[data-lang] { display: none; }
body[data-active-lang="zh"] [data-lang="zh"] { display: revert; }
body[data-active-lang="en"] [data-lang="en"] { display: revert; }

@media (max-width: 620px) {
  .legal-nav .brand span { display: none; }
  section.term h2 { font-size: 19px; }
}
