/* ============================================================
   FixPing Legal Pages (Privacy & ToS) — shared shell + typography
   ============================================================ */

:root {
  --bg: #0a0a0a; --bg-2: #111111; --bg-3: #16161a;
  --card: #1a1a1a; --border: #2a2a2a; --border-strong: #3a3a3a;
  --text: #ffffff; --text-muted: #b8b8b8; --text-dim: #7a7a7a;
  --red: #CC0000; --red-hover: #ff1a1a; --red-dim: #990000; --red-glow: rgba(204, 0, 0, 0.35);
  --green: #00d97a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg); color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* ===== NAVBAR (shared with public site) ===== */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 22px;
  padding: 16px 0;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  flex: 0 0 auto;
}
.brand-mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 7px;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  color: #fff; flex-shrink: 0;
}
.brand-text {
  font-weight: 900; font-size: 19px; letter-spacing: 0.04em;
  color: #fff; text-transform: uppercase; line-height: 1;
}
.brand-text .x { color: var(--red-hover); }
.nav-links {
  display: flex; gap: 28px; align-items: center;
  min-width: 0;
}
.nav-links a {
  color: var(--text-muted); font-weight: 500; font-size: 15px;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }
.nav-cta {
  display: flex; gap: 12px; align-items: center;
  flex: 0 0 auto;
}
.nav-burger {
  display: none;
}
.nav-burger svg {
  width: 24px;
  height: 24px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 12px 22px;
  font-weight: 600; font-size: 14px;
  border-radius: 8px; cursor: pointer;
  transition: all 0.2s; font-family: inherit;
  text-decoration: none; border: none;
  white-space: nowrap;
}
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 4px 20px var(--red-glow); }
.btn-primary:hover { background: var(--red-hover); transform: translateY(-1px); }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: var(--card); border-color: var(--red); }
.lang-switch {
  position: relative;
  flex: 0 0 auto;
}
.lang-switch > button {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  min-height: 42px;
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  transition: all 0.2s;
}
.lang-switch > button:hover {
  color: var(--text);
  background: var(--card);
  border-color: var(--red);
}
.lang-switch > button svg {
  width: 12px; height: 12px;
  transition: transform 0.2s;
}
.lang-switch.open > button svg { transform: rotate(180deg); }
.lang-switch-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 172px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.36);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.18s;
  z-index: 200;
}
.lang-switch.open .lang-switch-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.lang-switch-item {
  display: flex; align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.25;
  cursor: pointer;
  white-space: nowrap;
}
.lang-switch-item:hover {
  color: var(--text);
  background: var(--bg-3);
}
.lang-switch-item.current {
  color: var(--red-hover);
  background: rgba(204, 0, 0, 0.08);
  font-weight: 600;
}
.lang-switch-item .flag {
  min-width: 19px;
  text-align: center;
}

/* ===== PAGE HERO ===== */
.page-hero {
  position: relative;
  padding: 70px 0 40px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.page-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 600px 300px at 50% 0%, rgba(204, 0, 0, 0.10), transparent 70%);
  pointer-events: none;
}
.breadcrumbs {
  position: relative; z-index: 1;
  color: var(--text-dim); font-size: 13px;
  margin-bottom: 18px;
  font-family: 'JetBrains Mono', monospace;
}
.breadcrumbs a { color: var(--text-dim); }
.breadcrumbs a:hover { color: var(--red-hover); }
.breadcrumbs .sep { margin: 0 8px; color: var(--border-strong); }
.page-hero h1 {
  position: relative; z-index: 1;
  font-size: clamp(34px, 4.5vw, 48px);
  font-weight: 900; letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 14px;
}
.page-hero h1 .accent { color: var(--red); }
.last-updated {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}
.last-updated svg { width: 12px; height: 12px; color: var(--red-hover); }

/* ===== LAYOUT: TOC + CONTENT ===== */
.legal-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 60px;
  padding: 50px 0 90px;
  align-items: flex-start;
}
.toc {
  position: sticky; top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-right: 14px;
}
.toc-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--text-dim);
  letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 14px;
  padding: 0 12px;
}
.toc ul { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.toc a {
  display: block;
  padding: 8px 12px;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
  transition: all 0.15s;
}
.toc a:hover {
  color: var(--text);
  background: var(--card);
  border-left-color: var(--border-strong);
}
.toc a.active {
  color: var(--red-hover);
  background: rgba(204, 0, 0, 0.06);
  border-left-color: var(--red);
  font-weight: 600;
}

/* ===== PROSE / CONTENT ===== */
.prose {
  max-width: 720px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.75;
}
.prose h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-top: 56px;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
  line-height: 1.25;
  padding-top: 14px;
  scroll-margin-top: 88px;
  display: flex; align-items: baseline; gap: 12px;
}
.prose h2:first-child { margin-top: 0; padding-top: 0; }
.prose h2 .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--red);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.prose h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-top: 26px;
  margin-bottom: 10px;
}
.prose p {
  margin-bottom: 16px;
}
.prose strong { color: var(--text); font-weight: 600; }
.prose a {
  color: var(--red-hover);
  border-bottom: 1px solid rgba(204, 0, 0, 0.3);
  transition: all 0.15s;
}
.prose a:hover {
  color: #fff;
  border-bottom-color: var(--red-hover);
}
.prose ul, .prose ol {
  margin: 12px 0 18px 20px;
  padding-left: 8px;
}
.prose ul li, .prose ol li {
  margin-bottom: 8px;
  padding-left: 4px;
}
.prose ul li::marker { color: var(--red); }
.prose ol li::marker { color: var(--red-hover); font-weight: 700; font-family: 'JetBrains Mono', monospace; }

