/* ==========================================================================
   Promissory.ca — brand stylesheet
   Palette sampled directly from the logo:
     primary navy  #0A417A  (wordmark + mark body)
     deep navy     #003B75  (mark shadow / gradient end)
     accent blue   #2E7DD1  (fold highlight)
     white         #FFFFFF  (mark lines)
   ========================================================================== */

:root {
  --primary: #0a417a;
  --primary-dark: #062c55;
  --primary-darker: #041d38;
  --accent: #2e7dd1;
  --accent-light: #e8f1fb;
  --accent-soft: #f2f7fd;

  --text: #16202c;
  --text-muted: #5a6b7d;
  --text-invert: #ffffff;

  --bg: #ffffff;
  --bg-alt: #f5f8fc;
  --bg-navy: #0a417a;

  --border: #dce5ef;
  --border-strong: #c3d3e4;

  --success: #1b8a5a;
  --warning: #b7791f;
  --danger: #c0392b;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(10, 65, 122, 0.08);
  --shadow: 0 4px 14px rgba(10, 65, 122, 0.1);
  --shadow-lg: 0 12px 32px rgba(10, 65, 122, 0.16);

  --max-width: 1160px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  --font-head: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue",
    Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--accent);
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  color: var(--primary-dark);
  line-height: 1.25;
  margin: 0 0 0.5em;
  font-weight: 700;
}

h1 {
  font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.85rem);
  margin-top: 1.6em;
}

h3 {
  font-size: 1.2rem;
  margin-top: 1.4em;
}

p {
  margin: 0 0 1.1em;
}

ul,
ol {
  padding-left: 1.3em;
}

li {
  margin-bottom: 0.4em;
}

code,
kbd {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.1em 0.4em;
  font-size: 0.9em;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ---------- layout ---------- */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.narrow {
  max-width: 820px;
}

main {
  display: block;
  min-height: 40vh;
}

.section {
  padding: 48px 0;
}

.section--alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  max-width: 720px;
  margin: 0 auto 28px;
  text-align: center;
}

.section-head p {
  color: var(--text-muted);
  margin-bottom: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--primary-dark);
  color: #fff;
  padding: 10px 18px;
  z-index: 200;
  border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus {
  left: 0;
  color: #fff;
}

/* ---------- header ---------- */

.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 60;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.brand:hover {
  text-decoration: none;
  color: var(--primary-dark);
}

.brand img {
  height: 40px;
  width: auto;
  display: block;
}

.brand .brand-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(160deg, var(--accent) 0%, var(--primary) 55%, var(--primary-dark) 100%);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--primary);
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  border-bottom: 2px solid var(--accent);
  padding-bottom: 2px;
}

.header-cta {
  background: var(--primary);
  color: #fff !important;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
}

.header-cta:hover {
  background: var(--primary-dark);
  text-decoration: none;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background: var(--primary-dark);
  color: #fff;
}

.btn--accent {
  background: var(--accent);
  color: #fff;
}

.btn--accent:hover {
  background: var(--primary);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn--ghost:hover {
  background: var(--accent-light);
}

.btn--block {
  width: 100%;
}

/* ---------- hero ---------- */

.hero {
  background: linear-gradient(165deg, var(--primary) 0%, var(--primary-dark) 70%, var(--primary-darker) 100%);
  color: #fff;
  padding: 64px 0 56px;
}

.hero h1 {
  color: #fff;
  max-width: 22ch;
}

.hero p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  max-width: 62ch;
}

.hero .hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.hero .btn--ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}

.hero .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 26px;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.92);
}

.hero-badges span::before {
  content: "\2713";
  color: #9fd0ff;
  font-weight: 800;
  margin-right: 6px;
}

/* ---------- cards & grids ---------- */

.grid {
  display: grid;
  gap: 22px;
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.card h3 {
  margin-top: 0;
  font-size: 1.12rem;
}

.card h3 a {
  color: var(--primary-dark);
}

.card p {
  color: var(--text-muted);
  font-size: 0.96rem;
  margin-bottom: 0.8em;
}

.card .card-link {
  margin-top: auto;
  font-weight: 700;
  font-size: 0.92rem;
}

.card--offer {
  border-color: var(--border-strong);
}

.card--offer .offer-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.card--offer .offer-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border);
}

.card--offer .offer-tag {
  display: inline-block;
  background: var(--accent-light);
  color: var(--primary-dark);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 8px;
}

/* ---------- lists / steps / tables ---------- */

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 0 52px;
  margin-bottom: 20px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--primary);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 0 1.4em;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 520px;
}

caption {
  caption-side: top;
  text-align: left;
  font-weight: 700;
  padding: 12px 16px;
  color: var(--primary-dark);
  border-bottom: 1px solid var(--border);
  background: var(--accent-soft);
}

