/* ==========================================================================
   5AB Immigration — Design System
   Premium, calm, regulated. Canadian red used as accent only.
   ========================================================================== */

/* ---------- Tokens ----------
   Palette is taken from the 5AB Immigration logo: the red of the wordmark and
   aircraft, and the blue of the globe. Red stays an accent — it carries the
   CTAs and small emphasis marks only. Blue does the structural work.
   ---------------------------------------------------------------------- */
:root {
  /* Surfaces */
  --c-bg:            #ffffff;
  --c-bg-soft:       #f6f8fb;
  --c-bg-tint:       #eef3fa;
  --c-bg-ink:        #0a2148;   /* deep brand blue, for inverted sections */
  --c-border:        #e0e6ee;
  --c-border-strong: #c5cfdd;

  /* Type */
  --c-ink:           #0d1f38;
  --c-ink-2:         #3b4a60;
  --c-ink-3:         #64738a;
  --c-ink-inv:       #ffffff;
  --c-ink-inv-2:     #b8c6db;

  /* Brand red — from the logo wordmark. Accent only. */
  --c-accent:        #d81e26;
  --c-accent-ink:    #ae141b;
  --c-accent-soft:   #fdf1f2;
  --c-accent-border: #f4c9cc;

  /* Brand blue — from the logo globe. Primary interactive colour. */
  --c-navy:          #0b3e8f;
  --c-navy-ink:      #072f6e;
  --c-navy-soft:     #eaf1fc;
  --c-blue-bright:   #1e8be0;   /* the lighter blue in the globe gradient */

  /* Semantic */
  --c-note:          #f4f8fb;
  --c-note-border:   #cfe0ec;
  --c-warn:          #fff9ed;
  --c-warn-border:   #f0dcb4;

  /* Typography */
  --f-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, sans-serif;
  --f-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;

  --t-xs:   0.8125rem;
  --t-sm:   0.9063rem;
  --t-base: 1.0313rem;
  --t-md:   1.125rem;
  --t-lg:   1.3125rem;
  --t-xl:   1.625rem;
  --t-2xl:  2rem;
  --t-3xl:  2.5rem;
  --t-4xl:  3.25rem;

  /* Space */
  --s-1: 0.25rem; --s-2: 0.5rem;  --s-3: 0.75rem; --s-4: 1rem;
  --s-5: 1.5rem;  --s-6: 2rem;    --s-7: 3rem;    --s-8: 4rem;
  --s-9: 5.5rem;  --s-10: 7rem;

  /* Layout */
  --w-page:  1180px;
  --w-text:  70ch;
  --w-narrow: 54ch;

  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-pill: 999px;

  --sh-1: 0 1px 2px rgba(10,33,72,.06), 0 1px 3px rgba(10,33,72,.05);
  --sh-2: 0 2px 4px rgba(10,33,72,.06), 0 8px 24px rgba(10,33,72,.08);
  --sh-3: 0 4px 8px rgba(10,33,72,.07), 0 18px 48px rgba(10,33,72,.12);

  --header-h: 72px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

/* The browser's default [hidden] { display: none } is a USER-AGENT rule, so any
   author rule that sets display wins over it - including .btn's inline-flex.
   That made hidden buttons render anyway (the Continue and Submit buttons in
   the roadmap form appeared at the same time). Enforce it globally instead of
   patching each component. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  font-family: var(--f-sans);
  font-size: var(--t-base);
  line-height: 1.65;
  color: var(--c-ink-2);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { color: var(--c-ink); line-height: 1.2; margin: 0 0 var(--s-4); font-weight: 650; letter-spacing: -0.015em; }
h1 { font-size: var(--t-3xl); letter-spacing: -0.025em; }
h2 { font-size: var(--t-2xl); letter-spacing: -0.02em; margin-top: var(--s-7); }
h3 { font-size: var(--t-lg); margin-top: var(--s-6); }
h4 { font-size: var(--t-md); margin-top: var(--s-5); }
p  { margin: 0 0 var(--s-4); }
ul, ol { margin: 0 0 var(--s-4); padding-left: 1.35em; }
li { margin-bottom: var(--s-2); }
li > ul, li > ol { margin-top: var(--s-2); }
strong { color: var(--c-ink); font-weight: 620; }
small { font-size: var(--t-sm); }
hr { border: 0; border-top: 1px solid var(--c-border); margin: var(--s-7) 0; }
abbr[title] { text-decoration: underline dotted; cursor: help; }

a {
  color: var(--c-navy);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: var(--c-border-strong);
  transition: color .15s, text-decoration-color .15s;
}
a:hover { color: var(--c-accent-ink); text-decoration-color: var(--c-accent); }

:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
  border-radius: 3px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--c-navy); color: #fff; padding: var(--s-3) var(--s-4);
  border-radius: 0 0 var(--r-sm) 0; text-decoration: none; font-weight: 600;
}
.skip-link:focus { left: 0; color: #fff; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--w-page); margin-inline: auto; padding-inline: var(--s-5); }
.section { padding-block: var(--s-9); }
.section--tight { padding-block: var(--s-7); }
.section--soft { background: var(--c-bg-soft); }
.section--tint { background: var(--c-bg-tint); }
.section--ink { background: var(--c-bg-ink); color: var(--c-ink-inv-2); }
.section--ink h2, .section--ink h3, .section--ink h4 { color: #fff; }
.section--ink a { color: #fff; text-decoration-color: rgba(255,255,255,.4); }
.section--ink a:hover { color: #fff; text-decoration-color: var(--c-accent); }

.prose { max-width: var(--w-text); }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }
.lede { font-size: var(--t-md); color: var(--c-ink-2); max-width: var(--w-text); }

.eyebrow {
  font-size: var(--t-xs); font-weight: 680; letter-spacing: .11em;
  text-transform: uppercase; color: var(--c-accent); margin: 0 0 var(--s-3);
}
.section--ink .eyebrow { color: #ff8fa1; }

.section-head { max-width: var(--w-text); margin-bottom: var(--s-6); }
.section-head h2 { margin-top: 0; }

.grid { display: grid; gap: var(--s-5); }
.grid--2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 960px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 640px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  font: inherit; font-weight: 640; line-height: 1.25;
  padding: .85em 1.5em; border-radius: var(--r-sm); border: 1px solid transparent;
  text-decoration: none; cursor: pointer; text-align: center;
  transition: background .15s, border-color .15s, color .15s, transform .12s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--c-accent); color: #fff; border-color: var(--c-accent);
  box-shadow: var(--sh-1);
}
.btn--primary:hover { background: var(--c-accent-ink); border-color: var(--c-accent-ink); color: #fff; box-shadow: var(--sh-2); }
.btn--secondary { background: #fff; color: var(--c-navy); border-color: var(--c-border-strong); }
.btn--secondary:hover { border-color: var(--c-navy); color: var(--c-navy-ink); background: var(--c-navy-soft); }
.btn--ghost { background: transparent; color: var(--c-ink-inv); border-color: rgba(255,255,255,.35); }
.btn--ghost:hover { background: rgba(255,255,255,.1); border-color: #fff; color: #fff; }
.btn--lg { font-size: var(--t-md); padding: 1em 1.9em; }
.btn--block { width: 100%; }
.btn--sm { font-size: var(--t-sm); padding: .6em 1.1em; }

.cta-group { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; }
.cta-note { font-size: var(--t-sm); color: var(--c-ink-3); max-width: 46ch; margin: var(--s-3) 0 0; }
.section--ink .cta-note { color: var(--c-ink-inv-2); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--c-border);
}
.site-header__inner {
  display: flex; align-items: center; gap: var(--s-5);
  min-height: var(--header-h);
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  text-decoration: none; color: var(--c-ink); flex: 0 0 auto;
}
/* The globe-and-aircraft mark cut from the logo (assets/img/5ab-mark.png).
   The full stacked logo is too tall to stay legible at header height, so the
   mark pairs with the .brand__text wordmark instead. */
/* The mark is a wide composition (roughly 1.34:1), so matching the old square
   monogram's height made it noticeably wider and visually heavier than the
   nav beside it. Sized by height to sit level with the wordmark's cap height. */
.brand__icon {
  height: 30px; width: auto; flex: 0 0 auto;
}
/* The mark has a genuinely transparent background (see
   tools/make-mark-transparent.ps1), so it sits correctly on the dark footer
   without any blend-mode trickery. */
.site-footer .brand__icon { height: 32px; }

/* Fallback monogram, kept for any context without the image. */
.brand__mark {
  width: 34px; height: 34px; border-radius: var(--r-sm);
  background: linear-gradient(140deg, var(--c-blue-bright) 0%, var(--c-navy) 70%);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 760; font-size: .82rem; letter-spacing: -.02em;
  flex: 0 0 auto;
}
.brand__mark span { color: #ffd9dc; }

/* The full stacked logo, for larger placements. */
.brand__logo { height: auto; width: 100%; max-width: 260px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-weight: 720; font-size: 1.0625rem; letter-spacing: -.02em; }
.brand__tag { font-size: .6875rem; color: var(--c-ink-3); letter-spacing: .04em; text-transform: uppercase; }

.nav { margin-left: auto; }
.nav__list { display: flex; align-items: center; gap: var(--s-2); list-style: none; margin: 0; padding: 0; }
.nav__list > li { margin: 0; position: relative; }
.nav__link {
  display: inline-flex; align-items: center; gap: .3em;
  padding: .6rem .7rem; border-radius: var(--r-sm);
  font-size: var(--t-sm); font-weight: 560; color: var(--c-ink-2);
  text-decoration: none; white-space: nowrap;
}
.nav__link:hover, .nav__link[aria-expanded="true"] { background: var(--c-bg-soft); color: var(--c-ink); }
.nav__link[aria-current="page"] { color: var(--c-accent-ink); }
.nav__caret { width: .55em; height: .55em; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-15%); opacity: .55; }

.nav__panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 110;
  min-width: 290px; padding: var(--s-3);
  background: #fff; border: 1px solid var(--c-border);
  border-radius: var(--r-md); box-shadow: var(--sh-3);
  list-style: none; margin: 0;
}
.nav__panel[hidden] { display: none; }
.nav__panel li { margin: 0; }
.nav__panel a {
  display: block; padding: .55rem .7rem; border-radius: var(--r-sm);
  text-decoration: none; font-size: var(--t-sm); color: var(--c-ink);
  font-weight: 560;
}
.nav__panel a small { display: block; font-weight: 400; color: var(--c-ink-3); font-size: var(--t-xs); margin-top: 1px; }
.nav__panel a:hover { background: var(--c-navy-soft); color: var(--c-navy-ink); }
.nav__panel-head {
  font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .08em;
  color: var(--c-ink-3); font-weight: 680; padding: .4rem .7rem .2rem;
}

