/* ===========================================================
   Creditt — stylesheet
   Jost (display) + Inter (body). Navy/coral/purple palette.
   =========================================================== */

:root {
  --paper: #FFFFFF;
  --paper-alt: #F6F2FB;
  --ink: #413080;        /* Creditt navy */
  --ink-deep: #2E2260;
  --ink-soft: #6A5FA0;
  --purple-deep: #4B1F68;
  --text: #2B2640;
  --text-muted: #6A6478;
  --brass: #F19B70;      /* coral accent, from Creditt palette */
  --brass-dark: #D97D50;
  --teal: #413080;       /* reuse navy for calculator result panels */
  --teal-dark: #2E2260;
  --yellow: #FFD15D;
  --yellow-dark: #E3AE3F;
  --line: #E4DEF0;
  --line-dark: #CFC2E8;
  --white: #FFFFFF;
  --error: #B5482F;

  --serif: "Jost", "Century Gothic", "Futura", sans-serif; /* display, matches logo geometry */
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --max-w: 1180px;
  --radius: 4px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 500; }
h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1.1em; max-width: 62ch; color: var(--text); }
p.lede { font-size: 1.15rem; color: var(--text-muted); max-width: 52ch; }

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

.section { padding: 88px 0; }
.section--tight { padding: 56px 0; }
.section--alt { background: var(--paper-alt); }
.section--ink { background: var(--ink); color: #E9E5F7; }
.section--ink h2, .section--ink h3 { color: #FDFBF9; }
.section--ink p { color: #CFC7EA; }

.section--brand {
  background: linear-gradient(135deg, var(--ink-deep) 0%, var(--purple-deep) 45%, var(--brass) 100%);
  color: #FCF4EE;
}
.section--brand h2 { color: #FFFFFF; }
.section--brand p { color: #F2E2D6; }
.section--brand .btn-primary { background: var(--ink); }
.section--brand .btn-primary:hover { background: var(--ink-deep); }

hr.rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
}

/* -------------------- Buttons -------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 600;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-primary { background: var(--brass); color: var(--white); }
.btn-primary:hover { background: var(--brass-dark); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: var(--paper); }
.btn-ghost-light { background: transparent; color: #FDFBF5; border-color: #5C6B8A; }
.btn-ghost-light:hover { background: rgba(255,255,255,0.08); }
.btn-block { width: 100%; justify-content: center; }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

/* -------------------- Header / Nav -------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 248, 243, 0.94);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
}
.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.logo img { height: 30px; width: auto; display: block; }
.logo-text {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.01em;
}
.logo-text .dot { color: var(--brass); }

nav.main-nav { display: flex; align-items: center; gap: 4px; }
nav.main-nav > ul { list-style: none; display: flex; gap: 2px; margin: 0; padding: 0; }
nav.main-nav > ul > li { position: relative; }
nav.main-nav a.nav-link {
  display: block;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius);
}
nav.main-nav a.nav-link:hover, nav.main-nav a.nav-link.active { color: var(--ink); background: var(--paper-alt); }

.has-dropdown .dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  border: 1px solid var(--line);
  min-width: 220px;
  padding: 6px;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(22,35,63,0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown a {
  display: block;
  padding: 9px 12px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.93rem;
  border-radius: 2px;
}
.dropdown a:hover { background: var(--paper-alt); color: var(--ink); }

.nav-cta { margin-left: 10px; }
.nav-toggle { display: none; }
.mobile-panel { display: none; }

@media (max-width: 900px) {
  nav.main-nav > ul { display: none; }
  .nav-cta.desktop-only { display: none; }
  .nav-toggle {
    display: inline-flex;
    background: none; border: 1px solid var(--line-dark);
    border-radius: var(--radius); padding: 8px 12px; cursor: pointer;
  }
  .mobile-panel {
    position: absolute; top: 78px; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 10px 28px 24px;
  }
  .mobile-panel.open { display: block; }
  .mobile-panel a {
    display: block; padding: 12px 0; text-decoration: none;
    color: var(--ink); border-bottom: 1px solid var(--line);
    font-size: 1.02rem;
  }
  .mobile-panel .btn { margin-top: 16px; }
}

/* -------------------- Hero -------------------- */
.hero {
  padding: 72px 0 64px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 56px;
  align-items: start;
}
.hero h1 { margin-bottom: 0.35em; }
.hero-cta-row { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }

.stat-panel {
  border-left: 3px solid var(--brass);
  padding: 6px 0 6px 26px;
  margin-top: 12px;
}
.stat-panel .stat-figure {
  font-family: var(--serif);
  font-size: 2.6rem;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-panel .stat-label { color: var(--text-muted); font-size: 0.95rem; }
.stat-panel + .stat-panel { margin-top: 26px; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
}

/* -------------------- Process steps -------------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}
.step {
  padding: 30px 26px 30px 0;
  border-right: 1px solid var(--line);
}
.step:last-child { border-right: none; }
.step .step-num {
  font-family: var(--serif);
  color: var(--brass);
  font-size: 1.4rem;
  display: block;
  margin-bottom: 10px;
}
.step h3 { margin-bottom: 8px; }
.step p { font-size: 0.96rem; color: var(--text-muted); margin-bottom: 0; }

@media (max-width: 860px) {
  .steps { grid-template-columns: 1fr; }
  .step { border-right: none; border-bottom: 1px solid var(--line); padding: 26px 0; }
}

/* -------------------- Cards / grids -------------------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 34px; }
@media (max-width: 860px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.service-card {
  border: 1px solid var(--line);
  padding: 30px;
  background: var(--white);
  border-radius: var(--radius);
}
.service-card h3 { margin-bottom: 10px; }
.service-card a.link-arrow { color: var(--brass-dark); font-weight: 600; text-decoration: none; font-size: 0.94rem; }
.service-card a.link-arrow:hover { text-decoration: underline; }

/* -------------------- Testimonials -------------------- */
.testimonial {
  border-top: 1px solid var(--line);
  padding: 28px 0;
}
.testimonial p.quote {
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--ink);
  max-width: 62ch;
}
.testimonial .attrib { color: var(--text-muted); font-size: 0.92rem; }

/* -------------------- Lender panel strip -------------------- */
.lender-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.lender-strip span { color: var(--text-muted); font-size: 0.92rem; }

/* -------------------- Forms -------------------- */
.form-field { margin-bottom: 20px; }
.form-field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 0.98rem;
  background: var(--white);
  color: var(--text);
}
.form-field textarea { min-height: 120px; resize: vertical; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }
.form-note { font-size: 0.85rem; color: var(--text-muted); margin-top: -6px; }
.form-success, .form-error {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.95rem;
  display: none;
}
.form-success { background: #EAF1EC; color: var(--teal-dark); border: 1px solid #BFD6C6; }
.form-error { background: #F6E9E6; color: var(--error); border: 1px solid #E3C1B8; }

/* -------------------- Calculators -------------------- */
.calc-box {
  border: 1px solid var(--line);
  background: var(--white);
  padding: 36px;
  border-radius: var(--radius);
}
.calc-result {
  background: var(--teal);
  color: #F2F6F3;
  padding: 28px;
  border-radius: var(--radius);
}
.calc-result .figure {
  font-family: var(--serif);
  font-size: 2.3rem;
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}
.calc-result .figure-label { font-size: 0.9rem; color: #CFE0D8; }
.calc-result hr { border-color: rgba(255,255,255,0.2); margin: 18px 0; }
.calc-result .breakdown-row { display: flex; justify-content: space-between; font-size: 0.92rem; margin-bottom: 8px; color: #DCE9E3; }
.calc-slider-row { display: flex; align-items: center; gap: 14px; }
.calc-slider-row input[type=range] { flex: 1; accent-color: var(--brass); }
.calc-slider-row .calc-val { min-width: 84px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }

/* -------------------- FAQ accordion -------------------- */
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 20px 0;
  font-family: var(--serif);
  font-size: 1.1rem;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.faq-q .sign { font-family: var(--sans); font-size: 1.3rem; color: var(--brass); flex-shrink: 0; }
.faq-a { max-height: 0; overflow: hidden; transition: max-height 0.25s ease; }
.faq-a p { padding-bottom: 20px; color: var(--text-muted); }
.faq-item.open .faq-a { max-height: 400px; }

/* -------------------- Blog -------------------- */
.post-card { border-top: 1px solid var(--line); padding: 30px 0; display: grid; grid-template-columns: 140px 1fr; gap: 26px; }
.post-card .post-date { color: var(--text-muted); font-size: 0.88rem; padding-top: 6px; }
.post-card h3 { margin-bottom: 8px; }
.post-card h3 a { text-decoration: none; color: var(--ink); }
.post-card h3 a:hover { color: var(--brass-dark); }
@media (max-width: 640px) { .post-card { grid-template-columns: 1fr; } }

.post-body h2 { margin-top: 1.4em; }
.post-body p { max-width: 68ch; }
.post-meta { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 30px; }

/* -------------------- Page header (interior pages) -------------------- */
.page-header { padding: 56px 0 48px; border-bottom: 1px solid var(--line); }
.page-header .eyebrow-plain { color: var(--brass-dark); font-weight: 600; font-size: 0.92rem; margin-bottom: 10px; }
.page-header-grid {
  display: grid;
  grid-template-columns: 1.5fr 0.6fr;
  gap: 40px;
  align-items: center;
}
.page-header-grid img.page-icon {
  width: 100%;
  max-width: 220px;
  height: auto;
  justify-self: end;
}
@media (max-width: 760px) {
  .page-header-grid { grid-template-columns: 1fr; }
  .page-header-grid img.page-icon { display: none; }
}
.section-img-row {
  display: grid;
  grid-template-columns: 0.5fr 1fr;
  gap: 40px;
  align-items: center;
}
.section-img-row.reverse { grid-template-columns: 1fr 0.5fr; }
.section-img-row.reverse .section-img { order: 2; }
.section-img img { width: 100%; max-width: 260px; height: auto; }
@media (max-width: 760px) {
  .section-img-row, .section-img-row.reverse { grid-template-columns: 1fr; }
  .section-img { order: -1; }
  .section-img img { max-width: 160px; margin: 0 auto; }
}

/* -------------------- Footer -------------------- */
footer.site-footer { background: var(--ink); color: #C9CEDB; padding: 64px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
footer.site-footer h4 { color: #FDFBF5; font-size: 0.98rem; font-family: var(--sans); font-weight: 600; margin-bottom: 16px; }
footer.site-footer ul { list-style: none; margin: 0; padding: 0; }
footer.site-footer li { margin-bottom: 10px; }
footer.site-footer a { text-decoration: none; color: #C9CEDB; font-size: 0.94rem; }
footer.site-footer a:hover { color: #FDFBF5; }
footer.site-footer .logo img { height: 30px; }
footer.site-footer p.tag { color: #9AA4BC; font-size: 0.92rem; max-width: 34ch; margin-top: 12px; }
.footer-bottom {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid #2A3A5C;
  font-size: 0.82rem;
  color: #8994AF;
  line-height: 1.7;
}
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* -------------------- Utility -------------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head.wide { max-width: 720px; }
