/* FiledNorth shared styles.
   Institutional register: flat surfaces, hairline rules, one sans family,
   navy bands top and bottom, no gradients, no shadows, radius 2px max. */

/* ---------- Tokens ---------- */
* { box-sizing: border-box; }
:root {
  /* colour */
  --ink: #222222;
  --ink-soft: #444444;
  --muted: #595959;
  --bg: #ffffff;
  --surface: #ffffff;
  --card: #f2f2f2;
  --card-line: #dddddd;
  --line: #e2e2e2;
  --line-strong: #bdbdbd;
  --accent: #1d3557;
  --accent-deep: #14263c;
  --accent-tint: #edf0f3;
  --accent-ink: #ffffff;
  --band-bg: #14263c;
  --band-ink: #ffffff;
  --band-soft: #c9d4e2;
  --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: one institutional sans stack for headings and body alike.
     Lato and Noto Sans are named first (the Canada.ca faces) and resolve
     where a system already carries them; no webfonts are downloaded. */
  --font-sans: "Lato", "Noto Sans", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-caption: 13px;
  --fs-small: 14.5px;
  --fs-body: 17px;
  --fs-lede: 19px;
  --fs-h3: 19px;
  --fs-h2: 25px;
  --fs-h1: 36px;
  --fs-total: 32px;
  --lh-body: 1.55;
  --lh-tight: 1.2;

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

  --radius: 2px;
  --radius-lg: 2px;
}
/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-sans);
  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: 760px; margin: 0 auto; padding: var(--s5) 20px var(--s8); }
p { margin: 0 0 var(--s4); }
a { color: var(--accent); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-tint); }

/* ---------- Header & footer bands ---------- */
header.site { background: var(--band-bg); color: var(--band-ink); }
header.site .band-in {
  max-width: 760px; margin: 0 auto; padding: var(--s3) 20px;
  display: flex; align-items: baseline; gap: var(--s3) var(--s5);
  flex-wrap: wrap;
}
header.site .brand {
  font-size: 24px; font-weight: 700; letter-spacing: 0;
  color: var(--band-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(--band-soft); text-decoration: none; font-size: 15px;
  padding: var(--s3) 0;
}
header.site nav a:hover { color: var(--band-ink); text-decoration: underline; }
header.site nav a[aria-current="page"] {
  color: var(--band-ink); font-weight: 700; text-decoration: underline;
}
footer.site { background: var(--band-bg); color: var(--band-soft); }
footer.site .band-in {
  max-width: 760px; margin: 0 auto;
  padding: var(--s5) 20px var(--s6);
  font-size: var(--fs-small); line-height: 1.6;
}
footer.site a { color: var(--band-ink); }

/* ---------- 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; }
/* Notice box: plain border, navy left rule, bold label in sentence case. */
.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: 15px; font-weight: 700;
  color: var(--ink); 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 ---------- */
h1 {
  font-weight: 700; letter-spacing: 0;
  font-size: var(--fs-h1); line-height: var(--lh-tight);
  margin: 0 0 var(--s4); max-width: 20em;
}
.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: 36em; }
h2 {
  font-weight: 700; letter-spacing: 0;
  font-size: var(--fs-h2); line-height: 1.25;
  margin: var(--s7) 0 var(--s3);
}
section:not(.tool) > h2 {
  border-bottom: 2px solid var(--ink); padding-bottom: var(--s2);
}
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(--accent); }
.toc a:hover { color: var(--accent-deep); }

/* ---------- 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-size: 22px; font-weight: 700; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
/* Calculator panel: plain border, light gray header strip on the heading. */
.tool {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg); padding: var(--s5); margin: var(--s5) 0;
}
.tool h2 {
  background: var(--card); font-size: 20px;
  margin: calc(-1 * var(--s5)) calc(-1 * var(--s5)) var(--s4);
  padding: var(--s3) var(--s5);
  border-bottom: 1px solid var(--line-strong);
}
.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: 0;
  color: var(--accent);
  font-weight: 700; font-size: var(--fs-body); line-height: var(--lh-body);
}
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-weight: 700; color: var(--ink); background: var(--card); border-top: 1px solid var(--line-strong); }
td ul { margin-bottom: 0; }

