/* Shared styling for the GENERATED answer pages: /faq/, /guide/ and their
 * /pl/ /uk/ /ru/ versions (landing/tools/build-pages.mjs writes the HTML).
 *
 * A separate file from legal.css on purpose: CI deletes legal.css together with
 * the legal pages while the trader identity is unset, and these pages must
 * never lose their styling because of that.
 *
 * Same-origin and tiny, so the "no external requests" rule still holds — no
 * webfont, no CDN. Tokens are copied from index.html's "Night desk" palette
 * (index.html stays one self-contained file); keep them in step when the
 * palette changes. Dark only, like the homepage: both colour-scheme hooks are
 * pinned to the same values so a light-asking client still gets this page.
 */
:root {
  --paper: #0E1113;
  --paper-raise: #171B20;
  --ink: #ECF1F5;
  --ink-soft: #93A0AC;
  --ink-body: #C9D3DC;
  --line: #252C33;
  --accent: #FF6B3D;      /* persimmon — CTA only */
  --accent-ink: #1A0A04;
  --green: #5CE1A6;       /* mint — live / trust accents, links */
  --serif: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root { --paper: #0E1113; --paper-raise: #171B20; --ink: #ECF1F5; --ink-soft: #93A0AC; --line: #252C33; }
}
:root[data-theme="light"], :root[data-theme="dark"] {
  --paper: #0E1113; --paper-raise: #171B20; --ink: #ECF1F5; --ink-soft: #93A0AC; --line: #252C33;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* The reading column: ≈ 68 characters of body text. Nav, main and footer share
   it so the page reads as one column on every width. */
.pg-row, .pg, .pg-col { width: min(68ch, calc(100% - 32px)); margin-inline: auto; }

/* ————— Nav ————— */
.pg-nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.pg-row { display: flex; align-items: center; gap: 14px; padding-block: 12px; }
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--serif); font-weight: 700; font-size: 18px; letter-spacing: -0.03em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand svg { flex: none; }
.langs { display: flex; gap: 0; margin-left: auto; }
/* Anchors, not buttons — each language is a real URL a crawler must discover. */
.langs a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 6px 8px;
  font-size: 12.5px; font-weight: 650; letter-spacing: .07em;
  color: var(--ink-soft); text-decoration: none;
}
.langs a:hover { color: var(--ink); }
.langs a.on { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 5px; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--accent); color: var(--accent-ink);
  border-radius: 10px; text-decoration: none;
  padding: 9px 16px; font-weight: 650; font-size: 14.5px; line-height: 1.3;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent),
              0 12px 34px -14px color-mix(in srgb, var(--accent) 75%, transparent);
}
.btn:hover { box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent),
                         0 18px 44px -14px color-mix(in srgb, var(--accent) 85%, transparent); }
.btn svg { flex: none; }
.btn-big { padding: 14px 22px; font-size: 16.5px; border-radius: 12px; }
@media (max-width: 640px) { .nav-cta { display: none; } }

/* ————— Document ————— */
.pg { padding: 28px 0 64px; }
.crumbs { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 26px; overflow-wrap: anywhere; }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs span[aria-hidden] { margin-inline: 4px; opacity: .6; }

.eyebrow {
  font-size: 12px; font-weight: 650; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 14px;
}
.eyebrow::before { content: ""; display: inline-block; width: 22px; height: 1px; background: var(--green); vertical-align: middle; margin-right: 10px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: -0.025em; text-wrap: balance; color: var(--ink); }
h1 { font-size: clamp(2rem, 6vw, 2.75rem); line-height: 1.1; margin: 0 0 12px; letter-spacing: -0.035em; }
.updated { color: var(--ink-soft); font-size: 14px; margin: 0 0 30px; }

.prose { overflow-wrap: break-word; }
.prose h2 { font-size: 1.45rem; line-height: 1.25; margin: 44px 0 12px; padding-top: 22px; border-top: 1px solid var(--line); }
.prose h3 { font-size: 1.12rem; line-height: 1.3; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--ink-body); }
.prose p { margin: 0 0 16px; }
.prose > p:first-child { font-size: 1.1rem; color: var(--ink); }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--green); }
.prose strong { color: var(--ink); font-weight: 650; }
.prose a, .next a { color: var(--green); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--green) 40%, transparent); }
.prose a:hover, .next a:hover { border-bottom-color: var(--green); }
.prose blockquote {
  margin: 0 0 20px; padding: 14px 18px;
  background: var(--paper-raise); border: 1px solid var(--line); border-left: 3px solid var(--green);
  border-radius: 10px; font-family: var(--mono); font-size: 14.5px; line-height: 1.7;
}
.prose blockquote p { margin: 0; color: var(--ink); }

/* Tables scroll inside their own box, so the page itself never scrolls
   sideways on a 390px phone. */