.header-cta { flex: 0 0 auto; }
/* The in-menu CTA is for the collapsed mobile nav only — the header button
   already covers desktop, and showing both duplicates the primary action. */
.nav__mobile-cta { display: none; }
.nav-toggle {
  display: none; margin-left: auto; background: #fff;
  border: 1px solid var(--c-border-strong); border-radius: var(--r-sm);
  padding: .55rem .8rem; font: inherit; font-size: var(--t-sm); font-weight: 600;
  color: var(--c-ink); cursor: pointer; align-items: center; gap: .5em;
}
.nav-toggle__bars { display: grid; gap: 3px; }
.nav-toggle__bars i { display: block; width: 16px; height: 1.5px; background: currentColor; }

@media (max-width: 1080px) {
  .nav-toggle { display: inline-flex; }
  .header-cta { display: none; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--c-border);
    box-shadow: var(--sh-2); margin: 0;
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .nav[hidden] { display: none; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; padding: var(--s-4) var(--s-5) var(--s-6); }
  .nav__link { padding: .8rem 0; font-size: var(--t-base); border-bottom: 1px solid var(--c-border); border-radius: 0; justify-content: space-between; }
  .nav__panel {
    position: static; box-shadow: none; border: 0; min-width: 0;
    padding: var(--s-2) 0 var(--s-3) var(--s-4);
    border-left: 2px solid var(--c-accent-border); margin: var(--s-2) 0 var(--s-3);
    border-radius: 0;
  }
  .nav__mobile-cta { display: block; margin-top: var(--s-4); }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background:
    radial-gradient(1000px 480px at 84% -12%, rgba(216,30,38,.07), transparent 60%),
    radial-gradient(900px 460px at 12% -20%, rgba(30,139,224,.10), transparent 62%),
    linear-gradient(180deg, #fafcff 0%, #ffffff 100%);
  border-bottom: 1px solid var(--c-border);
  padding-block: var(--s-9) var(--s-7);
}
.hero__inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: var(--s-8); align-items: center; }
@media (max-width: 1000px) { .hero__inner { grid-template-columns: 1fr; gap: var(--s-6); } }
.hero h1 { font-size: var(--t-4xl); max-width: 22ch; }
@media (max-width: 720px) { .hero h1 { font-size: 2.125rem; } }
.hero__lede { font-size: var(--t-md); max-width: 56ch; color: var(--c-ink-2); }
.hero--page { padding-block: var(--s-7); }
.hero--page .hero__inner { grid-template-columns: 1fr; }
.hero--page h1 { font-size: var(--t-3xl); max-width: 30ch; }

