/* Adwizr — public legal pages (app.adwizr.com/legal/*)
 *
 * These pages must load for a Play/App Store reviewer, a regulator, or a user on
 * a bad 3G connection with the app uninstalled — so they ship as static HTML with
 * no React bundle and NO third-party requests of any kind.
 *
 * Fonts are SELF-HOSTED (fonts/*.woff2), never a font CDN. A Google Fonts <link>
 * on a privacy policy would hand the reader's IP to a third party on the very page
 * that promises we don't do that. They are subset to latin + the punctuation these
 * pages actually use (— – ’ “ ” · … → ₹), which is why all six weights together
 * cost ~100 KB rather than ~2 MB of raw TTF. Regenerate with the subsetter if the
 * app's fonts change: src/assets/fonts/*.ttf -> web/legal/fonts/*.woff2.
 *
 * Tokens below MIRROR the app's design system (design-tokens.json) so the public
 * pages and the in-app screens read as one product:
 *   font    DM Serif Display (display) · Sora (UI/headings) · Inter (body)
 *   colour  the light "Birbal" glass theme — pastel gradient substrate, white
 *           glass surfaces, slate-blue accent #4A6480, ink #2A3845
 *   radius  xs 6 · sm 10 · md 14 · lg 20 · xl 24 · 2xl 32 · full 9999
 * The app has no dark mode (the older #0B0F0E/bronze "dark luxury" palette was
 * retired for Birbal), so these pages are deliberately light-only too — a page
 * that went dark while the app stayed light would be LESS consistent, not more.
 * Keep these values in sync with design-tokens.json; do not invent new ones.
 */

/* ---------- Fonts (self-hosted, subset) ---------- */
@font-face {
  font-family: 'Inter';
  src: url('/legal/fonts/inter-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/legal/fonts/inter-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/legal/fonts/inter-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/legal/fonts/inter-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Sora';
  src: url('/legal/fonts/sora-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'DM Serif Display';
  src: url('/legal/fonts/dmserif-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}

/* ---------- Tokens (mirrored from design-tokens.json) ---------- */
:root {
  /* font */
  --font-display: 'DM Serif Display', 'Cormorant Garamond', Georgia, serif;
  --font-ui: 'Sora', 'Inter', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* bg */
  --grad-start: #E8ECF0;
  --grad-mid: #F1F4F7;
  --grad-end: #F8FAFC;
  --bg: var(--grad-mid);
  --surface: rgba(255, 255, 255, 0.86);
  --surface-strong: rgba(255, 255, 255, 0.95);
  --surface-subtle: rgba(255, 255, 255, 0.60);

  /* text (ink) */
  --text: #2A3845;
  --secondary: #566678;
  --muted: #7E8B99;
  --dim: #A2ADB8;

  /* border */
  --border: rgba(56, 73, 89, 0.10);
  --border-input: rgba(56, 73, 89, 0.14);
  --border-glass: rgba(255, 255, 255, 0.80);

  /* accent — Birbal slate blue (the token is still named "gold" in the app) */
  --accent: #4A6480;
  --accent-light: #88BDF2;
  --accent-dark: #3C5168;
  --accent-text: #384959;
  --accent-soft: rgba(74, 100, 128, 0.12);

  /* status */
  --danger: #E0524A;
  --danger-soft: rgba(224, 82, 74, 0.12);
  --ok: #2FA56B;
  --ok-soft: rgba(47, 165, 107, 0.14);

  /* radius */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-full: 9999px;

  --maxw: 760px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  background-image: linear-gradient(180deg, var(--grad-start) 0%, var(--grad-mid) 42%, var(--grad-end) 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 24px 20px 80px; }

/* ---------- Chrome ---------- */
header.site {
  border-bottom: 1px solid var(--border);
  background: var(--surface-strong);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  position: sticky;
  top: 0;
  z-index: 10;
}
header.site .wrap { padding: 16px 20px; display: flex; align-items: center; gap: 12px; }
.brand {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  font-size: 22px;
  color: var(--text);
}
.brand span { color: var(--accent); }
.brand-sub {
  font-family: var(--font-ui);
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-left: auto;
}

/* ---------- Type ---------- */
/* header.site is sticky, so a heading scrolled to (or deep-linked via #anchor)
 * would otherwise land underneath it. Clear its height. */
h1, h2, h3 { scroll-margin-top: 84px; }

h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 32px 0 8px;
  color: var(--text);
}
h2 {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 40px 0 10px;
  padding-top: 6px;
  color: var(--text);
}
h3 {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.4;
  margin: 24px 0 6px;
  color: var(--accent-text);
}
p, li { color: var(--secondary); }
li { margin: 5px 0; }
ul { padding-left: 22px; }
li::marker { color: var(--accent); }
strong { color: var(--text); font-weight: 600; }
a { color: var(--accent); text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.updated {
  font-family: var(--font-ui);
  color: var(--dim);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 8px;
}
.lede { font-size: 17px; color: var(--secondary); }

/* ---------- Glass surfaces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border-glass);
  box-shadow: 0 1px 2px rgba(56, 73, 89, 0.04), 0 8px 24px rgba(56, 73, 89, 0.06);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  margin: 20px 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.card.warn { border-color: var(--danger); background: var(--danger-soft); box-shadow: none; }
.card.accent { border-color: var(--accent); background: var(--accent-soft); box-shadow: none; }
.card h2, .card h3 { margin-top: 0; }

/* ---------- Tables ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 15px;
  background: var(--surface-subtle);
  border-radius: var(--r-md);
  overflow: hidden;
}
th, td { text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th {
  font-family: var(--font-ui);
  color: var(--accent-text);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--accent-soft);
}
td { color: var(--secondary); }
.table-scroll { overflow-x: auto; border-radius: var(--r-md); }

/* ---------- Controls ---------- */
.btn {
  display: inline-block;
  border: 0;
  border-radius: var(--r-full);
  padding: 13px 24px;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--secondary); border: 1px solid var(--border-input); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:hover:not(:disabled) { filter: brightness(1.06); text-decoration: none; transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 2px; }
.btn-block { display: block; width: 100%; }

label {
  display: block;
  font-family: var(--font-ui);
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
  margin: 16px 0 6px;
}
input, textarea, select {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--border-input);
  border-radius: var(--r-sm);
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hint { font-size: 13px; color: var(--dim); margin-top: 6px; }

.msg { padding: 12px 14px; border-radius: var(--r-sm); margin: 14px 0; font-size: 15px; }
.msg-err { background: var(--danger-soft); color: var(--danger); }
.msg-ok { background: var(--ok-soft); color: var(--ok); }
.hidden { display: none !important; }

.steps {
  display: flex;
  gap: 8px;
  margin: 20px 0 4px;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--dim);
}
.steps div { flex: 1; padding-top: 8px; border-top: 3px solid var(--border-input); }
.steps div.on { border-top-color: var(--accent); color: var(--accent); font-weight: 600; }

.nav-list { list-style: none; padding: 0; margin: 0; }
.nav-list li { margin: 12px 0; }
.nav-list a { font-family: var(--font-ui); font-weight: 600; font-size: 17px; }
.nav-list p { margin: 2px 0 0; font-size: 14px; color: var(--muted); }

/* ---------- Footer ---------- */
footer.site {
  border-top: 1px solid var(--border);
  margin-top: 56px;
  padding-top: 20px;
  color: var(--dim);
  font-size: 13px;
}
footer.site a { color: var(--secondary); }
footer.site nav { margin-bottom: 10px; display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .btn:hover:not(:disabled) { transform: none; }
}
