/* ===========================================================
   VictoryCore — shared design system
   Palette: deep forest green (trust/money) + warm bazaar orange
   Type: Sora (headings) + Manrope (body)
   =========================================================== */

:root {
  --bg: #F6F7F5;
  --surface: #FFFFFF;
  --surface-2: #EFF2ED;
  --ink: #14231B;
  --ink-soft: #4B5B54;
  --border: #E1E5DE;
  --brand: #0F5132;
  --brand-dark: #0B3B24;
  --brand-tint: #EAF6EE;
  --accent: #FF7A1A;
  --accent-dark: #D4640D;
  --danger: #B3261E;
  --shadow: 0 1px 2px rgba(15, 30, 22, 0.06), 0 8px 24px rgba(15, 30, 22, 0.06);
  --radius: 14px;
  --radius-sm: 8px;
  --max-width: 1080px;
}

:root[data-theme="dark"] {
  --bg: #0E1512;
  --surface: #16211B;
  --surface-2: #1C2921;
  --ink: #EAF3EC;
  --ink-soft: #A8B8AE;
  --border: #253A2E;
  --brand: #3FAE72;
  --brand-dark: #2E8759;
  --brand-tint: #16281F;
  --accent: #FF9142;
  --accent-dark: #FFA75E;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1512;
    --surface: #16211B;
    --surface-2: #1C2921;
    --ink: #EAF3EC;
    --ink-soft: #A8B8AE;
    --border: #253A2E;
    --brand: #3FAE72;
    --brand-dark: #2E8759;
    --brand-tint: #16281F;
    --accent: #FF9142;
    --accent-dark: #FFA75E;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  transition: background 0.2s ease, color 0.2s ease;
}

h1, h2, h3, h4 {
  font-family: "Sora", "Manrope", sans-serif;
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 600; }

p { color: var(--ink-soft); margin: 0 0 1em; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

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

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
}

.logo:hover { text-decoration: none; }

.logo .mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
}

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

.main-nav a {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.94rem;
}

.main-nav a:hover { color: var(--brand); text-decoration: none; }

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--surface-2);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink);
  font-size: 1.1rem;
}

@media (max-width: 760px) {
  .main-nav {
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px 20px;
    gap: 14px;
    display: none;
  }
  .main-nav.open { display: flex; }
  .nav-toggle { display: flex; }
}

/* ---------- Hero ---------- */

.hero {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border);
}

.hero .eyebrow {
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 10px;
  display: inline-block;
}

.hero p.lead {
  max-width: 620px;
  font-size: 1.08rem;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.98rem;
  border: none;
  cursor: pointer;
  font-family: "Sora", sans-serif;
}

.button.primary {
  background: var(--accent);
  color: #241000;
}
.button.primary:hover { background: var(--accent-dark); text-decoration: none; }

.button.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
}
.button.secondary:hover { border-color: var(--brand); text-decoration: none; }

/* ---------- Tool list ---------- */

.tool-list {
  padding: 48px 0 64px;
}

.tool-row {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}

.tool-row.disabled {
  border-left-color: var(--border);
  opacity: 0.65;
}

.tool-row .icon {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 10px;
  background: var(--brand-tint);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.tool-row .info { flex: 1; min-width: 0; }
.tool-row h3 { margin-bottom: 2px; }
.tool-row p { margin: 0; font-size: 0.93rem; }

.tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-soft);
  flex: none;
}

@media (max-width: 560px) {
  .tool-row { flex-wrap: wrap; }
}

/* ---------- Calculator card ---------- */

.tool-page-header {
  padding: 40px 0 8px;
}

.tool-page-header p.lead { max-width: 640px; }

.calc-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding: 24px 0 56px;
  align-items: start;
}

@media (max-width: 800px) {
  .calc-wrap { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--ink);
}

.field .hint {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 4px;
}

.field input[type="number"],
.field select {
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.98rem;
  font-family: inherit;
}