.hero__card {
  background: #fff; border: 1px solid var(--c-border);
  border-radius: var(--r-lg); box-shadow: var(--sh-2); padding: var(--s-6);
}
.hero__card h2 { font-size: var(--t-md); margin: 0 0 var(--s-3); }

/* ---------- Trust bar ---------- */
.trustbar { border-bottom: 1px solid var(--c-border); background: #fff; }
.trustbar__list {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-6);
  list-style: none; margin: 0; padding: var(--s-4) 0;
  font-size: var(--t-sm); color: var(--c-ink-2);
}
.trustbar__list li { display: flex; align-items: center; gap: .5em; margin: 0; font-weight: 560; }
.trustbar__list li::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-accent); flex: 0 0 auto;
}

/* ---------- Cards ---------- */
.card {
  background: #fff; border: 1px solid var(--c-border);
  border-radius: var(--r-md); padding: var(--s-5);
  display: flex; flex-direction: column;
}
.card > :last-child { margin-bottom: 0; }
.card h3 { margin-top: 0; font-size: var(--t-md); }
.card p { font-size: var(--t-sm); }
.card--link { text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card--link:hover { border-color: var(--c-border-strong); box-shadow: var(--sh-2); transform: translateY(-2px); color: inherit; }
.card--link:hover h3 { color: var(--c-accent-ink); }
.card__more { margin-top: auto; padding-top: var(--s-4); font-size: var(--t-sm); font-weight: 620; color: var(--c-navy); }
.card--link:hover .card__more { color: var(--c-accent-ink); }
.card__more::after { content: " →"; }
.card__meta { font-size: var(--t-xs); color: var(--c-ink-3); text-transform: uppercase; letter-spacing: .07em; font-weight: 640; margin-bottom: var(--s-2); }

/* Goal selector */
.goals { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: var(--s-4); }
@media (max-width: 1000px) { .goals { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 640px)  { .goals { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.goal {
  display: flex; flex-direction: column; gap: .35rem;
  padding: var(--s-4); background: #fff;
  border: 1px solid var(--c-border); border-radius: var(--r-md);
  text-decoration: none; color: var(--c-ink); font-weight: 620; font-size: var(--t-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s;
  min-height: 108px;
}
.goal:hover { border-color: var(--c-accent-border); box-shadow: var(--sh-2); transform: translateY(-2px); color: var(--c-accent-ink); }
.goal span { font-weight: 400; font-size: var(--t-xs); color: var(--c-ink-3); }
.goal:hover span { color: var(--c-ink-3); }
.goal__icon { width: 22px; height: 22px; color: var(--c-accent); margin-bottom: .2rem; }

/* ---------- Answer box (AEO) ---------- */
.answer {
  background: var(--c-note); border: 1px solid var(--c-note-border);
  border-left: 4px solid var(--c-navy);
  border-radius: var(--r-sm); padding: var(--s-5) var(--s-5) var(--s-4);
  margin: var(--s-6) 0;
}
.answer__label {
  font-size: var(--t-xs); font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--c-navy); margin: 0 0 var(--s-2);
}
.answer h2, .answer h3 { font-size: var(--t-md); margin: 0 0 var(--s-3); }
.answer p:last-child { margin-bottom: 0; }
.answer__body { font-size: var(--t-md); color: var(--c-ink); }

/* RCIC insight */
.insight {
  background: var(--c-accent-soft); border: 1px solid var(--c-accent-border);
  border-radius: var(--r-md); padding: var(--s-5); margin: var(--s-6) 0;
}
.insight__label {
  font-size: var(--t-xs); font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--c-accent-ink);
  margin: 0 0 var(--s-3); display: flex; align-items: center; gap: .5em;
}
.insight blockquote {
  margin: 0; font-family: var(--f-serif); font-size: var(--t-md);
  line-height: 1.55; color: var(--c-ink);
}
.insight blockquote p:last-child { margin-bottom: 0; }
.insight__attrib { font-size: var(--t-sm); color: var(--c-ink-3); margin: var(--s-3) 0 0; }

/* Note / caution blocks */
.note, .caution {
  border-radius: var(--r-sm); padding: var(--s-4) var(--s-5);
  margin: var(--s-5) 0; font-size: var(--t-sm);
}
.note { background: var(--c-note); border: 1px solid var(--c-note-border); }
.caution { background: var(--c-warn); border: 1px solid var(--c-warn-border); }
.note > :last-child, .caution > :last-child { margin-bottom: 0; }
.note strong, .caution strong { display: block; margin-bottom: var(--s-1); }

/* Case example */
.case {
  border: 1px solid var(--c-border); border-radius: var(--r-md);
  overflow: hidden; margin: var(--s-6) 0;
}
.case__head {
  background: var(--c-bg-soft); border-bottom: 1px solid var(--c-border);
  padding: var(--s-4) var(--s-5);
}
.case__head p { margin: 0; font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .08em; font-weight: 680; color: var(--c-ink-3); }
.case__head h3 { margin: var(--s-1) 0 0; font-size: var(--t-md); }
.case__body { padding: var(--s-5); }
.case__body > :last-child { margin-bottom: 0; }
.case dl { margin: 0; }
.case dt {
  font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .08em;
  font-weight: 700; color: var(--c-accent-ink); margin-top: var(--s-4);
}
.case dt:first-child { margin-top: 0; }
.case dd { margin: var(--s-1) 0 0; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: var(--s-5) 0; border: 1px solid var(--c-border); border-radius: var(--r-md); }
table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
caption { text-align: left; font-size: var(--t-xs); color: var(--c-ink-3); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--c-border); background: var(--c-bg-soft); }
th, td { text-align: left; padding: .75rem 1rem; border-bottom: 1px solid var(--c-border); vertical-align: top; }
thead th { background: var(--c-bg-soft); color: var(--c-ink); font-weight: 660; font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .05em; }
tbody tr:last-child td { border-bottom: 0; }
tbody th { font-weight: 620; color: var(--c-ink); }

/* ---------- Steps / process ---------- */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: var(--s-5); grid-template-columns: repeat(4, minmax(0,1fr)); }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.steps li { counter-increment: step; margin: 0; padding-top: var(--s-4); border-top: 2px solid var(--c-accent); }
.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block; font-size: var(--t-sm); font-weight: 720; color: var(--c-accent); margin-bottom: var(--s-2);
}
.steps h3 { margin: 0 0 var(--s-2); font-size: var(--t-md); }
.steps p { font-size: var(--t-sm); margin: 0; }

