/* FiledNorth shared styles. */

/* ---------- Tokens ---------- */
* { box-sizing: border-box; }
:root {
  /* colour */
  --ink: #1c2420;
  --ink-soft: #3d4741;
  --muted: #68736c;
  --bg: #fdfdfc;
  --surface: #ffffff;
  --card: #f5f7f4;
  --card-line: #dde3dc;
  --line: #e3e7e2;
  --line-strong: #c9d1c8;
  --accent: #1d6b3c;
  --accent-deep: #14522c;
  --accent-tint: #eef4ee;
  --accent-ink: #ffffff;
  --warn-bg: #fdf6e0;
  --warn-line: #ddc069;
  --warn-ink: #5c4a08;
  --error-bg: #fbeeee;
  --error-line: #d9a3a3;
  --error-ink: #7c2323;
  --disabled-bg: #8a8a8a;
  --disabled-ink: #f2f2f2;

  /* type */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino,
    Georgia, "Times New Roman", serif;
  --fs-caption: 13px;
  --fs-small: 14.5px;
  --fs-body: 17px;
  --fs-lede: 19px;
  --fs-h3: 19px;
  --fs-h2: 24px;
  --fs-h1: 40px;
  --fs-total: 34px;
  --lh-body: 1.65;
  --lh-tight: 1.18;

  /* spacing (4pt scale) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  --s6: 32px; --s7: 48px; --s8: 64px;

  --radius: 6px;
  --radius-lg: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e9ede9;
    --ink-soft: #c3cbc3;
    --muted: #97a198;
    --bg: #131613;
    --surface: #171b17;
    --card: #1b201b;
    --card-line: #2e362e;
    --line: #2a302a;
    --line-strong: #3d463d;
    --accent: #4cb877;
    --accent-deep: #6fcb92;
    --accent-tint: #1d2a20;
    --accent-ink: #0b120c;
    --warn-bg: #38300f;
    --warn-line: #8a6d2f;
    --warn-ink: #ecd9a0;
    --error-bg: #3a1d1d;
    --error-line: #7c4444;
    --error-ink: #f0b9b9;
  }
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}
.wrap { max-width: 800px; margin: 0 auto; padding: var(--s5) 20px var(--s8); }
p { margin: 0 0 var(--s4); }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
::selection { background: var(--accent-tint); }

/* ---------- Header ---------- */
header.site {
  display: flex; align-items: baseline; gap: var(--s3) var(--s5);
  flex-wrap: wrap;
  padding: var(--s2) 0 var(--s4);
  border-bottom: 1px solid var(--line-strong);
}
header.site .brand {
  font-family: var(--font-display);
  font-size: 26px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none; margin-right: auto;
}
header.site nav { display: flex; gap: var(--s2) var(--s5); flex-wrap: wrap; }
header.site nav a {
  color: var(--muted); text-decoration: none; font-size: 15px;
  padding: var(--s1) 0; border-bottom: 2px solid transparent;
}
header.site nav a:hover { color: var(--ink); }
header.site nav a[aria-current="page"] {
  color: var(--ink); font-weight: 600; border-bottom-color: var(--accent);
}

/* ---------- Notices & honesty elements ---------- */
.preview {
  background: var(--warn-bg); color: var(--warn-ink);
  border: 1px solid var(--warn-line); border-left: 4px solid var(--warn-line);
  border-radius: var(--radius);
  padding: var(--s3) var(--s4); font-size: var(--fs-small);
  margin: var(--s5) 0 0; text-align: left;
}
.preview strong { font-weight: 700; }
/* First-class honesty box: hairline frame, accent rule, small caps label. */
.honesty {
  background: var(--surface);
  border: 1px solid var(--line-strong); border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: var(--s5); margin: var(--s6) 0;
}
.honesty .honesty-label {
  display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: var(--s2);
}
.honesty p:last-child { margin-bottom: 0; }
.honesty.warn { border-left-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); }
.honesty.warn .honesty-label { color: var(--warn-ink); }

/* ---------- Headings & hero ---------- */
.eyebrow {
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--accent);
  margin: var(--s7) 0 var(--s3);
}
h1 {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.015em;
  font-size: var(--fs-h1); line-height: var(--lh-tight);
  margin: 0 0 var(--s4); max-width: 22em;
}
.hero { padding-bottom: var(--s6); border-bottom: 1px solid var(--line); margin-bottom: var(--s6); }
.hero .sub { margin-bottom: 0; }
.sub, .lede { font-size: var(--fs-lede); line-height: 1.55; color: var(--ink-soft); max-width: 38em; }
h2 {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em;
  font-size: var(--fs-h2); line-height: 1.25;
  margin: var(--s7) 0 var(--s3);
}
h2:first-child { margin-top: 0; }
h3 { font-size: var(--fs-h3); line-height: 1.35; margin: var(--s5) 0 var(--s2); }
section { margin: 0 0 var(--s7); }
section:last-of-type { margin-bottom: 0; }

