/* public-site.css — shared design for all public pages (extracted from the landing page design).
   Tokens, light/dark/auto theme, header, footer, buttons. */
/* ───────── Design tokens ───────── */
:root {
  --bg: #F8FAFC;
  --bg-alt: #EEF2F7;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --border: rgba(15, 23, 42, .10);
  --border-strong: rgba(15, 23, 42, .18);
  --text: #0F172A;
  --text-2: #334155;
  --muted: #526179;
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --primary-soft: rgba(79, 70, 229, .10);
  --primary-text: #4338CA;
  --on-primary: #FFFFFF;
  --success: #047857;
  --success-soft: rgba(5, 150, 105, .12);
  --warn: #B45309;
  --warn-soft: rgba(217, 119, 6, .14);
  --code-bg: #0F172A;
  --code-text: #E2E8F0;
  --code-muted: #94A3B8;
  --shadow: 0 1px 2px rgba(15,23,42,.06), 0 8px 24px -12px rgba(15,23,42,.14);
  --shadow-lg: 0 24px 60px -24px rgba(79,70,229,.35);
  --glow: rgba(79, 70, 229, .12);
  --header-bg: rgba(248, 250, 252, .82);
  --radius: 12px;
  --radius-lg: 18px;
  --maxw: 1200px;
  --font-head: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #090D16;
  --bg-alt: #0C1220;
  --surface: #0F172A;
  --surface-2: #162036;
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);
  --text: #F1F5F9;
  --text-2: #CBD5E1;
  --muted: #94A3B8;
  --primary: #4F46E5;
  --primary-hover: #6366F1;
  --primary-soft: rgba(129, 140, 248, .14);
  --primary-text: #A5B4FC;
  --on-primary: #FFFFFF;
  --success: #34D399;
  --success-soft: rgba(52, 211, 153, .14);
  --warn: #FBBF24;
  --warn-soft: rgba(251, 191, 36, .14);
  --code-bg: #060A14;
  --code-text: #E2E8F0;
  --code-muted: #7C8BA5;
  --shadow: 0 1px 3px rgba(0,0,0,.35);
  --shadow-lg: 0 24px 60px -24px rgba(79,70,229,.45);
  --glow: rgba(99, 102, 241, .18);
  --header-bg: rgba(9, 13, 22, .78);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #090D16;
    --bg-alt: #0C1220;
    --surface: #0F172A;
    --surface-2: #162036;
    --border: rgba(255, 255, 255, .08);
    --border-strong: rgba(255, 255, 255, .16);
    --text: #F1F5F9;
    --text-2: #CBD5E1;
    --muted: #94A3B8;
    --primary: #4F46E5;
    --primary-hover: #6366F1;
    --primary-soft: rgba(129, 140, 248, .14);
    --primary-text: #A5B4FC;
    --on-primary: #FFFFFF;
    --success: #34D399;
    --success-soft: rgba(52, 211, 153, .14);
    --warn: #FBBF24;
    --warn-soft: rgba(251, 191, 36, .14);
    --code-bg: #060A14;
    --code-text: #E2E8F0;
    --code-muted: #7C8BA5;
    --shadow: 0 1px 3px rgba(0,0,0,.35);
    --shadow-lg: 0 24px 60px -24px rgba(79,70,229,.45);
    --glow: rgba(99, 102, 241, .18);
    --header-bg: rgba(9, 13, 22, .78);
    color-scheme: dark;
  }
}

