/* QuickyLoan — green theme. Layout inspired by reference, recolored to app palette. */
:root {
  --brand: #1a8f3c;
  --brand-600: #16842f;
  --brand-700: #0f6b2a;
  --brand-800: #0b5421;
  --brand-900: #073d18;
  --brand-tint: #e9f6ec;
  --brand-tint-2: #d7eede;
  --accent: #7bd092;
  --ink: #0f1a12;
  --ink-2: #3c4a40;
  --muted: #6b7a70;
  --line: #e2e8e4;
  --bg: #ffffff;
  --bg-soft: #f6faf7;
  --card: #ffffff;
  --shadow: 0 1px 2px rgba(7, 61, 24, .06), 0 8px 24px rgba(7, 61, 24, .06);
  --shadow-lg: 0 12px 40px rgba(7, 61, 24, .14);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1120px;
  --invest: #16842f;
  --tax: #0b5421;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; color: var(--ink); font-weight: 800; letter-spacing: -.01em; }
p { margin: 0 0 1em; color: var(--ink-2); }
.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; }
.num { font-variant-numeric: tabular-nums; }
.wrap, .header-inner, .hero-inner, .featured-grid, .section, .footer-inner, .calc-wrap, .page-wrap { max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }

/* ---------- Header ---------- */
header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, var(--brand-700), var(--brand-800));
  color: #fff;
  box-shadow: 0 2px 12px rgba(7,61,24,.25);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 19px; }
.logo:hover { text-decoration: none; }
.logo img { width: 36px; height: 36px; border-radius: 9px; background: #fff; padding: 2px; }
.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a { color: #eafaef; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 15px; }
.site-nav a:hover { background: rgba(255,255,255,.14); text-decoration: none; }
.site-nav .app-link { background: #fff; color: var(--brand-700); margin-left: 6px; }
.site-nav .app-link:hover { background: #eafaef; }
.nav-toggle { display: none; background: rgba(255,255,255,.15); border: 0; color: #fff; font-size: 22px; width: 42px; height: 42px; border-radius: 10px; cursor: pointer; }

@media (max-width: 880px) {
  .nav-toggle { display: block; }
  .site-nav {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--brand-800); padding: 10px 16px 16px;
    box-shadow: var(--shadow-lg); display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 10px; }
  .site-nav .app-link { margin: 6px 0 0; text-align: center; }
}

/* ---------- Hero ---------- */
.hero { background: radial-gradient(1200px 400px at 80% -10%, var(--brand-tint), transparent), var(--bg-soft); border-bottom: 1px solid var(--line); }
.hero-inner { padding-block: 56px 48px; }
.hero h1 { font-size: clamp(30px, 5vw, 48px); max-width: 18ch; }
.hero .lede { font-size: clamp(16px, 2.2vw, 20px); color: var(--ink-2); max-width: 60ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 12px; font-weight: 700; border: 1px solid transparent; cursor: pointer; font-size: 15px; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); text-decoration: none; }
.btn-ghost { background: #fff; color: var(--brand-700); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); text-decoration: none; }
.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 28px; }
.hero-stats .stat strong { display: block; font-size: 26px; color: var(--brand-700); }
.hero-stats .stat span { color: var(--muted); font-size: 14px; }

/* ---------- Featured ---------- */
.featured { padding-block: 40px; }
.featured-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.featured-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; color: var(--ink); }
.featured-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brand-tint-2); text-decoration: none; }
.featured-card .badge { display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--brand-700); background: var(--brand-tint); padding: 3px 9px; border-radius: 999px; margin-bottom: 10px; }
.featured-card h3 { font-size: 18px; }
.featured-card p { font-size: 14px; margin-bottom: 12px; }
.featured-card .cta { color: var(--brand-700); font-weight: 700; font-size: 14px; }
@media (max-width: 980px) { .featured-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .featured-grid { grid-template-columns: 1fr; } }