/* On-this-page anchor nav (guidance, product pages) */
.toc {
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5);
  font-size: var(--fs-small); margin: 0 0 var(--s6);
  padding: var(--s3) 0; border-bottom: 1px solid var(--line);
}
.toc span { color: var(--muted); font-weight: 600; }
.toc a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.toc a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Cards & panels ---------- */
.card {
  background: var(--card); border: 1px solid var(--card-line);
  border-radius: var(--radius-lg); padding: var(--s5); margin: var(--s5) 0;
}
.card b.big, .card .big {
  font-family: var(--font-display); font-size: 22px; font-weight: 700;
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
/* The calculator is the hero tool of its page: white surface, strong frame. */
.tool {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius-lg); padding: var(--s5); margin: var(--s5) 0;
}
.tool h2 { margin-top: 0; }
.tool > :last-child { margin-bottom: 0; }

/* ---------- Lists: steps & checklists ---------- */
ul, ol { padding-left: 22px; margin: 0 0 var(--s4); }
li { margin: var(--s2) 0; }
li::marker { color: var(--accent); font-weight: 700; }
ol.steps { list-style: none; padding-left: 0; counter-reset: step; }
ol.steps > li {
  counter-increment: step; position: relative;
  padding-left: 52px; margin: 0 0 var(--s5); min-height: 36px;
}
ol.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: -2px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid var(--accent); color: var(--accent);
  font-weight: 700; font-size: 16px; line-height: 34px; text-align: center;
  background: var(--bg);
}
ol.steps > li:last-child { margin-bottom: 0; }
ul.checks { list-style: none; padding-left: 0; }
ul.checks > li { position: relative; padding-left: 28px; margin: var(--s3) 0; }
ul.checks > li::before {
  content: ""; position: absolute; left: 2px; top: 9px;
  width: 11px; height: 6px;
  border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent);
  transform: rotate(-45deg);
}

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; margin: var(--s4) 0 var(--s5); font-size: var(--fs-small); font-variant-numeric: tabular-nums; }
th, td { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: var(--s3); text-align: left; vertical-align: top; }
th { font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); background: var(--card); border-top: 1px solid var(--line-strong); }
td ul { margin-bottom: 0; }

/* Price tiers (converted from the comparison table, same text) */
.tiers { display: grid; grid-template-columns: 1fr; gap: var(--s4); margin: var(--s4) 0 var(--s5); }
@media (min-width: 640px) { .tiers { grid-template-columns: 1fr 1fr; } }
.tier { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); padding: var(--s5); }
.tier h3 { margin-top: 0; font-family: var(--font-display); }
.tier ul { margin-bottom: 0; }
/* Two-stream comparison cards (same text as the former tables) */
.streams { display: grid; grid-template-columns: 1fr; gap: var(--s4); margin: var(--s4) 0 var(--s5); }
@media (min-width: 640px) { .streams { grid-template-columns: 1fr 1fr; } }
.stream { background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius-lg); padding: var(--s5); }
.stream h3 { margin-top: 0; font-size: 17px; }
.stream > :last-child { margin-bottom: 0; }

/* ---------- Buttons & actions ---------- */
.btn {
  display: block; text-align: center; background: var(--accent); color: var(--accent-ink);
  font-family: var(--font-body);
  font-size: 17px; font-weight: 600; line-height: 1.3;
  padding: 15px var(--s5); border: 1px solid var(--accent); border-radius: var(--radius);
  margin: var(--s5) 0 var(--s2); text-decoration: none; width: 100%;
  cursor: pointer; min-height: 52px;
}
.btn:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn.primary { font-size: 18px; padding: 17px var(--s5); }
/* Disabled placeholders must read as disabled at a glance. Keep this rule
   last among button rules so nothing overrides it. */
.btn.disabled, .btn:disabled, button:disabled {
  background: var(--disabled-bg); color: var(--disabled-ink); border-color: var(--disabled-bg);
  opacity: .62; cursor: not-allowed; pointer-events: none; box-shadow: none;
}
.btnnote { text-align: center; font-size: var(--fs-caption); color: var(--muted); margin: 0 0 var(--s4); }
.action-row { margin: var(--s5) 0; max-width: 420px; }
.action-row .btn { margin-top: 0; }