/* Two-stream comparison panels (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-sans);
  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-size: var(--fs-total); font-weight: 700; line-height: 1.2; letter-spacing: 0;
  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 ---------- */
.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); }

/* ---------- Small screens ---------- */
@media (max-width: 480px) {
  :root { --fs-h1: 30px; --fs-h2: 22px; --fs-total: 28px; --fs-lede: 18px; }
  .wrap { padding: var(--s4) 16px var(--s7); }
  header.site .band-in, footer.site .band-in { padding-left: 16px; padding-right: 16px; }
  .tool, .card, .honesty, .stream { padding: var(--s4); }
  .tool h2 {
    margin: calc(-1 * var(--s4)) calc(-1 * var(--s4)) var(--s4);
    padding: var(--s3) 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; }
}

/* ---------- Services index (homepage) ---------- */
.stack { margin: 0 0 var(--s6); }
.stack h3 {
  font-size: var(--fs-h3); font-weight: 700;
  color: var(--ink); 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: block;
  padding: var(--s3) var(--s2); color: var(--accent); text-decoration: none;
  font-size: 20px; font-weight: 700; line-height: 1.35;
}
ul.doors a:hover { text-decoration: underline; }
ul.doors a .doorprice, ul.doors a .tag {
  display: block; margin-top: 2px;
  font-size: var(--fs-small); font-weight: 400; color: var(--muted);
}
ul.doors a .doordesc {
  display: block; margin-top: 2px;
  font-size: var(--fs-body); font-weight: 400; color: var(--ink-soft); line-height: 1.45;
}

/* ---------- 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: 13px; font-weight: 700;
  color: var(--ink-soft); margin: var(--s4) 0 0;
}
.result-date {
  font-size: var(--fs-total); font-weight: 700;
  line-height: 1.2; letter-spacing: 0; margin: var(--s1) 0 var(--s2);
}
.result-days { margin: 0 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);
}
blockquote > :last-child { margin-bottom: 0; }
code { font-size: 0.92em; background: var(--card); padding: 1px 5px; border-radius: 2px; }
.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; }

/* ---------- Tier comparison tables (stay tabular at every width) ---------- */
table.compare { font-size: var(--fs-small); }
table.compare th, table.compare td { padding: var(--s3) var(--s3); }
table.compare th:not(:first-child), table.compare td:not(:first-child) {
  text-align: center; width: 22%;
}
table.compare td.yes { color: var(--accent); font-weight: 700; }
table.compare td.no { color: var(--muted); }
table.compare thead th { font-size: var(--fs-small); color: var(--ink); }
@media (max-width: 480px) {
  table.compare { display: table; width: 100%; }
  table.compare tbody { display: table-row-group; }
  table.compare tr { display: table-row; margin-bottom: 0; border-bottom: none; }
  table.compare th, table.compare td { display: table-cell; width: auto; border-bottom: 1px solid var(--line); padding: var(--s2) var(--s2); }
  table.compare th:not(:first-child), table.compare td:not(:first-child) { width: 24%; }
}

/* ---------- Button detail line (calculator results carried into the order) ---------- */
.btn .btn-detail { display: block; font-size: 14px; font-weight: 500; opacity: 0.88; margin-top: 2px; }

/* ---------- Not-included lists ---------- */
ul.notincl { list-style: none; padding-left: 0; }
ul.notincl > li { position: relative; padding-left: 28px; margin: var(--s3) 0; }
ul.notincl > li::before {
  content: "\00d7"; position: absolute; left: 4px; top: 0;
  color: var(--muted); font-weight: 700;
}

/* ---------- Package block subheads ---------- */
.pkg-sub { font-size: var(--fs-h3); margin: var(--s6) 0 var(--s2); }
section .pkg-sub:first-child { margin-top: 0; }

/* ---------- 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(--band-bg);
    padding: var(--s2) 16px calc(var(--s2) + env(safe-area-inset-bottom));
  }
  .sticky-cta .btn {
    margin: 0; background: #ffffff; color: var(--accent-deep);
    border-color: #ffffff;
  }
  .sticky-cta .btn:hover { background: var(--accent-tint); border-color: var(--accent-tint); }
  body.has-sticky { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
}