/* ---------- Sections / category grid ---------- */
.section { padding-block: 36px; }
.section-head { margin-bottom: 22px; }
.section-head h2 { font-size: clamp(24px, 3.5vw, 32px); }
.section-head .sub { color: var(--muted); max-width: 60ch; }
.cat { margin-bottom: 34px; }
.cat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cat-head h3 { font-size: 19px; margin: 0; }
.cat-head .count { background: var(--brand-tint); color: var(--brand-700); border-radius: 999px; font-size: 13px; font-weight: 700; padding: 2px 10px; }
.calc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 880px) { .calc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .calc-grid { grid-template-columns: 1fr; } }
.calc-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; color: var(--ink); position: relative; }
.calc-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--brand-tint-2); text-decoration: none; }
.calc-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.calc-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--brand); flex: none; }
.calc-card--invest .calc-dot { background: var(--invest); }
.calc-card--tax .calc-dot { background: var(--tax); }
.calc-card h4 { font-size: 16px; margin: 0; flex: 1; }
.calc-arrow { color: var(--muted); font-weight: 700; }
.calc-card p { font-size: 13.5px; margin: 0; color: var(--ink-2); }
.calc-card .soon { position: absolute; top: 12px; right: 12px; font-size: 10px; font-weight: 700; color: var(--brand-700); background: var(--brand-tint); padding: 2px 7px; border-radius: 999px; }