/* ───────── Base ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background-color .25s ease, color .25s ease;
}
img, svg { max-width: 100%; }
a { color: var(--primary-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); color: var(--text); margin: 0; line-height: 1.2; letter-spacing: -.02em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--primary-hover); outline-offset: 3px; border-radius: 6px; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 2000; }
.skip-link:focus { top: 12px; text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }

/* ───────── Buttons ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none !important;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 18px -8px rgba(79,70,229,.7); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-lg { padding: 14px 24px; font-size: 16px; border-radius: 12px; }
.btn-light { background: #fff; color: #3730A3; }
.btn-light:hover { background: #EEF2FF; }
.btn-ghost-light { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.35); }
.btn-ghost-light:hover { background: rgba(255,255,255,.2); }

/* ───────── Header ───────── */
.header {
  position: sticky; top: 0; z-index: 1000;
  background: var(--header-bg); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s ease, box-shadow .2s ease;
}
.header.scrolled { border-bottom-color: var(--border); box-shadow: 0 6px 24px -16px rgba(0,0,0,.35); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--font-head); font-weight: 800; font-size: 21px; letter-spacing: -.03em; text-decoration: none !important; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 18px; background: linear-gradient(135deg, #4F46E5, #2563EB); box-shadow: 0 6px 16px -6px rgba(79,70,229,.7); }
.nav { display: flex; align-items: center; gap: 2px; }
.nav a { color: var(--text-2); font-weight: 500; font-size: 14.5px; padding: 8px 12px; border-radius: 8px; text-decoration: none; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.header-actions { display: flex; align-items: center; gap: 10px; }

.theme-switch { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.theme-switch button { width: 32px; height: 30px; border: 0; background: transparent; border-radius: 999px; color: var(--muted); display: grid; place-items: center; font-size: 15px; transition: background-color .15s, color .15s; }
.theme-switch button:hover { color: var(--text); }
.theme-switch button[aria-pressed="true"] { background: var(--primary); color: #fff; }

.menu-toggle { display: none; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 22px; align-items: center; justify-content: center; }
.mobile-panel { display: none; }

/* ───────── Footer ───────── */
.footer { background: var(--surface); border-top: 1px solid var(--border); padding: 64px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.4fr 1fr; gap: 36px; }
.footer p.about { color: var(--muted); font-size: 14.5px; margin: 14px 0 18px; max-width: 320px; }
.footer h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--text); margin-bottom: 16px; font-weight: 700; }
.footer li { margin-bottom: 10px; }
.footer li a { color: var(--muted); font-size: 14.5px; }
.footer li a:hover { color: var(--text); }
.footer li a.blog-link { display: block; line-height: 1.4; }
.socials { display: flex; gap: 10px; }
.socials a { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); display: grid; place-items: center; color: var(--text-2); font-size: 17px; }
.socials a:hover { color: #fff; background: var(--primary); border-color: var(--primary); text-decoration: none; }
.footer-bottom { margin-top: 48px; padding-top: 22px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 13.5px; }
.footer-bottom a { color: var(--muted); text-decoration: underline; }

/* ───────── Reveal on scroll (JS only) ───────── */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 1100px) {
  .nav { display: none; }
  .menu-toggle { display: inline-flex; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .apps { grid-template-columns: repeat(4, 1fr); }
  .country-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 960px) { .section { padding: 68px 0; } }
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: 1 / -1; }
  .header-actions .btn-ghost, .header-actions .login-btn { display: none; }
  .theme-switch button { width: 30px; }
}
.mobile-panel.open { display: block; position: fixed; top: 68px; left: 0; right: 0; z-index: 999; background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 16px 20px; box-shadow: 0 24px 40px -20px rgba(0,0,0,.45); max-height: calc(100vh - 68px); overflow-y: auto; }
.mobile-panel a.m-link { display: block; padding: 13px 8px; color: var(--text); font-weight: 600; border-bottom: 1px solid var(--border); text-decoration: none; }
.mobile-panel .m-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.backdrop { display: none; position: fixed; inset: 68px 0 0 0; background: rgba(0,0,0,.5); z-index: 998; }
.backdrop.open { display: block; }
@media (min-width: 1101px) { .mobile-panel, .backdrop { display: none !important; } }
@media (max-width: 480px) {
  .header-actions > .btn-primary { display: none; }
  .header-actions { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ═════════════════════════════════════════════════════════════
   Public page components (terms, privacy, about, contact, feedback, blog, docs)
   ═════════════════════════════════════════════════════════════ */
.nav a.active { color: var(--primary-text); background: var(--primary-soft); }
.main-pad { padding-bottom: 72px; }

/* Page hero */
.page-hero { position: relative; padding: 56px 0 44px; text-align: center; overflow: hidden; border-bottom: 1px solid var(--border); background: var(--bg-alt); }
.page-hero::before { content: ""; position: absolute; top: -220px; left: 50%; width: 900px; height: 420px; transform: translateX(-50%); background: radial-gradient(closest-side, var(--glow), transparent); pointer-events: none; }
.page-hero .container { position: relative; }
.page-hero h1 { font-size: clamp(30px, 4.2vw, 46px); font-weight: 800; letter-spacing: -.035em; line-height: 1.1; }
.page-hero .lead { margin: 14px auto 0; max-width: 700px; color: var(--muted); font-size: 17px; }
.page-hero .eyebrow { margin-bottom: 14px; }
.crumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; font-size: 13.5px; color: var(--muted); margin-bottom: 16px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.eyebrow { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary-text); background: var(--primary-soft); padding: 5px 12px; border-radius: 999px; }

/* Narrow reading column + cards */
.doc-section { padding: 48px 0 24px; }
.doc-narrow { max-width: 860px; }
.doc-stack { display: grid; gap: 18px; }
.doc-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px 28px; box-shadow: var(--shadow); }
.doc-card h2 { font-size: 20px; font-weight: 700; margin-bottom: 10px; }
.doc-card p, .doc-card li { color: var(--text-2); font-size: 15.5px; }
.doc-card p + p { margin-top: 10px; }
.doc-card ol, .doc-card ul { margin: 12px 0 0 1.25rem; padding: 0; list-style: revert; }
.doc-card li { margin-bottom: 6px; }
.doc-card strong { color: var(--text); }
.doc-note { text-align: center; color: var(--muted); font-size: 15px; margin-top: 28px; }

