/* ──────────────────────────────────────────────────────────────
   Shared shell for the legal / contact pages.
   Mirrors the design tokens used inline by the landing page so the
   two stay visually identical in both themes.
   ────────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #08090d;
  --bg2: #0f1117;
  --bg3: #14161e;
  --border: rgba(255,255,255,0.07);
  --border-light: rgba(255,255,255,0.13);
  --text: #f0f0f5;
  --text-muted: rgba(240,240,245,0.42);
  --text-mid: rgba(240,240,245,0.68);
  --blue: #4a7cf7;
  --blue-dim: rgba(74,124,247,0.15);
  --blue-border: rgba(74,124,247,0.3);
  --green: #5ec98a;
  --green-dim: rgba(94,201,138,0.1);
  --nav-bg: rgba(8,9,13,0.9);
  --grid-line: rgba(255,255,255,0.022);
  --tag-bg: rgba(255,255,255,0.04);
  --hover-border: rgba(255,255,255,0.28);
}

[data-theme="light"] {
  --bg: #f5f6f9;
  --bg2: #ffffff;
  --bg3: #eceef3;
  --border: rgba(10,15,30,0.09);
  --border-light: rgba(10,15,30,0.17);
  --text: #12141c;
  --text-muted: rgba(18,20,28,0.48);
  --text-mid: rgba(18,20,28,0.72);
  --blue-dim: rgba(74,124,247,0.1);
  --green-dim: rgba(52,150,95,0.1);
  --nav-bg: rgba(245,246,249,0.9);
  --grid-line: rgba(10,15,30,0.035);
  --tag-bg: rgba(10,15,30,0.045);
  --hover-border: rgba(10,15,30,0.32);
}

:root:not([data-theme="light"]) img.logo-light { display: none; }
[data-theme="light"] img.logo-dark { display: none; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 18px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}
body > * { position: relative; z-index: 1; }

/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 5vw, 64px);
  height: 64px;
  border-bottom: 1px solid var(--border);
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
}
/* keep the sticky nav below the consent bar while it is open */
.consent-open nav { top: var(--consent-h, 0px); }
.nav-logo { display: flex; align-items: center; }
.nav-logo img { height: 36px; display: block; }
.theme-toggle {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text-mid);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.theme-toggle:hover { border-color: var(--hover-border); color: var(--text); }
.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }

/* ── PAGE SHELL ── */
.legal-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 64px clamp(24px, 5vw, 40px) 96px;
}
.legal-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  border-radius: 100px;
  padding: 5px 14px;
  margin-bottom: 24px;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
a.legal-eyebrow:hover { border-color: var(--hover-border); color: var(--text); }

/* ── LEGAL TYPOGRAPHY ── */
.legal-body { color: var(--text-mid); }

.legal-body h1 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(34px, 5vw, 48px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 8px;
}
.legal-body h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(22px, 3vw, 27px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 52px 0 14px;
  scroll-margin-top: 88px;
}
.legal-body h3 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 32px 0 10px;
  scroll-margin-top: 88px;
}
.legal-body p,
.legal-body > div { margin-bottom: 14px; }
.legal-body strong { color: var(--text); font-weight: 600; }
.legal-body em { font-style: italic; }
.legal-body u { text-decoration: none; color: var(--text); font-weight: 600; }

.legal-body a {
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid var(--blue-border);
  transition: border-color 0.2s;
  overflow-wrap: anywhere;
}
.legal-body a:hover { border-bottom-color: var(--blue); }

.legal-body ul { margin: 6px 0 18px 22px; }
.legal-body li { margin-bottom: 6px; list-style-type: square; }
.legal-body li::marker { color: var(--blue); }
.legal-body ul ul { margin-top: 6px; }
.legal-body ul ul li { list-style-type: circle; }

.legal-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 26px;
  font-size: 16px;
  display: block;
  overflow-x: auto;
}
.legal-body th,
.legal-body td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}
.legal-body th {
  background: var(--bg3);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}

.legal-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--tag-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* Termly hooks that survive the transform */
.legal-body [data-custom-class="title"] h1 { margin-bottom: 0; }
.legal-body [data-custom-class="subtitle"] {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
}
.legal-body [data-custom-class="heading_1"],
.legal-body [data-custom-class="heading_2"] { display: block; }

/* Callout used by the hand-written pages */
.legal-note {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: 10px;
  padding: 18px 22px;
  margin: 26px 0;
  color: var(--text-mid);
}
.legal-note strong { color: var(--text); }

.legal-updated {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 40px;
}

/* ── BUTTONS ── */
.btn-primary {
  background: var(--blue);
  color: #fff; border: none;
  padding: 12px 22px; border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 17px; font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: default; transform: none; }

.btn-ghost {
  background: transparent;
  color: var(--text-mid);
  border: 1px solid var(--border-light);
  padding: 12px 22px; border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 17px; font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-ghost:hover { border-color: var(--hover-border); color: var(--text); }

/* ── FORMS ── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}
.field .hint { font-size: 13px; color: var(--text-muted); }
.field input,
.field select,
.field textarea {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--border-light);
  border-radius: 9px;
  padding: 12px 14px;
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%237c7f8c' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--text-muted); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue-border);
  box-shadow: 0 0 0 3px var(--blue-dim);
}
.field.invalid input,
.field.invalid select,
.field.invalid textarea { border-color: #e2617a; }
.field .error {
  font-size: 13px;
  color: #e2617a;
  display: none;
}
.field.invalid .error { display: block; }

.form-consent {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 14px;
  color: var(--text-mid);
  margin-bottom: 22px;
}
.form-consent input {
  width: 17px; height: 17px;
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--blue);
  cursor: pointer;
}
.form-consent a { color: var(--blue); text-decoration: none; border-bottom: 1px solid var(--blue-border); }
.form-consent.invalid { color: #e2617a; }

.form-status {
  display: none;
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 15px;
  margin-top: 18px;
}
.form-status.ok {
  display: block;
  background: var(--green-dim);
  border: 1px solid rgba(94,201,138,0.35);
  color: var(--text);
}
.form-status.err {
  display: block;
  background: rgba(226,97,122,0.1);
  border: 1px solid rgba(226,97,122,0.35);
  color: var(--text);
}

@media (max-width: 620px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ── FOOTER ── */
footer {
  background: var(--bg2);
  padding: 36px clamp(24px, 5vw, 64px);
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 20px;
}
.footer-logo img { height: 30px; opacity: 0.45; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a,
.footer-links button {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px; color: var(--text-muted);
  background: none; border: none; padding: 0;
  cursor: pointer;
  text-decoration: none; transition: color 0.2s;
}
.footer-links a:hover,
.footer-links button:hover { color: var(--text); }
.footer-copy { font-size: 15px; color: var(--text-muted); }