.numlist { counter-reset: n; list-style: none; padding: 0; }
.numlist > li {
  counter-increment: n; position: relative; padding-left: 2.75rem; margin-bottom: var(--s-4);
}
.numlist > li::before {
  content: counter(n); position: absolute; left: 0; top: -1px;
  width: 1.85rem; height: 1.85rem; border-radius: 50%;
  background: var(--c-navy-soft); color: var(--c-navy);
  display: grid; place-items: center; font-size: var(--t-sm); font-weight: 700;
}
.numlist > li > strong:first-child { display: block; color: var(--c-ink); }

/* Checklist */
.checks { list-style: none; padding: 0; }
.checks li { position: relative; padding-left: 1.75rem; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: .5em;
  width: .55rem; height: .3rem;
  border-left: 2px solid var(--c-accent); border-bottom: 2px solid var(--c-accent);
  transform: rotate(-45deg);
}

/* ---------- RCIC / author blocks ---------- */
/* Credentials panel sits where a portrait would. There is deliberately no
   photograph: a stock or placeholder image on a regulated practice's profile
   reads as less trustworthy than none, and the licence details do the work. */
.rcic {
  display: grid; grid-template-columns: 300px 1fr; gap: var(--s-7); align-items: start;
}
@media (max-width: 800px) { .rcic { grid-template-columns: 1fr; gap: var(--s-5); } }
.rcic__card {
  background: var(--c-navy-soft);
  border: 1px solid var(--c-note-border);
  border-radius: var(--r-md);
  padding: var(--s-5);
}
.rcic__card h2, .rcic__card h3 { margin-top: 0; font-size: var(--t-md); }
.rcic__card > :last-child { margin-bottom: 0; }
.rcic__creds { list-style: none; padding: 0; margin: var(--s-4) 0; font-size: var(--t-sm); }
.rcic__creds li { display: flex; gap: .6em; margin-bottom: var(--s-2); }
.rcic__creds dt, .rcic__creds .k { color: var(--c-ink-3); min-width: 9.5rem; flex: 0 0 auto; }
.rcic__creds .v { color: var(--c-ink); font-weight: 560; }

