/* =======================================================
   Calculon.ca - Global Brand Styles
   Ontario flag palette: Red #C8102E | Blue #012169 | Gold #F3CC00 | Green #007934
   ======================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --on-red:        #C8102E;
  --on-red-dark:   #9E0C24;
  --on-red-soft:   #fde8ec;
  --on-blue:       #012169;
  --on-blue-dark:  #00154a;
  --on-blue-soft:  #e8edf8;
  --on-gold:       #F3CC00;
  --on-gold-dark:  #c9a800;
  --on-gold-soft:  #fffbe0;
  --on-green:      #007934;
  --on-green-soft: #e3f4ea;
  --on-white:      #FFFFFF;
  --ink:           #0f172a;
  --ink-soft:      #475569;
  --ink-mute:      #64748b;
  --line:          #e2e8f0;
  --bg-soft:       #f8fafc;
  --radius:        12px;
  --shadow:        0 1px 3px rgba(1,33,105,.08), 0 6px 20px rgba(1,33,105,.06);
  --shadow-hover:  0 4px 12px rgba(1,33,105,.14), 0 16px 36px rgba(1,33,105,.12);
  --maxw:          1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: #fff; color: var(--ink); line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--on-blue); text-decoration: none; }
a:hover { color: var(--on-red); }
img { max-width: 100%; height: auto; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow    { max-width: 820px;  margin: 0 auto; padding: 0 24px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 13px 26px; border-radius: 10px; font-weight: 700; font-size: .97rem;
  border: 2px solid transparent;
  transition: transform .15s, background .15s, box-shadow .15s;
  font-family: inherit; line-height: 1.2;
}
.btn:hover { transform: translateY(-1px); }
.btn-red     { background: var(--on-red);  color: #fff; }
.btn-red:hover { background: var(--on-red-dark); color: #fff; }
.btn-gold    { background: var(--on-gold); color: var(--on-blue); }
.btn-gold:hover { background: #ffe033; color: var(--on-blue); }
.btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,.5); }
.btn-outline:hover { background: rgba(255,255,255,.12); color: #fff; border-color: #fff; }
.btn-ghost   { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-soft); }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.site-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 900; font-size: 1.2rem; color: var(--ink);
  text-decoration: none; white-space: nowrap; flex-shrink: 0;
}
.site-logo img { width: 36px; height: 36px; border-radius: 6px; }
.logo-text { color: var(--on-red); }
.site-nav  { display: flex; gap: 4px; align-items: center; }
.site-nav a {
  padding: 8px 14px; border-radius: 7px; font-size: .9rem; font-weight: 600;
  color: var(--ink-mute); transition: background .15s, color .15s;
  text-decoration: none; white-space: nowrap;
}
.site-nav a:hover { background: var(--bg-soft); color: var(--ink); }
.site-nav .nav-cta { background: var(--on-red); color: #fff !important; padding: 8px 18px; border-radius: 7px; }
.site-nav .nav-cta:hover { background: var(--on-red-dark); }
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  padding: 6px; color: var(--ink); flex-shrink: 0;
}
.mobile-nav {
  display: none; flex-direction: column; gap: 4px;
  padding: 10px 16px 16px; border-top: 1px solid var(--line); background: #fff;
}
.mobile-nav a {
  padding: 11px 14px; border-radius: 8px;
  font-size: .95rem; font-weight: 600; color: var(--ink); text-decoration: none;
}
.mobile-nav a:hover { background: var(--bg-soft); }
.mobile-nav .nav-cta { background: var(--on-red); color: #fff !important; text-align: center; margin-top: 4px; }
@media (max-width: 640px) {
  .site-nav   { display: none !important; }
  .nav-toggle { display: flex !important; }
}

/* ---- Ontario tricolour stripe ---- */
.on-stripe {
  height: 5px;
  background: linear-gradient(90deg, var(--on-red) 0 33.3%, var(--on-gold) 33.3% 66.6%, var(--on-green) 66.6% 100%);
}

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--on-blue-dark) 0%, var(--on-blue) 65%, #0c2f8a 100%);
  color: #fff; padding: 80px 0 88px; position: relative; overflow: hidden;
}
.hero::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
  background: linear-gradient(90deg, var(--on-red) 0 33.3%, var(--on-gold) 33.3% 66.6%, var(--on-green) 66.6% 100%);
}
.hero::before {
  content: ''; position: absolute; top: -60px; right: -80px;
  width: 480px; height: 480px; border-radius: 50%;
  background: rgba(243,204,0,.05); pointer-events: none;
}
.hero-badge {
  display: inline-block;
  background: rgba(243,204,0,.15); color: var(--on-gold);
  border: 1px solid rgba(243,204,0,.4);
  padding: 6px 16px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 24px;
}
.hero h1 {
  font-size: clamp(2.2rem, 4.8vw, 3.4rem);
  line-height: 1.1; font-weight: 900; letter-spacing: -.025em; max-width: 820px; margin-bottom: 18px;
}
.hero h1 em { font-style: normal; color: var(--on-gold); }
.hero .lead { font-size: 1.15rem; max-width: 640px; color: #cdd8f0; margin-bottom: 34px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 44px; }
.hero-stats {
  display: inline-flex; background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18); border-radius: 14px; overflow: hidden;
}
.hero-stat { padding: 18px 32px; text-align: center; border-right: 1px solid rgba(255,255,255,.15); }
.hero-stat:last-child { border-right: none; }
.hero-stat .n { font-size: 1.85rem; font-weight: 900; color: var(--on-gold); letter-spacing: -.02em; }
.hero-stat .l { font-size: .72rem; color: #a0b4d8; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin-top: 2px; }
@media (max-width: 640px) {
  .hero { padding: 56px 0 64px; }
  .hero-stats { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .hero-stat { border-bottom: 1px solid rgba(255,255,255,.12); }
  .hero-stat:nth-child(even) { border-right: none; }
}

/* ---- Trust strip ---- */
.trust-strip {
  background: var(--on-blue-soft);
  border-top: 1px solid #c8d3ec; border-bottom: 1px solid #c8d3ec; padding: 26px 24px;
}
.trust-inner {
  max-width: 960px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 22px; text-align: center;
}
.trust-icon  { font-size: 1.4rem; margin-bottom: 4px; }
.trust-label { font-size: .82rem; font-weight: 700; color: var(--on-blue); }
.trust-sub   { font-size: .74rem; color: var(--ink-mute); }

/* ---- Sections ---- */
.section { padding: 68px 0; }
.section.alt { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-label  { font-size: .74rem; font-weight: 700; color: var(--on-red); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 10px; }
.section-title  { font-size: clamp(1.65rem, 3vw, 2.2rem); font-weight: 900; color: var(--on-blue); letter-spacing: -.02em; margin-bottom: 10px; }
.section-desc   { color: var(--ink-soft); max-width: 560px; }
.section-header { margin-bottom: 44px; }
.cat-label {
  font-size: .9rem; font-weight: 800; color: var(--on-blue);
  margin: 36px 0 16px; display: flex; align-items: center; gap: 10px;
}
.cat-label::before { content: ''; width: 28px; height: 4px; border-radius: 2px; background: var(--on-red); }

/* ---- Calculator cards ---- */
.tools-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .tools-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .tools-grid { grid-template-columns: 1fr; } }
.tool-card {
  background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--on-blue);
  border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column;
  box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s, border-top-color .18s;
  text-decoration: none; color: inherit;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-top-color: var(--on-red); color: inherit; }
.tool-card-icon  { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 16px; }
.tool-card-cat   { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.tool-card-title { font-size: 1.05rem; font-weight: 800; color: var(--on-blue); margin-bottom: 10px; line-height: 1.3; }
.tool-card-desc  { font-size: .88rem; color: var(--ink-soft); line-height: 1.6; flex: 1; margin-bottom: 18px; }
.tool-card-pills { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 18px; }
.pill { background: var(--bg-soft); color: var(--ink-soft); font-size: .72rem; font-weight: 600; padding: 3px 10px; border-radius: 20px; }
.tool-card-link {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-soft); border: 1px solid var(--line);
  color: var(--on-red); padding: 11px 16px; border-radius: 8px;
  font-weight: 700; font-size: .88rem; transition: background .15s, border-color .15s;
}
.tool-card:hover .tool-card-link { background: var(--on-red-soft); border-color: #f9a3b0; }

/* ---- Blog category cards ---- */
.blog-cats { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }
@media (max-width: 768px) { .blog-cats { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 480px) { .blog-cats { grid-template-columns: 1fr; } }
.blog-cat-card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 24px;
  transition: box-shadow .18s, transform .18s; text-decoration: none; color: inherit; display: block;
}
.blog-cat-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); color: inherit; }
.blog-cat-icon  { font-size: 2rem; margin-bottom: 12px; }
.blog-cat-title { font-size: 1rem; font-weight: 800; color: var(--on-blue); margin-bottom: 8px; }
.blog-cat-desc  { font-size: .85rem; color: var(--ink-soft); line-height: 1.6; margin-bottom: 14px; }
.blog-cat-count { font-size: .75rem; color: var(--ink-mute); font-weight: 600; margin-bottom: 14px; }
.blog-cat-link  { font-size: .88rem; font-weight: 700; color: var(--on-red); display: flex; align-items: center; gap: 6px; }