.field input[type="number"]:focus,
.field select:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.calc-btn {
  width: 100%;
  margin-top: 4px;
}

.result-highlight {
  background: var(--brand-tint);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: center;
  margin-bottom: 18px;
}

.result-highlight .amount {
  font-family: "Sora", sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--brand);
}

.result-highlight .amount.negative { color: var(--danger); }

.result-highlight .label {
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-weight: 600;
}

.breakdown {
  list-style: none;
  margin: 0;
  padding: 0;
}

.breakdown li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.93rem;
}

.breakdown li:last-child { border-bottom: none; }
.breakdown li span:first-child { color: var(--ink-soft); }
.breakdown li span:last-child { font-weight: 700; }

.note-box {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-top: 4px;
}

.content-block {
  padding: 8px 0 56px;
  max-width: 720px;
}

.content-block h2 { margin-top: 1.4em; }
.content-block h3 { margin: 0 0 8px; font-size: 1.02rem; }
.content-block ul { padding-left: 1.2em; }
.content-block li { margin-bottom: 6px; }

/* ---------- Content tables ---------- */

.table-scroll {
  overflow-x: auto;
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 480px;
}

.table-scroll thead th {
  background: var(--surface-2);
  color: var(--ink);
  font-family: "Sora", sans-serif;
  font-weight: 700;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table-scroll tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--ink-soft);
}

.table-scroll tbody tr:last-child td { border-bottom: none; }
.table-scroll tbody tr:nth-child(odd) { background: var(--surface); }
.table-scroll tbody tr:nth-child(even) { background: var(--surface-2); }
.table-scroll tbody td:first-child { color: var(--ink); font-weight: 600; }

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

.faq-list {
  margin-top: 12px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 12px;
}

.faq-item h3 {
  color: var(--brand);
  font-family: "Sora", sans-serif;
}

.faq-item p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
}


/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 36px 0 30px;
  background: var(--surface);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 16px;
}

.footer-links a {
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 600;
}

.footer-note {
  font-size: 0.8rem;
  color: var(--ink-soft);
  max-width: 640px;
}

.copyright {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 14px;
}

/* Accessibility */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ===========================================================
   Additions: skip link, breadcrumbs, related tools, home blocks
   =========================================================== */

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 999;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

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

.breadcrumb {
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); text-decoration: underline; }
.breadcrumb span { margin: 0 6px; opacity: .5; }

.updated-note {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--ink-soft);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 4px 12px;
  margin-top: 12px;
}

.related-tools {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding-top: 28px;
}
.related-tools h2 { margin-top: 0; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.related-grid a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .15s ease, transform .15s ease;
}
.related-grid a:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}
.related-grid strong { display: block; font-weight: 700; margin-bottom: 4px; }
.related-grid span { font-size: 0.86rem; color: var(--ink-soft); }

.home-section { padding: 40px 0 8px; }
.home-section h2 { font-family: 'Sora', sans-serif; margin-bottom: 8px; }
.home-section > .container > p { color: var(--ink-soft); max-width: 70ch; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.feature-grid .card h3 { margin: 0 0 6px; font-size: 1.02rem; }
.feature-grid .card p { margin: 0; font-size: 0.92rem; color: var(--ink-soft); }

.audience-list { margin-top: 18px; }
.audience-list .tool-row .icon { font-size: 1.1rem; }

.error-page { text-align: center; padding: 70px 0; }
.error-page h1 { font-size: clamp(3rem, 12vw, 6rem); margin: 0; color: var(--brand); }

/* ===========================================================
   Additions v2 — form controls, ad slots, cookie bar,
   tool-row affordance, money-flow graphic
   =========================================================== */

/* ---------- Text inputs & textareas ----------
   Previously only input[type=number] and select were styled, so the
   contact form's text fields fell back to browser defaults. */

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="url"],
.field textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  font-size: 0.98rem;
  font-family: inherit;
  line-height: 1.5;
}