/* No author portrait by design — see the note on .rcic__card. The block is a
   single column with a red rule, so it reads as an attribution, not as a card
   with a missing image. */
.authorbox {
  border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-accent);
  border-radius: var(--r-sm);
  background: var(--c-bg-soft); padding: var(--s-5);
  margin: var(--s-7) 0 0; font-size: var(--t-sm);
}
.authorbox p { margin: 0 0 var(--s-2); }
.authorbox__name { color: var(--c-ink); font-weight: 660; font-size: var(--t-base); }
.authorbox__dates { color: var(--c-ink-3); font-size: var(--t-xs); }

.reviewed {
  display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5);
  font-size: var(--t-sm); color: var(--c-ink-3);
  padding: var(--s-4) 0 0; margin: 0;
  list-style: none;
}
.reviewed li { margin: 0; }
.reviewed strong { color: var(--c-ink-2); font-weight: 600; }

.verify-link { font-weight: 620; }
.verify-link::after { content: " ↗"; font-weight: 400; }

/* ---------- FAQ ---------- */
.faq { max-width: var(--w-text); border-top: 1px solid var(--c-border); }

/* Where an FAQ is the whole section (rather than sitting inside a .prose
   reading column), a 70ch block left-aligned in a 1180px container leaves a
   large dead gap on the right. Split it into two columns so the width is used
   deliberately: intro on the left, questions on the right. */
.faq-split .wrap {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: var(--s-6) var(--s-8);
  align-items: start;
}
.faq-split .section-head {
  margin-bottom: 0;
  position: sticky;
  top: calc(var(--header-h) + var(--s-5));
}
.faq-split .faq { max-width: none; }
@media (max-width: 1000px) {
  .faq-split .wrap { display: block; }
  .faq-split .section-head { position: static; margin-bottom: var(--s-6); }
}
.faq details { border-bottom: 1px solid var(--c-border); }
.faq summary {
  cursor: pointer; list-style: none; padding: var(--s-4) 2.5rem var(--s-4) 0;
  position: relative; font-weight: 620; color: var(--c-ink); font-size: var(--t-md);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: .5rem; top: 50%;
  width: .6rem; height: .6rem; margin-top: -.45rem;
  border-right: 2px solid var(--c-accent); border-bottom: 2px solid var(--c-accent);
  transform: rotate(45deg); transition: transform .18s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -.15rem; }
.faq summary:hover { color: var(--c-accent-ink); }
.faq__body { padding: 0 0 var(--s-5); }
.faq__body > :last-child { margin-bottom: 0; }
.faq__body p:first-child { font-weight: 500; color: var(--c-ink); }

/* ---------- Breadcrumbs + TOC ---------- */
.crumbs { padding-block: var(--s-4) 0; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: .4em; list-style: none; margin: 0; padding: 0; font-size: var(--t-xs); color: var(--c-ink-3); }
.crumbs li { margin: 0; }
.crumbs li + li::before { content: "›"; margin-right: .45em; color: var(--c-border-strong); }
.crumbs a { color: var(--c-ink-3); text-decoration-color: transparent; }
.crumbs a:hover { color: var(--c-accent-ink); text-decoration-color: currentColor; }
.crumbs [aria-current] { color: var(--c-ink-2); }

.toc {
  border: 1px solid var(--c-border); border-radius: var(--r-md);
  padding: var(--s-4) var(--s-5); margin: var(--s-6) 0; background: var(--c-bg-soft);
}
.toc p { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .08em; font-weight: 680; color: var(--c-ink-3); margin: 0 0 var(--s-3); }
.toc ol { columns: 2; column-gap: var(--s-6); list-style: none; padding: 0; margin: 0; font-size: var(--t-sm); }
@media (max-width: 640px) { .toc ol { columns: 1; } }
.toc li { margin-bottom: var(--s-2); break-inside: avoid; }