/* ---------- Forms ---------- */
label { display: block; font-weight: 600; font-size: var(--fs-small); margin: var(--s5) 0 var(--s1); }
label:first-of-type { margin-top: var(--s4); }
.help { font-size: var(--fs-caption); color: var(--muted); margin: 0 0 var(--s2); }
input, select {
  width: 100%; font-size: 16px; line-height: 1.4;
  padding: 11px 12px; border: 1px solid var(--line-strong);
  border-radius: var(--radius); background: var(--surface); color: var(--ink);
  min-height: 48px;
}
input:focus, select:focus { border-color: var(--accent); outline: 2px solid var(--accent-tint); outline-offset: 0; }
input[aria-invalid="true"] { border-color: var(--error-line); }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; margin: 0 var(--s3) 0 0; flex: none; accent-color: var(--accent); }
.checkline { display: flex; align-items: flex-start; font-weight: 400; font-size: var(--fs-body); margin: var(--s4) 0 0; line-height: 1.45; }
.formerror {
  display: none; background: var(--error-bg); color: var(--error-ink);
  border: 1px solid var(--error-line); border-left: 4px solid var(--error-line);
  border-radius: var(--radius); padding: var(--s3) var(--s4);
  font-size: var(--fs-small); margin: var(--s4) 0 0;
}
.formerror.show { display: block; }
.empty {
  border: 1px dashed var(--line-strong); border-radius: var(--radius-lg);
  padding: var(--s5); margin: var(--s5) 0; color: var(--muted);
  font-size: var(--fs-small); text-align: center;
}
.empty.hide { display: none; }

/* ---------- Calculator result ---------- */
.result { display: none; }
.result .streamline { font-size: var(--fs-body); margin-bottom: var(--s1); }
.result .total {
  font-family: var(--font-display);
  font-size: var(--fs-total); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em;
  margin: var(--s3) 0 var(--s4); font-variant-numeric: tabular-nums;
}
.result .deadline {
  background: var(--accent-tint); border-radius: var(--radius);
  padding: var(--s3) var(--s4); margin: var(--s4) 0;
}
.result table td:last-child { text-align: right; font-weight: 600; white-space: nowrap; }
.result table th:last-child { text-align: right; }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--line); }
.faq .qa { padding: var(--s4) 0; border-bottom: 1px solid var(--line); }
.faq .qa p { margin: 0; }
.faq .qa p.q { font-weight: 700; margin-bottom: var(--s1); }

/* ---------- Legal / footer ---------- */
.fine {
  font-size: var(--fs-caption); line-height: 1.6; color: var(--muted);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s4); margin-top: var(--s7);
}
.result .fine { border: none; padding: 0; margin-top: var(--s3); }
footer.site {
  font-size: var(--fs-caption); color: var(--muted); line-height: 1.6;
  border-top: 1px solid var(--line-strong); margin-top: var(--s7); padding-top: var(--s4);
}
footer.site a { color: var(--ink-soft); }

/* ---------- Home product cards ---------- */
.products { display: grid; grid-template-columns: 1fr; gap: var(--s4); margin: var(--s5) 0 var(--s6); }
@media (min-width: 640px) { .products { grid-template-columns: 1fr 1fr 1fr; } }
.product {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg); padding: var(--s5);
  display: flex; flex-direction: column;
}
.product h3 { margin: 0 0 var(--s2); font-family: var(--font-display); font-size: 20px; }
.product p { color: var(--ink-soft); font-size: var(--fs-small); flex: 1; }
.product a { color: var(--accent); font-weight: 600; text-decoration: none; font-size: var(--fs-small); }
.product a:hover { text-decoration: underline; }
.product.featured { border-top: 4px solid var(--accent); }