.tw { overflow-x: auto; margin: 4px 0 22px; border: 1px solid var(--line); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.tw table { border-collapse: collapse; width: 100%; min-width: 460px; font-size: 15px; line-height: 1.5; }
.tw th, .tw td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tw th { color: var(--ink); font-weight: 650; background: var(--paper-raise); font-size: 13.5px; }
.tw td { color: var(--ink-body); }
.tw .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tw tr:last-child td { border-bottom: none; }

/* ————— Q&A (the FAQ page and each guide's mini-FAQ) ————— */
.faq-list { border-top: 1px solid var(--line); margin-top: 8px; }
.qa { border-bottom: 1px solid var(--line); padding: 6px 0 8px; scroll-margin-top: 80px; }
.prose .qa h2, .prose .qa h3 { border-top: 0; padding-top: 0; margin: 22px 0 10px; font-size: 1.2rem; }
.qa-a > :last-child { margin-bottom: 14px; }
.mini-faq { margin-top: 12px; }
.mini-faq > h2 { margin-bottom: 4px; }

.guide-list { list-style: none; padding: 0; margin: 10px 0 0; border-top: 1px solid var(--line); }
.prose .guide-list li { padding: 16px 0; margin: 0; border-bottom: 1px solid var(--line); }
.guide-list a { font-weight: 650; font-size: 1.08rem; }
.sub { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 14.5px; line-height: 1.55; }

/* ————— CTA + read next ————— */
.cta {
  margin: 48px 0 0; padding: 26px 24px 24px;
  background: #121A19; border: 1px solid color-mix(in srgb, var(--green) 30%, var(--line)); border-radius: 14px;
}
.cta h2 { font-size: clamp(1.3rem, 3.6vw, 1.6rem); line-height: 1.2; margin: 0 0 10px; }
.cta p { color: var(--ink-soft); margin: 0 0 20px; }
.cta .hint { display: block; margin-top: 12px; font-size: 13px; color: var(--ink-soft); }

.next { margin-top: 44px; }
.next h2 { font-size: 1.1rem; margin: 0 0 6px; }
.next ul { list-style: none; padding: 0; margin: 0; }
.next li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.next .note { color: var(--ink-soft); font-size: 14px; }

/* ————— /start/ — the ad landing page (one phone screen to the CTA) —————
   Class names mirror the homepage hero (.trust) and stance band (.never). */
.start { padding-top: 6px; }
.start h1 { margin-bottom: 14px; }
.start .lede { font-size: 1.08rem; line-height: 1.6; color: var(--ink-body); margin: 0 0 18px; }
.trust { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 8px; }
.trust li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; font-size: 15px; line-height: 1.5; color: var(--ink-soft); }
.trust svg { color: var(--green); margin-top: 3px; }
.start-cta .hint { display: block; margin-top: 12px; font-size: 13px; color: var(--ink-soft); }
.stance { margin-top: 52px; padding-top: 30px; border-top: 1px solid var(--line); }
.stance h2 { font-size: clamp(1.4rem, 4.4vw, 1.75rem); line-height: 1.2; margin: 0 0 6px; }
.stance h2 em { font-style: normal; color: var(--green); }
.never { list-style: none; margin: 14px 0 0; padding: 0; }
.never li {
  display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: start;
  padding: 14px 0; border-top: 1px solid var(--line); font-size: 15.5px; line-height: 1.55; color: var(--ink-body);
}
.never li:last-child { border-bottom: 1px solid var(--line); }
.never svg { color: var(--accent); margin-top: 3px; }

/* Ad-measurement consent bar (/start/ only, shown only to ad clicks with a
   pixel configured). [hidden] must win over display:flex, or it would show to
   everyone. The body pads itself while the bar is up so nothing sits under it. */
.consent[hidden] { display: none; }
.consent {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px;
  padding: 14px max(16px, calc((100% - 68ch) / 2)) calc(14px + env(safe-area-inset-bottom));
  background: var(--paper-raise); border-top: 1px solid var(--line);
  box-shadow: 0 -18px 40px -20px rgba(0, 0, 0, .7);
}
.consent p { flex: 1 1 26em; margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-body); }
.consent-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.consent button {
  font: inherit; font-size: 14px; font-weight: 650; line-height: 1.3; cursor: pointer;
  min-height: 44px; padding: 10px 16px; border-radius: 10px;
}
/* Accept and decline look the same on purpose: EEA consent guidance wants
   refusing to be exactly as easy and as visible as agreeing. */
.consent-yes, .consent-no { background: transparent; color: var(--ink); border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent); }
.consent-yes:hover, .consent-no:hover { border-color: var(--ink); }
body.has-consent { padding-bottom: 190px; }

/* ————— Footer ————— */
.pg-foot { border-top: 1px solid var(--line); padding: 30px 0 44px; font-size: 14px; color: var(--ink-soft); }
.pg-foot p { margin: 0 0 12px; }
.foot-brand { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-family: var(--serif); font-weight: 700; color: var(--ink); font-size: 17px; }
.foot-brand span { font-family: var(--sans); font-weight: 400; font-size: 13px; color: var(--ink-soft); }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot-links a { color: var(--ink-soft); text-decoration: none; }
.foot-links a:hover { color: var(--ink); text-decoration: underline; }
.foot-note { font-size: 12.5px; opacity: .8; line-height: 1.6; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