th,
td {
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

thead th {
  background: var(--bg-alt);
  color: var(--primary-dark);
  font-weight: 700;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:nth-child(even) {
  background: var(--accent-soft);
}

/* ---------- callouts ---------- */

.callout {
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 16px 20px;
  margin: 0 0 1.4em;
}

.callout--warning {
  border-left-color: var(--warning);
  background: #fdf6e7;
}

.callout--source {
  border-left-color: var(--primary);
  background: var(--bg-alt);
  font-size: 0.92rem;
}

.callout h3,
.callout h4 {
  margin-top: 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

/* ---------- TOC ---------- */

.toc {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 0 0 1.8em;
}

.toc h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.toc ol {
  margin: 0;
  padding-left: 1.2em;
  font-size: 0.95rem;
}

/* ---------- breadcrumbs ---------- */

.breadcrumb {
  font-size: 0.86rem;
  color: var(--text-muted);
  padding: 14px 0 0;
}

.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--border-strong);
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--primary);
}

/* ---------- tools ---------- */

.tool {
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 26px;
  margin: 0 0 1.8em;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary-dark);
}

.field input,
.field select {
  font: inherit;
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
}

.field input:focus,
.field select:focus {
  outline: 3px solid var(--accent-light);
  border-color: var(--accent);
}

.field .hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tool-result {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 6px;
}

.tool-result .result-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 4px;
}

.tool-result .result-value {
  font-size: clamp(1.7rem, 1.2rem + 2vw, 2.4rem);
  font-weight: 800;
  margin: 0 0 4px;
  line-height: 1.1;
}

.tool-result .result-note {
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

.result-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.result-breakdown div {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.result-breakdown dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.78);
}

.result-breakdown dd {
  margin: 2px 0 0;
  font-weight: 700;
  font-size: 1.05rem;
}

.tool-error {
  color: var(--danger);
  font-weight: 600;
  font-size: 0.9rem;
  min-height: 1.2em;
  margin: 8px 0 0;
}

/* ---------- FAQ ---------- */

.faq {
  border-top: 1px solid var(--border);
}

.faq details {
  border-bottom: 1px solid var(--border);
  padding: 6px 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--primary-dark);
  padding: 12px 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

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

.faq summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1.3rem;
  line-height: 1;
}

.faq details[open] summary::after {
  content: "\2212";
}

.faq details p {
  color: var(--text-muted);
  margin: 0 0 14px;
}

/* ---------- notices ---------- */

.disclaimer {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 24px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.disclaimer h2,
.disclaimer h3 {
  font-size: 0.95rem;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0;
}

.disclaimer p:last-child {
  margin-bottom: 0;
}

.affiliate-disclosure {
  background: #fff8e6;
  border: 1px solid #f0d9a0;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.85rem;
  color: #6b5518;
  margin: 0 0 1.2em;
}

.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 1.6em;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.byline strong {
  color: var(--text);
}

/* ---------- CTA band ---------- */

.cta-band {
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 34px 30px;
  text-align: center;
  margin: 2.4em 0;
}

.cta-band h2 {
  color: #fff;
  margin-top: 0;
}

.cta-band p {
  color: rgba(255, 255, 255, 0.9);
  max-width: 60ch;
  margin: 0 auto 1.2em;
}

/* ---------- city lists ---------- */

.city-list {
  columns: 2;
  column-gap: 32px;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.94rem;
}

.city-list li {
  break-inside: avoid;
  padding: 3px 0;
}

.province-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.province-chip {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-weight: 700;
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.province-chip span {
  display: block;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.province-chip:hover {
  text-decoration: none;
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--primary-darker);
  color: rgba(255, 255, 255, 0.82);
  margin-top: 60px;
  padding: 46px 0 26px;
  font-size: 0.92rem;
}

.site-footer h2,
.site-footer h3 {
  color: #fff;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 28px;
  margin-bottom: 30px;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-grid li {
  margin-bottom: 7px;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.82);
}

.site-footer a:hover {
  color: #fff;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.footer-brand img {
  height: 34px;
  width: auto;
  filter: brightness(0) invert(1);
}

.footer-legal {
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  padding-top: 20px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.66);
}

.footer-legal p {
  margin-bottom: 0.7em;
}

/* ---------- utilities ---------- */

.muted {
  color: var(--text-muted);
}

.small {
  font-size: 0.88rem;
}

.center {
  text-align: center;
}

.mt-0 {
  margin-top: 0;
}

.mb-0 {
  margin-bottom: 0;
}

.mb-1 {
  margin-bottom: 1em;
}

.mb-2 {
  margin-bottom: 2em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- responsive ---------- */

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .header-inner {
    gap: 10px;
  }

  .site-nav {
    gap: 14px;
    width: 100%;
    order: 3;
  }

  .city-list {
    columns: 1;
  }

  .section {
    padding: 34px 0;
  }

  .hero {
    padding: 46px 0 40px;
  }
}

@media print {
  .site-header,
  .site-footer,
  .cta-band,
  .header-cta {
    display: none;
  }
}

/* ---------- search ---------- */

.search-results {
  list-style: none;
  padding: 0;
  margin: 1.4em 0 0;
  border-top: 1px solid var(--border);
}

.search-result {
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
  margin: 0;
}

.search-result a {
  font-size: 1.02rem;
  font-weight: 700;
}

.search-result .small {
  margin: 4px 0 0;
}

.search-result p {
  margin: 4px 0 0;
}