/* ---- Footer ---- */
.site-footer { background: #0f172a; color: #475569; padding: 56px 24px 32px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; }
.footer-top { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
@media (max-width: 768px) { .footer-top { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-top { grid-template-columns: 1fr; } }
.footer-logo { font-weight: 900; font-size: 1.1rem; color: #fff; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.footer-logo img { width: 32px; height: 32px; border-radius: 5px; }
.footer-tagline { font-size: .88rem; color: #475569; line-height: 1.65; max-width: 280px; }
.footer-col h4 { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #64748b; margin-bottom: 14px; }
.footer-col a { display: block; font-size: .88rem; color: #475569; padding: 3px 0; font-weight: 500; transition: color .15s; }
.footer-col a:hover { color: #94a3b8; }
.footer-bottom {
  border-top: 1px solid #1e293b; padding-top: 22px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.footer-copy  { font-size: .78rem; color: #334155; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-legal a { font-size: .78rem; color: #334155; transition: color .15s; }
.footer-legal a:hover { color: #64748b; }

/* ---- Prose (legal / about / methodology) ---- */
.page-head { background: var(--on-blue); color: #fff; padding: 54px 0 48px; border-bottom: 5px solid var(--on-gold); }
.page-head h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 900; letter-spacing: -.02em; }
.page-head p  { color: #c8d4f0; margin-top: 10px; max-width: 640px; }
.prose { padding: 48px 0 72px; }
.prose h2 { font-size: 1.4rem; font-weight: 800; color: var(--on-blue); margin: 38px 0 10px; letter-spacing: -.01em; }
.prose h3 { font-size: 1.1rem; font-weight: 700; margin: 24px 0 8px; }
.prose p  { margin-bottom: 14px; color: #1e293b; }
.prose ul, .prose ol { margin: 0 0 16px 22px; }
.prose li { margin-bottom: 6px; }
.prose a  { color: var(--on-red); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.prose table { width: 100%; border-collapse: collapse; margin: 14px 0 24px; font-size: .94rem; }
.prose th { background: var(--on-blue); color: #fff; text-align: left; padding: 10px 13px; }
.prose td { border-bottom: 1px solid var(--line); padding: 10px 13px; vertical-align: top; }
.prose tr:nth-child(even) td { background: var(--bg-soft); }
.notice { background: var(--on-gold-soft); border-left: 5px solid var(--on-gold); padding: 14px 18px; border-radius: 8px; margin: 18px 0; font-size: .95rem; }
.notice.blue  { background: var(--on-blue-soft);  border-left-color: var(--on-blue); }
.notice.red   { background: var(--on-red-soft);   border-left-color: var(--on-red); }
.notice.green { background: var(--on-green-soft);  border-left-color: var(--on-green); }

/* ---- Forms ---- */
.form-row   { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 540px) { .form-row { grid-template-columns: 1fr; } }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.req { color: var(--on-red); }
.form-input {
  width: 100%; padding: 12px 14px; border: 1.5px solid #cbd5e1; border-radius: 8px;
  font: inherit; background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.form-input:focus { outline: none; border-color: var(--on-blue); box-shadow: 0 0 0 3px rgba(1,33,105,.15); }
textarea.form-input { min-height: 150px; resize: vertical; }
.hp-field { position: absolute; left: -9999px; opacity: 0; height: 0; width: 0; }
.btn-submit { background: var(--on-red); color: #fff; border: none; padding: 13px 30px; border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer; transition: background .15s; }
.btn-submit:hover { background: var(--on-red-dark); }
.btn-submit:disabled { opacity: .6; cursor: not-allowed; }
.spinner { display: none; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; margin-left: 8px; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.form-note   { font-size: .85rem; color: var(--ink-mute); }
.form-submit { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.msg-ok, .msg-err { display: none; padding: 16px 18px; border-radius: 8px; font-weight: 600; margin-top: 16px; }
.msg-ok  { background: var(--on-green-soft); color: #064e24; border-left: 5px solid var(--on-green); }
.msg-err { background: var(--on-red-soft);   color: #7a0a1c; border-left: 5px solid var(--on-red); }

/* ---- FAQ ---- */
details.faq { border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin-bottom: 10px; background: #fff; }
details.faq summary { font-weight: 700; cursor: pointer; color: var(--on-blue); }
details.faq p { margin-top: 10px; color: var(--ink-soft); }

/* ---- Blog article layout ---- */
.article-layout { display: grid; grid-template-columns: 1fr 300px; gap: 40px; max-width: var(--maxw); margin: 0 auto; padding: 0 24px 60px; }
@media (max-width: 900px) { .article-layout { grid-template-columns: 1fr; } }

/* ---- Utility ---- */
.text-red   { color: var(--on-red); }
.text-blue  { color: var(--on-blue); }
.text-gold  { color: var(--on-gold-dark); }
.text-green { color: var(--on-green); }
.bg-blue    { background: var(--on-blue); }
.bg-red     { background: var(--on-red); }