.callout {
  display: flex; gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: 0 10px 10px 0;
  padding: 18px 20px;
  margin: 22px 0;
  font-size: 14px;
}
.callout svg { width: 18px; height: 18px; color: var(--red-hover); flex-shrink: 0; margin-top: 2px; }
.callout strong { color: var(--text); }

.contact-block {
  margin-top: 24px;
  padding: 22px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.85;
  color: var(--text-muted);
}
.contact-block strong { color: var(--text); display: block; margin-bottom: 6px; font-family: 'Inter', sans-serif; font-size: 15px; }

/* ===== FOOTER ===== */
footer {
  background: #050505;
  border-top: 1px solid var(--border);
  padding: 50px 0 30px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 50px;
}
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.footer-logo .brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 8px;
}
.footer-logo .brand-text {
  font-size: 22px;
}
.footer-about p {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 20px;
  max-width: 320px;
}
.footer-social {
  display: flex;
  gap: 10px;
}
.footer-social a {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  color: var(--text-muted);
  transition: all 0.2s;
}
.footer-social a:hover {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.footer-social svg {
  width: 16px;
  height: 16px;
}
.footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 16px;
}
.footer-col ul {
  list-style: none;
}
.footer-col li {
  margin-bottom: 10px;
}
.footer-col a {
  color: var(--text-dim);
  font-size: 14px;
  transition: color 0.2s;
}
.footer-col a:hover {
  color: var(--red-hover);
}
.footer-bottom {
  color: var(--text-dim); font-size: 13px;
  line-height: 1.7;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}
.footer-bottom strong { color: var(--text-muted); }
.footer-bottom a { color: var(--text-muted); }
.footer-bottom a:hover { color: var(--red-hover); }
.footer-legal {
  max-width: 720px;
}
.footer-policy {
  display: flex; gap: 16px; flex-wrap: wrap;
}
.footer-trademark {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  width: 100%;
  line-height: 1.6;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1000px) {
  .nav-links { gap: 18px; }
  .nav-cta { gap: 8px; }
  .btn { padding: 11px 16px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; }
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .toc {
    position: relative; top: 0;
    max-height: none;
    padding-right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 14px;
  }
  .toc ul { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
}
@media (max-width: 600px) {
  .toc ul { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-inner { gap: 12px; }
  .nav-cta { margin-left: auto; }
  .prose { font-size: 14.5px; }
  .prose h2 { font-size: 21px; }
}

/* iPhone 12 Pro and smaller */
@media (max-width: 420px) {
  .nav-logo .brand-text { display: none; }
  .container { padding: 0 18px; }
  .page-hero { padding: 50px 0 30px; }
  .page-hero h1 { font-size: 28px; }
  .breadcrumbs { font-size: 12px; margin-bottom: 14px; }
  .last-updated { font-size: 11px; padding: 5px 10px; }
  .legal-layout { padding: 30px 0 60px; gap: 22px; }
  .toc { padding: 14px 12px; }
  .toc a { padding: 7px 10px; font-size: 12.5px; }
  .prose { font-size: 14px; line-height: 1.65; }
  .prose h2 { font-size: 19px; margin-top: 40px; gap: 9px; }
  .prose h2 .num { font-size: 12.5px; }
  .prose h3 { font-size: 15.5px; margin-top: 20px; }
  .prose p, .prose ul li, .prose ol li { font-size: 14px; }
  .callout { padding: 14px 16px; font-size: 13px; gap: 12px; }
  .callout svg { width: 16px; height: 16px; }
  .contact-block { padding: 16px 18px; font-size: 12.5px; }
  .nav-cta .btn-ghost { display: none; }
  .nav-cta .btn-primary { padding: 10px 14px; font-size: 13px; }
  .nav-inner { padding: 12px 0; }
  .brand-text { font-size: 17px; }
  .footer-grid { grid-template-columns: 1fr; }
  footer { padding: 32px 0 24px; }
  .footer-policy { gap: 12px; font-size: 12px; }
}