/* ---------- CTA band ---------- */
.ctaband {
  background: var(--c-bg-ink); color: var(--c-ink-inv-2);
  border-radius: var(--r-lg); padding: var(--s-7);
  background-image:
    radial-gradient(700px 320px at 88% -30%, rgba(216,30,38,.30), transparent 62%),
    radial-gradient(620px 300px at 6% 120%, rgba(30,139,224,.28), transparent 62%);
}
.ctaband h2 { color: #fff; margin-top: 0; max-width: 30ch; }
.ctaband p { max-width: 62ch; }
.ctaband--flat { border-radius: 0; }
.ctaband--inline { padding: var(--s-6); margin: var(--s-7) 0; }
.ctaband--inline h2 { font-size: var(--t-xl); }

/* ---------- Sources ---------- */
.sources { background: var(--c-bg-soft); border: 1px solid var(--c-border); border-radius: var(--r-md); padding: var(--s-5); margin: var(--s-6) 0; }
.sources h2, .sources h3 { font-size: var(--t-md); margin: 0 0 var(--s-3); }
.sources ul { list-style: none; padding: 0; margin: 0; font-size: var(--t-sm); }
.sources li { padding-left: 1.2rem; position: relative; }
.sources li::before { content: "↗"; position: absolute; left: 0; color: var(--c-ink-3); font-size: .8em; top: .25em; }
.sources__note { font-size: var(--t-xs); color: var(--c-ink-3); margin: var(--s-4) 0 0; }

/* ---------- Pills / tags ---------- */
.pills { display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none; padding: 0; margin: 0 0 var(--s-5); }
.pills li { margin: 0; }
.pill {
  display: inline-block; padding: .3em .85em; border-radius: var(--r-pill);
  background: #fff; border: 1px solid var(--c-border-strong);
  font-size: var(--t-xs); font-weight: 600; color: var(--c-ink-2); text-decoration: none;
}
.pill:hover { border-color: var(--c-accent); color: var(--c-accent-ink); }
.pill--on { background: var(--c-navy); border-color: var(--c-navy); color: #fff; }

/* ---------- Footer ---------- */
.site-footer { background: var(--c-bg-ink); color: var(--c-ink-inv-2); padding-block: var(--s-8) var(--s-6); font-size: var(--t-sm); }
.site-footer a { color: var(--c-ink-inv-2); text-decoration-color: transparent; }
.site-footer a:hover { color: #fff; text-decoration-color: rgba(255,255,255,.5); }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--s-6); }
@media (max-width: 900px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer__grid { grid-template-columns: 1fr; } }
.footer__grid h2 { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .09em; color: #fff; margin: 0 0 var(--s-4); font-weight: 680; }
.footer__grid ul { list-style: none; padding: 0; margin: 0; }
.footer__grid li { margin-bottom: var(--s-2); }
.footer__brand .brand { color: #fff; }
.footer__brand .brand__tag { color: var(--c-ink-inv-2); }
.footer__creds { list-style: none; padding: 0; margin: var(--s-4) 0 0; }
.footer__creds li { margin-bottom: var(--s-2); }
.footer__creds .k { color: #8ea0bd; }
.footer__legal {
  border-top: 1px solid rgba(255,255,255,.12); margin-top: var(--s-7); padding-top: var(--s-5);
  font-size: var(--t-xs); color: #8ea0bd;
}
.footer__legal p { max-width: 95ch; }
.footer__legal-links { display: flex; flex-wrap: wrap; gap: var(--s-4); list-style: none; padding: 0; margin: 0 0 var(--s-4); }
.footer__legal-links li { margin: 0; }

/* ---------- Sticky mobile CTA ---------- */
.stickycta { display: none; }
@media (max-width: 860px) {
  .stickycta {
    display: flex; gap: var(--s-3); align-items: center;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
    padding: var(--s-3) var(--s-4) calc(var(--s-3) + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.97); backdrop-filter: blur(10px);
    border-top: 1px solid var(--c-border); box-shadow: 0 -4px 20px rgba(16,26,36,.08);
  }
  .stickycta .btn--primary { flex: 1 1 auto; }
  .stickycta__icon {
    flex: 0 0 auto; width: 46px; height: 46px; border-radius: var(--r-sm);
    border: 1px solid var(--c-border-strong); background: #fff;
    display: grid; place-items: center; color: var(--c-navy); text-decoration: none;
  }
  body { padding-bottom: 82px; }
}

/* ---------- Roadmap form ---------- */
.rm { max-width: 720px; margin-inline: auto; }
.rm__progress { margin-bottom: var(--s-6); }
.rm__bar { height: 6px; background: var(--c-border); border-radius: var(--r-pill); overflow: hidden; }
.rm__bar i { display: block; height: 100%; background: var(--c-accent); border-radius: var(--r-pill); transition: width .3s ease; width: 16.6%; }
.rm__meta { display: flex; justify-content: space-between; font-size: var(--t-xs); color: var(--c-ink-3); margin-top: var(--s-2); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }

.rm__step { background: #fff; border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: var(--s-6); box-shadow: var(--sh-1); }
.rm__step[hidden] { display: none; }
.rm__step h2 { margin-top: 0; font-size: var(--t-xl); }
.rm__step > p { font-size: var(--t-sm); color: var(--c-ink-3); }

fieldset { border: 0; padding: 0; margin: 0 0 var(--s-5); }
legend { font-weight: 640; color: var(--c-ink); font-size: var(--t-base); padding: 0; margin-bottom: var(--s-3); }
.field { margin-bottom: var(--s-5); }
.field > label, .field__label { display: block; font-weight: 600; color: var(--c-ink); font-size: var(--t-sm); margin-bottom: var(--s-2); }
.field__hint { font-size: var(--t-xs); color: var(--c-ink-3); margin: 0 0 var(--s-2); }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select, textarea {
  width: 100%; font: inherit; font-size: var(--t-base); color: var(--c-ink);
  padding: .7rem .85rem; background: #fff;
  border: 1px solid var(--c-border-strong); border-radius: var(--r-sm);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--c-navy); box-shadow: 0 0 0 3px rgba(18,48,71,.1); outline: none;
}
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--c-accent); }
.field__error { color: var(--c-accent-ink); font-size: var(--t-xs); font-weight: 600; margin: var(--s-2) 0 0; }
.field__error[hidden] { display: none; }

.optgrid { display: grid; gap: var(--s-3); grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (max-width: 560px) { .optgrid { grid-template-columns: 1fr; } }
.optgrid--3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
@media (max-width: 720px) { .optgrid--3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.opt { position: relative; display: block; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt span {
  display: block; padding: .8rem 1rem; border: 1px solid var(--c-border-strong);
  border-radius: var(--r-sm); font-size: var(--t-sm); font-weight: 560;
  cursor: pointer; background: #fff; transition: border-color .15s, background .15s, box-shadow .15s;
  color: var(--c-ink);
}
.opt span small { display: block; font-weight: 400; color: var(--c-ink-3); font-size: var(--t-xs); margin-top: 2px; }
.opt:hover span { border-color: var(--c-navy); }
.opt input:checked + span { border-color: var(--c-accent); background: var(--c-accent-soft); box-shadow: inset 0 0 0 1px var(--c-accent); }
.opt input:focus-visible + span { outline: 2px solid var(--c-accent); outline-offset: 2px; }

.consent { display: flex; gap: .7rem; align-items: flex-start; font-size: var(--t-sm); }
.consent input { width: 1.1rem; height: 1.1rem; margin-top: .25rem; flex: 0 0 auto; accent-color: var(--c-accent); }

.rm__nav { display: flex; justify-content: space-between; gap: var(--s-4); margin-top: var(--s-6); }
.rm__nav .btn--secondary[hidden] { display: none; }

.rm__aside { font-size: var(--t-sm); color: var(--c-ink-3); text-align: center; margin-top: var(--s-5); }

/* ---------- Misc ---------- */
.lastreviewed { font-size: var(--t-xs); color: var(--c-ink-3); margin: 0; }
.lastreviewed strong { color: var(--c-ink-2); font-weight: 600; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-7); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: var(--s-6); } }
.stat { font-size: var(--t-2xl); font-weight: 700; color: var(--c-ink); letter-spacing: -.02em; display: block; }
.stat + span { font-size: var(--t-sm); color: var(--c-ink-3); }

.related { border-top: 1px solid var(--c-border); padding-top: var(--s-6); margin-top: var(--s-8); }
.related h2 { font-size: var(--t-lg); margin-top: 0; }

.error-page { text-align: center; padding-block: var(--s-10); }
.error-page .stat { font-size: 4rem; color: var(--c-accent); }

/* ---------- Exit-intent dialog ----------
   Desktop only, once per session, never on the funnel or thank-you pages.
   Injected by main.js rather than duplicated into 26 HTML files. */
.exitint {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center;
  padding: var(--s-5);
  background: rgba(10, 33, 72, .55);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity .18s ease;
}
.exitint[data-open="true"] { opacity: 1; pointer-events: auto; }
.exitint__panel {
  position: relative;
  width: min(560px, 100%);
  background: #fff;
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  padding: var(--s-7) var(--s-6) var(--s-6);
  transform: translateY(8px) scale(.985);
  transition: transform .2s ease;
}
.exitint[data-open="true"] .exitint__panel { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .exitint, .exitint__panel { transition: none; }
}
.exitint__panel h2 { margin-top: 0; font-size: var(--t-xl); max-width: 22ch; }
.exitint__panel p { font-size: var(--t-sm); }
.exitint__close {
  position: absolute; top: .65rem; right: .65rem;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--c-border);
  background: #fff; color: var(--c-ink-3);
  font-size: 1.25rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.exitint__close:hover { background: var(--c-bg-soft); color: var(--c-ink); border-color: var(--c-border-strong); }
.exitint__creds {
  display: flex; flex-wrap: wrap; gap: .3rem var(--s-4);
  list-style: none; padding: 0; margin: var(--s-4) 0 0;
  font-size: var(--t-xs); color: var(--c-ink-3);
}
.exitint__creds li { margin: 0; display: flex; align-items: center; gap: .4em; }
.exitint__creds li::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--c-accent); flex: 0 0 auto;
}
.exitint__dismiss {
  display: block; width: 100%; margin-top: var(--s-4);
  background: none; border: 0; padding: .5rem;
  font: inherit; font-size: var(--t-sm); color: var(--c-ink-3);
  text-decoration: underline; cursor: pointer;
}
.exitint__dismiss:hover { color: var(--c-ink); }

/* ==========================================================================
   MOBILE REFINEMENTS
   A large share of immigration enquiries arrive on a phone. These rules tighten
   vertical rhythm, enlarge tap targets and stop long strings from forcing
   horizontal scroll. Applied last so they win without !important.
   ========================================================================== */
@media (max-width: 860px) {

  /* --- Vertical rhythm: desktop spacing wastes most of a phone screen --- */
  :root {
    --s-7: 2.25rem;
    --s-8: 2.75rem;
    --s-9: 3.25rem;
    --s-10: 4rem;
  }
  .hero { padding-block: var(--s-6) var(--s-6); }
  .hero--page { padding-block: var(--s-5) var(--s-6); }
  .wrap { padding-inline: var(--s-4); }   /* 16px gutter */

  /* --- Typography --- */
  h1 { font-size: 2rem; letter-spacing: -.02em; }
  .hero h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; margin-top: var(--s-6); }
  h3 { font-size: 1.1875rem; }
  .lede, .hero__lede { font-size: 1.0625rem; }
  /* Long URLs, emails and program names must not force a scrollbar. */
  body { overflow-wrap: break-word; }
  h1, h2, h3, h4, p, li, td, th, dd, summary { overflow-wrap: anywhere; }

  /* --- Buttons: full width so the primary action is unmissable --- */
  .cta-group { flex-direction: column; align-items: stretch; gap: var(--s-3); }
  .cta-group .btn { width: 100%; }
  .cta-group > a:not(.btn) { text-align: center; padding-block: var(--s-2); }
  .btn { padding: .95em 1.35em; }
  .btn--lg { font-size: var(--t-base); padding: 1.05em 1.35em; }

  /* --- Tap targets: footer and card link lists need real height --- */
  .footer__grid ul a,
  .footer__creds a,
  .footer__legal-links a {
    display: inline-block;
    padding-block: .45rem;
  }
  .footer__grid li, .footer__creds li { margin-bottom: 0; }
  .footer__legal-links { gap: var(--s-2) var(--s-5); }
  .crumbs ol { gap: .35em; }
  .toc li a { display: inline-block; padding-block: .3rem; }
  .sources li a { display: inline-block; padding-block: .3rem; }
  .faq summary { padding-block: var(--s-4); }

  /* --- Cards and grids --- */
  .card { padding: var(--s-4); }
  .goal { min-height: 96px; padding: var(--s-3); }
  .ctaband { padding: var(--s-5); border-radius: var(--r-md); }
  .ctaband--inline { padding: var(--s-5); }
  .ctaband h2 { font-size: 1.375rem; }

  /* --- Tables: keep them readable, and show they can be scrolled --- */
  .table-wrap {
    -webkit-overflow-scrolling: touch;
    background:
      linear-gradient(to right, #fff 30%, rgba(255,255,255,0)),
      linear-gradient(to right, rgba(255,255,255,0), #fff 70%) 100% 0,
      radial-gradient(farthest-side at 0 50%, rgba(10,33,72,.14), transparent),
      radial-gradient(farthest-side at 100% 50%, rgba(10,33,72,.14), transparent) 100% 0;
    background-repeat: no-repeat;
    background-size: 36px 100%, 36px 100%, 14px 100%, 14px 100%;
    background-attachment: local, local, scroll, scroll;
  }
  th, td { padding: .65rem .75rem; }
  table { font-size: var(--t-xs); }

  /* --- Author / RCIC blocks --- */
  .rcic__creds li { flex-direction: column; gap: .1rem; margin-bottom: var(--s-3); }
  .rcic__creds .k { min-width: 0; font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .05em; }
  .reviewed { flex-direction: column; gap: var(--s-1); }

  /* --- Forms: 16px+ prevents iOS zooming on focus --- */
  input[type="text"], input[type="email"], input[type="tel"],
  input[type="number"], select, textarea {
    font-size: 16px;
    padding: .8rem .85rem;
  }
  .opt span { padding: .9rem 1rem; }
  .rm__step { padding: var(--s-4); border-radius: var(--r-md); }
  .rm__nav { gap: var(--s-3); }
  .rm__nav .btn { flex: 1 1 auto; }

  /* --- Sticky CTA clearance (the bar is ~74px + safe area) --- */
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }

  /* Remove the tap flash, keep a real focus ring for keyboard users. */
  a, button, summary, label { -webkit-tap-highlight-color: rgba(11,62,143,.12); }
}

/* Very small phones */
@media (max-width: 380px) {
  h1, .hero h1 { font-size: 1.75rem; }
  .goals { gap: var(--s-3); }
  .goal { font-size: var(--t-xs); }
  .brand__tag { display: none; }
  .brand__name { font-size: 1rem; }
}

/* Landscape phones: the sticky bar eats too much of a short viewport */
@media (max-width: 860px) and (orientation: landscape) and (max-height: 480px) {
  .stickycta { display: none; }
  body { padding-bottom: 0; }
}

@media print {
  .site-header, .stickycta, .ctaband, .site-footer { display: none; }
  body { padding-bottom: 0; }
  .faq details { open: true; }
}