/* ---------- Small screens ---------- */
@media (max-width: 480px) {
  :root { --fs-h1: 31px; --fs-h2: 22px; --fs-total: 28px; --fs-lede: 18px; }
  .wrap { padding: var(--s4) 16px var(--s7); }
  .tool, .card, .honesty, .tier, .stream, .product { padding: var(--s4); }
  ol.steps > li { padding-left: 46px; }
  table, tbody, tr, th, td { display: block; width: 100%; }
  th, td { border-bottom: none; }
  tr { margin-bottom: var(--s3); border-bottom: 1px solid var(--line); }
  .result table td:last-child { text-align: left; }
  .result table th:last-child { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* ---------- Situations (homepage doors) ---------- */
.stack { margin: 0 0 var(--s6); }
.stack h3 {
  font-size: 12.5px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 var(--s2);
}
ul.doors { list-style: none; padding-left: 0; margin: 0; border-top: 1px solid var(--line-strong); }
ul.doors > li { margin: 0; border-bottom: 1px solid var(--line); }
ul.doors a {
  display: flex; align-items: baseline; gap: var(--s3);
  padding: var(--s4) var(--s2); color: var(--ink); text-decoration: none;
  font-size: var(--fs-lede); line-height: 1.4;
}
ul.doors a:hover { background: var(--accent-tint); }
ul.doors a .arrow { color: var(--accent); font-weight: 700; margin-left: auto; flex: none; }
.tag {
  flex: none; font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--warn-ink); background: var(--warn-bg);
  border: 1px solid var(--warn-line); border-radius: 999px; padding: 2px 10px;
}

/* ---------- Diagnostic choice cards & panels ---------- */
fieldset { border: none; margin: 0 0 var(--s5); padding: 0; }
legend { font-weight: 700; font-size: var(--fs-body); padding: 0; margin-bottom: var(--s3); }
.radio-row {
  display: flex; align-items: flex-start; gap: var(--s3);
  font-weight: 400; font-size: var(--fs-body); line-height: 1.45;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s3) var(--s4); margin: 0 0 var(--s2); cursor: pointer;
}
.radio-row:hover { border-color: var(--line-strong); }
.radio-row input[type="radio"] {
  width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; flex: none; accent-color: var(--accent);
}
.radio-row:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); }
.result-panel { display: none; border-radius: var(--radius-lg); padding: var(--s5); margin: var(--s5) 0; }
.result-panel.show { display: block; }
.result-panel.fit { background: var(--accent-tint); border: 1px solid var(--accent); }
.result-panel.nofit { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); }
.result-panel > :first-child { margin-top: 0; }
.result-panel > :last-child { margin-bottom: 0; }
.guidance {
  border: 1px solid var(--line-strong); border-left: 4px solid var(--accent);
  border-radius: var(--radius); padding: var(--s4) var(--s5); margin: var(--s4) 0;
  background: var(--surface);
}
.guidance > :last-child { margin-bottom: 0; }

/* ---------- Objection calculator result ---------- */
.due-line { font-size: var(--fs-small); color: var(--ink-soft); margin: var(--s2) 0 0; }
.result-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); margin: var(--s4) 0 0;
}
.result-date {
  font-family: var(--font-display); font-size: var(--fs-total); font-weight: 700;
  line-height: 1.2; letter-spacing: -0.01em; margin: var(--s1) 0 var(--s2);
}
.rule-box {
  background: var(--accent-tint); border-radius: var(--radius);
  padding: var(--s4) var(--s5); margin: var(--s4) 0;
}
.rule-box > :last-child { margin-bottom: 0; }
.fine-print { font-size: var(--fs-caption); color: var(--muted); line-height: 1.6; }

/* ---------- Price box (journal page) ---------- */
.pricebox { border: 1px solid var(--line-strong); border-radius: var(--radius-lg); overflow: hidden; margin: var(--s4) 0; }
.pricebox .row {
  display: flex; justify-content: space-between; gap: var(--s4);
  padding: var(--s3) var(--s5); border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.pricebox .row:last-child { border-bottom: none; }
.pricebox .row .amount { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pricebox .row.total { background: var(--card); font-weight: 700; }

/* ---------- Article (SEO) pages ---------- */
blockquote {
  margin: var(--s4) 0; padding: var(--s3) var(--s5);
  border-left: 4px solid var(--line-strong); color: var(--ink-soft);
  background: var(--card); border-radius: 0 var(--radius) var(--radius) 0;
}
blockquote > :last-child { margin-bottom: 0; }
code { font-size: 0.92em; background: var(--card); padding: 1px 5px; border-radius: 4px; }
.small { font-size: var(--fs-small); }
.muted { color: var(--muted); }

/* ---------- Hero price strip & door prices ---------- */
.pricestrip { font-size: var(--fs-lede); line-height: 1.5; color: var(--ink); margin: var(--s4) 0 0; }
ul.doors a .doorprice { color: var(--muted); font-size: var(--fs-small); font-weight: 600; white-space: nowrap; }

/* ---------- Featured tier ---------- */
.tier.featured { border-top: 4px solid var(--accent); }
.tier-tag {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--accent); background: var(--accent-tint);
  border: 1px solid var(--accent); border-radius: 999px; padding: 2px 10px;
  margin: 0 0 var(--s2);
}

/* ---------- Sticky mobile CTA (product pages only) ---------- */
.sticky-cta { display: none; }
@media (max-width: 640px) {
  .sticky-cta {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--surface); border-top: 1px solid var(--line-strong);
    padding: var(--s2) 16px calc(var(--s2) + env(safe-area-inset-bottom));
  }
  .sticky-cta .btn { margin: 0; }
  body.has-sticky { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
}