/* Layout with sticky table of contents (terms) */
.doc-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 36px; padding: 44px 0 24px; align-items: start; }
.toc { position: sticky; top: 90px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 14px; max-height: calc(100vh - 120px); overflow-y: auto; }
.toc-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 8px 10px; }
.toc a { display: block; padding: 7px 10px; border-radius: 8px; color: var(--text-2); font-size: 14px; font-weight: 500; text-decoration: none; }
.toc a:hover { background: var(--surface-2); color: var(--text); }
.toc a.active { background: var(--primary-soft); color: var(--primary-text); font-weight: 600; }
.toc-toggle { display: none; }
.prose-sec { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px 30px; margin-bottom: 18px; scroll-margin-top: 90px; box-shadow: var(--shadow); }
.prose-sec h2 { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.prose-sec h2 .num { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 15px; color: var(--primary-text); background: var(--primary-soft); }
.prose-sec h3 { font-size: 17px; margin: 18px 0 8px; }
.prose-sec p, .prose-sec li { color: var(--text-2); font-size: 15.5px; }
.prose-sec p { margin-bottom: 10px; }
.prose-sec ul, .prose-sec ol { margin: 8px 0 14px 1.25rem; list-style: revert; padding: 0; }
.prose-sec li { margin-bottom: 6px; }
.prose-sec strong { color: var(--text); }
.callout { display: flex; gap: 12px; align-items: flex-start; border-radius: 12px; padding: 14px 16px; margin: 14px 0; font-size: 15px; color: var(--text-2); border: 1px solid var(--border); }
.callout i { font-size: 18px; margin-top: 2px; flex: none; }
.callout.warn { background: var(--warn-soft); border-color: rgba(217,119,6,.35); }
.callout.warn i { color: var(--warn); }
.callout.info { background: var(--primary-soft); border-color: rgba(99,102,241,.3); }
.callout.info i { color: var(--primary-text); }
.callout strong { color: var(--text); }
.cta-band { margin: 28px 0 8px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 34px 24px; box-shadow: var(--shadow); }
.cta-band h3 { font-size: 22px; margin-bottom: 8px; }
.cta-band p { color: var(--muted); max-width: 560px; margin: 0 auto 18px; }
.cta-band .small { margin-top: 16px; font-size: 13px; color: var(--muted); }

/* Forms */
.form-wrap { max-width: 640px; margin: 0 auto; padding: 44px 0 24px; }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 30px; box-shadow: var(--shadow); }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=url], .field select, .field textarea {
  width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text);
  font: inherit; font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field .hint { margin-top: 5px; font-size: 12.5px; color: var(--muted); }