/* ---------- Calculator page ---------- */
.breadcrumb { display: flex; gap: 6px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.breadcrumb li:not(:last-child)::after { content: "›"; margin-left: 6px; color: var(--muted); }
.calc-section { padding-block: 28px 40px; }
.calc-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
@media (max-width: 920px) { .calc-wrap { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.card-head h2 { font-size: 17px; margin: 0; }
.card-head .head-meta { font-size: 12px; color: var(--muted); }
.card-body { padding: 20px; }

.field { margin-bottom: 22px; }
.field:last-child { margin-bottom: 0; }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.field-head label { font-weight: 700; font-size: 14px; color: var(--ink); }
.field-value { display: inline-flex; align-items: center; gap: 4px; background: var(--brand-tint); border: 1px solid var(--brand-tint-2); border-radius: 9px; padding: 4px 10px; font-weight: 700; color: var(--brand-800); }
.field-value input { border: 0; background: transparent; width: 110px; text-align: right; font: inherit; font-weight: 700; color: var(--brand-800); outline: none; }
.field-value .unit { color: var(--muted); font-weight: 600; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; background: var(--brand-tint-2); outline: none; margin: 6px 0; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--brand); border: 3px solid #fff; cursor: pointer; }
.range-bounds { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 2px; }
.in-words { font-size: 12.5px; color: var(--brand-700); margin-top: 6px; font-style: italic; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.chip:hover { border-color: var(--brand); color: var(--brand-700); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.seg { display: inline-flex; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-weight: 700; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--brand); color: #fff; }
select, .text-input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: #fff; color: var(--ink); }
select:focus, .text-input:focus, .field-value input:focus { border-color: var(--brand); }

/* Results */
.result-card .card-head { background: linear-gradient(180deg, var(--brand-700), var(--brand-800)); border-color: var(--brand-800); }
.result-card .card-head h2 { color: #fff; }
.result-card .card-head .head-meta { color: #d7eede; }
.result-hero { text-align: center; padding: 24px 20px 8px; }
.result-hero .label { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.result-hero .value { font-size: clamp(30px, 6vw, 44px); font-weight: 800; color: var(--brand-700); margin-top: 4px; }
.result-rows { display: grid; gap: 0; padding: 4px 20px 8px; }
.result-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.result-row:last-child { border-bottom: 0; }
.result-row .k { color: var(--ink-2); font-size: 14px; }
.result-row .v { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.result-row.total .v { color: var(--brand-700); }
.result-note { font-size: 12.5px; color: var(--muted); padding: 4px 20px 18px; }

/* Donut / bar chart */
.chart-wrap { display: flex; align-items: center; gap: 18px; padding: 16px 20px 20px; flex-wrap: wrap; justify-content: center; }
.donut { --p: 50; --c1: var(--brand); --c2: var(--brand-tint-2); width: 150px; height: 150px; border-radius: 50%; background: conic-gradient(var(--c1) calc(var(--p) * 1%), var(--c2) 0); display: grid; place-items: center; flex: none; }
.donut::after { content: ""; width: 96px; height: 96px; border-radius: 50%; background: #fff; }
.legend { display: grid; gap: 8px; font-size: 13px; }
.legend .li { display: flex; align-items: center; gap: 8px; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; padding: 0 20px 20px; }
.actions .btn { padding: 9px 14px; font-size: 13px; }

/* Schedule table */
.schedule-wrap { padding: 0 20px 22px; }
.schedule-wrap details { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.schedule-wrap summary { padding: 12px 14px; font-weight: 700; cursor: pointer; background: var(--bg-soft); }
.table-scroll { max-height: 360px; overflow: auto; }
table.sched { width: 100%; border-collapse: collapse; font-size: 13px; }
table.sched th, table.sched td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.sched th:first-child, table.sched td:first-child { text-align: left; position: sticky; left: 0; background: #fff; }
table.sched thead th { position: sticky; top: 0; background: var(--brand-tint); color: var(--brand-800); }

/* Content / prose */
.prose { max-width: 760px; margin-inline: auto; padding-block: 8px 40px; }
.prose h2 { font-size: 24px; margin-top: 1.6em; }
.prose h3 { font-size: 18px; margin-top: 1.4em; }
.prose ul, .prose ol { color: var(--ink-2); padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 14px; }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.prose th { background: var(--bg-soft); }
.faq details { border: 1px solid var(--line); border-radius: 10px; padding: 4px 16px; margin-bottom: 10px; }
.faq summary { font-weight: 700; padding: 12px 0; cursor: pointer; }
.faq p { padding-bottom: 12px; }
.callout { background: var(--brand-tint); border: 1px solid var(--brand-tint-2); border-left: 4px solid var(--brand); border-radius: 10px; padding: 14px 16px; margin: 16px 0; }
.callout.warn { background: var(--brand-tint); border-color: #cfe8d6; border-left-color: var(--brand); }
.post-meta { display: block; color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 6px; }
.cta-box { background: var(--brand-tint); border: 1px solid var(--brand-tint-2); border-radius: var(--radius); padding: 22px 24px; margin: 28px 0 8px; text-align: center; }
.cta-box h3 { margin: 0 0 6px; font-size: 20px; }
.cta-box p { margin: 0 0 14px; color: var(--ink-2); }

/* Page hero (non-calc pages) */
.page-hero { background: var(--bg-soft); border-bottom: 1px solid var(--line); padding-block: 40px; }
.page-hero h1 { font-size: clamp(28px, 4vw, 40px); }
.page-wrap { padding-block: 8px; }

/* App banner */
.app-banner { background: linear-gradient(135deg, var(--brand-700), var(--brand-900)); color: #fff; border-radius: var(--radius); padding: 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-block: 30px; }
.app-banner h3 { color: #fff; font-size: 22px; margin: 0 0 6px; }
.app-banner p { color: #d7eede; margin: 0; }
.app-banner .btn { background: #fff; color: var(--brand-700); }

/* ---------- Footer ---------- */
footer { background: var(--brand-900); color: #cfe6d6; margin-top: 40px; }
.footer-inner { padding-block: 40px 28px; display: grid; gap: 18px; }
.footer-top { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-logo { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 18px; }
.footer-logo img { width: 34px; height: 34px; border-radius: 8px; background: #fff; padding: 2px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: #cfe6d6; font-size: 14px; }
.footer-links a:hover { color: #fff; }
.footer-business { border-top: 1px solid rgba(255,255,255,.12); padding-top: 18px; font-size: 13px; display: grid; gap: 6px; }
.footer-business .biz-name { color: #fff; font-weight: 700; }
.footer-business address { font-style: normal; display: grid; gap: 4px; color: #b9d6c2; }
.footer-business a { color: #eafaef; }
.biz-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.biz-badge { background: rgba(255,255,255,.1); border-radius: 999px; padding: 4px 10px; font-size: 12px; }
.footer-copy { border-top: 1px solid rgba(255,255,255,.12); padding-top: 16px; font-size: 13px; color: #9fc0a9; }
.footer-disc { font-size: 12px; color: #8fb39a; max-width: 80ch; }
