/* ─── Dino Søgur — legal pages (privacy + support) ──────────────────────── *
 * Self-contained styles for static HTML pages served via Vercel under /privacy
 * and /support. Mirrors the Dino brand from apps/admin/src/styles/tokens.css
 * without depending on the React bundle. Supports light/dark via
 * prefers-color-scheme + print-friendly output.                              *
 * ────────────────────────────────────────────────────────────────────────── */

:root {
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;

  --c-bg: #f6f7fb;
  --c-surface: #ffffff;
  --c-text: #0f172a;
  --c-text-muted: #475569;
  --c-text-soft: #94a3b8;
  --c-border: #e5e7eb;
  --c-brand: #4f46e5;
  --c-brand-strong: #4338ca;
  --c-brand-soft: #eef2ff;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-9: 56px;

  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;

  --sh-2: 0 4px 12px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-bg: #0b1120;
    --c-surface: #111c33;
    --c-text: #f1f5f9;
    --c-text-muted: #cbd5e1;
    --c-text-soft: #64748b;
    --c-border: #1f2b44;
    --c-brand: #818cf8;
    --c-brand-strong: #a5b4fc;
    --c-brand-soft: rgba(99, 102, 241, 0.18);
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--c-brand);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--c-brand-strong);
}

code {
  font-family: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, Consolas,
    monospace;
  font-size: 0.9em;
  background: var(--c-brand-soft);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.legal-header {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: saturate(150%) blur(8px);
}

.legal-header__inner {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-5);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}

.legal-header__brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  color: var(--c-text);
}

.legal-header__brand:hover {
  color: var(--c-text);
}

.legal-header__logo {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--sh-2);
}

.legal-header__logo img {
  width: 100%;
  height: 100%;
  display: block;
}

.legal-header__title {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.legal-header__sub {
  font-size: 12px;
  color: var(--c-text-muted);
  margin-top: 2px;
}

.legal-header__lang {
  margin-left: auto;
  display: flex;
  gap: var(--sp-1);
  background: var(--c-brand-soft);
  border-radius: var(--r-pill);
  padding: 4px;
}

.legal-header__lang a {
  display: inline-block;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text-muted);
  transition: background 120ms ease, color 120ms ease;
}

.legal-header__lang a:hover {
  color: var(--c-text);
  background: rgba(255, 255, 255, 0.5);
}

@media (prefers-color-scheme: dark) {
  .legal-header__lang a:hover {
    background: rgba(255, 255, 255, 0.06);
  }
}

/* ── Article ────────────────────────────────────────────────────────────── */
.legal-main {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-5) var(--sp-9);
}

.legal-section {
  margin-top: var(--sp-9);
  padding-top: var(--sp-7);
  border-top: 1px solid var(--c-border);
}

.legal-section:first-of-type {
  margin-top: var(--sp-7);
  padding-top: 0;
  border-top: none;
}

.legal-section__lang-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-brand);
  background: var(--c-brand-soft);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  margin-bottom: var(--sp-3);
}

h1 {
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 var(--sp-3);
  font-weight: 800;
}

h2 {
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: var(--sp-7) 0 var(--sp-3);
  font-weight: 700;
  scroll-margin-top: 80px;
}

h3 {
  font-size: 15px;
  line-height: 1.4;
  margin: var(--sp-5) 0 var(--sp-2);
  font-weight: 600;
  color: var(--c-text-muted);
}

p {
  margin: 0 0 var(--sp-4);
  color: var(--c-text);
}

ul,
ol {
  margin: 0 0 var(--sp-4);
  padding-left: 24px;
}

li {
  margin-bottom: var(--sp-2);
}

.legal-lead {
  font-size: 17px;
  color: var(--c-text-muted);
  margin-bottom: var(--sp-6);
}

.legal-meta {
  font-size: 13px;
  color: var(--c-text-soft);
  margin-bottom: var(--sp-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

/* ── FAQ blocks ─────────────────────────────────────────────────────────── */
.faq {
  display: grid;
  gap: var(--sp-3);
  margin: var(--sp-4) 0 var(--sp-6);
}

.faq details {
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-surface);
  transition: border-color 120ms ease;
}

.faq details[open] {
  border-color: var(--c-brand);
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-size: 22px;
  font-weight: 400;
  color: var(--c-text-soft);
  line-height: 1;
  transition: transform 200ms ease;
}

.faq details[open] summary::after {
  transform: rotate(45deg);
}

.faq details > *:not(summary) {
  margin-top: var(--sp-3);
}

/* ── Contact block (support page) ──────────────────────────────────────── */
.contact-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  margin: var(--sp-5) 0;
  box-shadow: var(--sh-2);
}

.contact-card__email {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.contact-card__email a {
  text-decoration: none;
  color: var(--c-brand);
}

.contact-card__email a:hover {
  text-decoration: underline;
}

.contact-card__sub {
  margin-top: var(--sp-2);
  color: var(--c-text-muted);
  font-size: 14px;
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
.legal-footer {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--sp-6) var(--sp-5) var(--sp-9);
  border-top: 1px solid var(--c-border);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--c-text-muted);
}

.legal-footer__links {
  display: flex;
  gap: var(--sp-5);
}

.legal-footer__links a {
  color: var(--c-text-muted);
}

/* ── Print styles ───────────────────────────────────────────────────────── */
@media print {
  .legal-header__lang,
  .legal-footer__links {
    display: none;
  }
  .legal-header {
    position: static;
    border-bottom: 2px solid #000;
    background: #fff;
    backdrop-filter: none;
  }
  body {
    color: #000;
    background: #fff;
    font-size: 11pt;
    line-height: 1.45;
  }
  h1 {
    font-size: 22pt;
  }
  h2 {
    font-size: 14pt;
    page-break-after: avoid;
  }
  .legal-section {
    break-inside: avoid-page;
  }
  a {
    color: #000;
    text-decoration: underline;
  }
  a[href^="http"]::after,
  a[href^="mailto:"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #444;
  }
}

/* ── Small screens ──────────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .legal-header__inner {
    padding: var(--sp-3) var(--sp-4);
    gap: var(--sp-2);
  }
  .legal-header__title {
    font-size: 14px;
  }
  .legal-header__sub {
    display: none;
  }
  .legal-header__lang {
    padding: 3px;
  }
  .legal-header__lang a {
    padding: 5px 10px;
    font-size: 12px;
  }
  .legal-main {
    padding: var(--sp-6) var(--sp-4) var(--sp-8);
  }
  h1 {
    font-size: 26px;
  }
  h2 {
    font-size: 18px;
  }
  .legal-lead {
    font-size: 15px;
  }
}