.msg { border-radius: 12px; padding: 13px 16px; margin-bottom: 18px; font-size: 14.5px; border: 1px solid transparent; }
.msg.success { background: var(--success-soft); color: var(--success); border-color: rgba(5,150,105,.3); }
.msg.error { background: rgba(220,38,38,.1); color: #DC2626; border-color: rgba(220,38,38,.3); }
:root[data-theme="dark"] .msg.error { color: #F87171; }
.stars { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.stars input { position: absolute; opacity: 0; pointer-events: none; }
.stars label { font-size: 30px; line-height: 1; color: var(--border-strong); cursor: pointer; margin: 0; transition: color .12s, transform .12s; }
.stars label:hover, .stars label:hover ~ label, .stars input:checked ~ label { color: #F59E0B; }
.stars label:hover { transform: scale(1.12); }
.stars input:focus-visible + label { outline: 2px solid var(--primary-hover); border-radius: 4px; }
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow); }
.info-card .icon-tile { margin-bottom: 12px; }
.info-card h3 { font-size: 16px; margin-bottom: 6px; }
.info-card p { color: var(--muted); font-size: 14.5px; }
.icon-tile { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; color: var(--primary-text); background: var(--primary-soft); }

@media (max-width: 960px) {
  .doc-layout { grid-template-columns: 1fr; gap: 18px; }
  .toc { position: static; max-height: none; }
  .info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .page-hero { padding: 40px 0 32px; }
  .doc-card, .prose-sec, .form-card { padding: 22px 18px; }
}
details.toc > summary { list-style: none; cursor: default; }
details.toc > summary::-webkit-details-marker { display: none; }
@media (max-width: 960px) {
  details.toc > summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
  details.toc > summary::after { content: "\F282"; font-family: "bootstrap-icons"; font-size: 14px; transition: transform .2s; }
  details.toc[open] > summary::after { transform: rotate(180deg); }
}

/* About */
.about-split { display: grid; grid-template-columns: 1.2fr .8fr; gap: 48px; align-items: center; }
.about-split h2 { font-size: clamp(26px, 3.2vw, 36px); font-weight: 800; margin-bottom: 14px; }
.about-split p { color: var(--text-2); margin-bottom: 14px; }
.about-accent { color: var(--primary-text) !important; font-weight: 600; }
.about-visual { aspect-ratio: 1 / 1; max-width: 340px; width: 100%; margin: 0 auto; border-radius: 28px; display: grid; place-items: center; font-size: 110px; color: var(--primary-text);
  background: radial-gradient(closest-side, var(--glow), transparent), var(--primary-soft); border: 1px solid var(--border); }
.stats4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 52px; }
.stat-tile { text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px 12px; box-shadow: var(--shadow); }
.stat-number { font-family: var(--font-head); font-weight: 800; font-size: 32px; letter-spacing: -.03em; }
.stat-label { font-weight: 600; margin-top: 2px; }
.stat-desc { color: var(--muted); font-size: 13.5px; }
.section-head { max-width: 760px; margin: 0 auto 44px; text-align: center; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; }
.section-head p { margin-top: 12px; color: var(--muted); font-size: 17px; }
.section { padding: 72px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow); transition: border-color .2s, transform .2s; }
.feat-card:hover { border-color: rgba(99,102,241,.45); transform: translateY(-3px); }
.feat-card .icon-tile { margin-bottom: 14px; }
.feat-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.feat-card p { color: var(--muted); font-size: 15px; }
.num-tile { font-family: var(--font-head); font-weight: 800; font-size: 20px; }
.feat-card.team { text-align: center; }
.feat-card.team .icon-tile { margin: 0 auto 14px; width: 64px; height: 64px; border-radius: 50%; font-size: 28px; }
.team-role { color: var(--primary-text); font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
@media (max-width: 960px) {
  .about-split { grid-template-columns: 1fr; gap: 28px; }
  .stats4 { grid-template-columns: repeat(2, 1fr); }
  .cards3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) { .cards3 { grid-template-columns: 1fr; } .section { padding: 52px 0; } .about-visual { font-size: 80px; max-width: 220px; } }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.hint-line { text-align: center; color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }
.form-wrap .cta-band { margin-top: 24px; }