.field textarea {
  min-height: 150px;
  resize: vertical;
}

.field input[type="text"]:focus,
.field input[type="email"]:focus,
.field input[type="tel"]:focus,
.field input[type="url"]:focus,
.field textarea:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.field input::placeholder,
.field textarea::placeholder { color: var(--ink-soft); opacity: 0.7; }

/* ---------- Standalone form card (contact page) ----------
   .calc-wrap is a 2-column grid meant for input card + result card.
   A single form needs its own single-column wrapper. */

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin: 18px 0 8px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 620px) {
  .form-row { grid-template-columns: 1fr; gap: 0; }
}

/* ---------- Tool rows: make the whole card feel clickable ---------- */

a .tool-row { transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }

a:hover .tool-row {
  border-color: var(--brand);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

a:hover .tool-row h3 { color: var(--brand); }
a:focus-visible .tool-row { outline: 3px solid var(--accent); outline-offset: 3px; }
a:hover .tool-row, a:hover .tool-row h3 { text-decoration: none; }

/* ---------- Cookie notice ---------- */

.cookie-bar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
  padding: 14px 18px;
  animation: vc-rise .22s ease-out;
}

.cookie-bar p {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink-soft);
  flex: 1;
}

.cookie-bar .button.primary { padding: 9px 18px; font-size: 0.88rem; flex: none; }
.cookie-bar.is-hiding { opacity: 0; transition: opacity .2s ease; }

@keyframes vc-rise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 560px) {
  .cookie-bar { flex-direction: column; align-items: stretch; text-align: left; gap: 12px; }
  .cookie-bar .button.primary { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-bar { animation: none; }
}

/* ---------- Money-flow graphic (home hero) ---------- */

.money-flow {
  margin-top: 34px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px 18px;
  max-width: 660px;
}

.money-flow .mf-title {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  margin: 0 0 4px;
}

.money-flow .mf-sub { font-size: 0.82rem; margin: 0 0 16px; color: var(--ink-soft); }

.mf-bar {
  display: flex;
  height: 30px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.mf-bar span { display: block; height: 100%; }
.mf-seg-keep  { background: var(--brand); }
.mf-seg-cost  { background: var(--accent); }
.mf-seg-fee   { background: var(--accent-dark); opacity: .85; }
.mf-seg-gst   { background: var(--ink-soft); opacity: .55; }

.mf-legend {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px 18px;
}

.mf-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.83rem;
  color: var(--ink-soft);
}

.mf-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}

.mf-legend b { color: var(--ink); font-weight: 700; margin-left: auto; }

.money-flow .mf-foot { font-size: 0.78rem; margin: 14px 0 0; color: var(--ink-soft); }

/* ---------- Reading-measure alignment fix ----------
   .content-block was `max-width:720px` on a centred container, so prose
   sat ~160px to the right of the H1 above it. Keep the comfortable
   measure, but align its left edge with the rest of the page. */

.content-block { max-width: var(--max-width); }
.content-block > * { max-width: 760px; }
.content-block > .related-tools { max-width: none; }

/* ---------- Hero polish ---------- */

.hero .button.primary { margin-bottom: 4px; }
.hero .updated-note { display: block; width: fit-content; margin-top: 14px; }
.money-flow { margin-left: 0; margin-right: 0; }
/* .content-block's own padding shorthand was zeroing the container's
   horizontal padding, shifting prose 20px left of every heading. */
.content-block { padding: 8px 20px 56px; }
/* 4 legend items read better as a 2x2 block than a 3-up with an orphan */
.mf-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 28px; }
@media (max-width: 480px) { .mf-legend { grid-template-columns: 1fr; } }
/* Same padding-shorthand issue as .content-block: on mobile the calculator
   cards ran edge-to-edge with no gutter. */
.calc-wrap { padding: 24px 20px 56px; }
