/* ==========================================================================
   Fincalplus — design system
   Extracted from the original financial calculator canvas template.
   ========================================================================== */

:root {
  --ink:          #10151F;
  --ink-2:        #20293A;
  --text:         #3A4356;
  --text-2:       #4A5468;
  --muted:        #6B7688;
  --muted-2:      #8C96A8;
  --muted-3:      #9AA3B2;

  --brand:        #1B4DDB;
  --brand-dark:   #143BA8;
  --brand-deep:   #1B3A8F;
  --brand-tint:   #F5F8FF;
  --brand-line:   #D6E0FA;
  --brand-bar:    #BFCEF2;

  --line:         #E6E9F0;
  --line-soft:    #EEF1F6;
  --line-field:   #DCE1EA;
  --line-row:     #E2E7F0;
  --line-axis:    #D8DFEC;
  --line-strong:  #C9D4EC;

  --surface:      #FFFFFF;
  --surface-2:    #F7F9FD;
  --surface-3:    #FAFBFD;
  --surface-4:    #F3F5F9;
  --surface-5:    #F1F3F7;

  --warn-bg:      #FFF7E8;
  --warn-line:    #F3DFB5;
  --warn-ink:     #5C4508;
  --good-bg:      #EFF9F1;
  --good-line:    #C8E6CE;
  --good-ink:     #1B5E2A;
  --bad:          #B4441C;

  --shadow-card:  0 1px 2px rgba(16, 21, 31, .04), 0 8px 24px rgba(16, 21, 31, .05);
  --shadow-pop:   0 12px 32px rgba(16, 21, 31, .10);
  --shadow-hover: 0 6px 18px rgba(27, 77, 219, .10);

  --wrap:         1120px;
  --prose:        760px;

  --font: Inter, "Helvetica Neue", Helvetica, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  color-scheme: light;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;
}

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

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

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; text-decoration: none; }

.wrap { max-width: var(--wrap); width: 100%; margin: 0 auto; padding: 0 20px; }
.prose-wrap { max-width: var(--prose); }
.page { min-height: 100vh; display: flex; flex-direction: column; }
.main { flex: 1; max-width: var(--wrap); width: 100%; margin: 0 auto; padding: 0 20px; }

.tnum { font-variant-numeric: tabular-nums; }

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

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  max-width: var(--wrap); margin: 0 auto; padding: 0 20px;
  height: 64px; display: flex; align-items: center; gap: 28px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink); font-weight: 700; font-size: 18px; letter-spacing: -.025em;
}
.brand:hover { color: var(--ink); text-decoration: none; }
.brand:hover .logo-mark { transform: translateY(-1px); }
.logo-mark { display: block; flex: none; transition: transform 140ms ease; }
.brand__word { display: inline-flex; line-height: 1; }
.brand__word-a { color: var(--ink); }
.brand__word-b { color: var(--brand); }

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav__item { position: relative; }
.nav__button {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; font-family: inherit; font-size: 14.5px; font-weight: 500;
  color: var(--text); padding: 9px 12px; border-radius: 8px; cursor: pointer;
}
.nav__button:hover,
.nav__button[aria-expanded="true"] { background: var(--surface-4); color: var(--ink); }
.nav__caret { font-size: 9px; color: var(--muted-2); }
.nav__menu {
  position: absolute; top: 52px; right: 0; width: 268px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-pop); padding: 8px; display: none; flex-direction: column;
}
.nav__menu[data-open="true"] { display: flex; }
.nav__menu a {
  padding: 9px 11px; border-radius: 8px; font-size: 14px; color: var(--text);
}
.nav__menu a:hover { background: var(--surface-4); color: var(--ink); text-decoration: none; }
.nav__link {
  font-size: 14.5px; font-weight: 500; color: var(--text); padding: 9px 12px; border-radius: 8px;
}
.nav__link:hover { background: var(--surface-4); color: var(--ink); text-decoration: none; }
.nav__search {
  width: 38px; height: 38px; margin-left: 4px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--line); border-radius: 9px; cursor: pointer;
}
.nav__search:hover { background: var(--surface-4); }
.nav__toggle { display: none; }

/* ---------------------------------------------------------- breadcrumb --- */

.crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted); padding: 22px 0 0;
}
.crumbs a { color: var(--muted); }
.crumbs [aria-current] { color: var(--ink); }

/* ----------------------------------------------------------- page head --- */

.page-h1 {
  font-size: 38px; line-height: 1.12; letter-spacing: -.028em; font-weight: 700;
  margin: 16px 0 0; max-width: var(--prose);
}
.page-sub {
  font-size: 18px; line-height: 1.4; color: var(--muted); margin: 8px 0 0;
  max-width: var(--prose); font-weight: 500; letter-spacing: -.01em;
}

.lede {
  font-size: 17px; line-height: 1.55; color: var(--text-2); margin: 14px 0 0; max-width: 720px;
}

.pill {
  display: flex; align-items: center; gap: 7px; margin: 14px 0 0;
  padding: 6px 11px 6px 9px; border: 1px solid var(--brand-line); background: var(--brand-tint);
  border-radius: 999px; width: fit-content;
  font-size: 12.5px; font-weight: 500; color: var(--brand-deep); letter-spacing: -.005em;
}
.pill--stale { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); }

/* ---------------------------------------------------------- calculator --- */

.calc {
  margin: 26px 0 0; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-card); overflow: hidden;
}
.calc__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.calc__inputs {
  padding: 28px; display: flex; flex-direction: column; gap: 20px; background: var(--surface);
}
.calc__outputs {
  padding: 28px; background: var(--surface-2); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 22px;
}
.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2);
}

.field { display: flex; flex-direction: column; gap: 7px; }
.field__label { font-size: 14.5px; font-weight: 600; color: var(--ink-2); }
.field__help { font-size: 12.5px; color: var(--muted); }
.field__affix { position: relative; }
.field__prefix, .field__suffix {
  position: absolute; top: 0; height: 52px; display: flex; align-items: center;
  font-size: 16px; color: var(--muted-2); pointer-events: none;
}
.field__prefix { left: 14px; }
.field__suffix { right: 14px; }

.input, .select {
  width: 100%; height: 52px; padding: 0 14px;
  font-family: inherit; font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-field); border-radius: 10px;
  font-variant-numeric: tabular-nums;
}
.input:hover, .select:hover { border-color: var(--line-strong); }
.input--money { padding-left: 30px; }
.input--suffixed { padding-right: 44px; }
.select {
  appearance: none; cursor: pointer; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238C96A8' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.range { width: 100%; margin: 6px 0 0; accent-color: var(--brand); }
.range-scale {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 11.5px; color: var(--muted-2); font-variant-numeric: tabular-nums;
}

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; }
.switch span { font-size: 14.5px; color: var(--ink-2); font-weight: 500; }

.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg__opt {
  flex: 1 1 auto; min-width: 84px; text-align: center;
  padding: 11px 12px; border: 1px solid var(--line-field); border-radius: 10px;
  font-size: 14px; font-weight: 500; color: var(--text); background: var(--surface); cursor: pointer;
}
.seg__opt:hover { border-color: var(--line-strong); }
.seg__opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg__opt:has(input:checked) {
  border-color: var(--brand); background: var(--brand-tint); color: var(--brand-deep); font-weight: 600;
}

/* -------------------------------------------------------------- output --- */

.hero-out__label { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); }
.hero-out__value {
  font-size: 54px; line-height: 1.02; font-weight: 700; letter-spacing: -.035em;
  color: var(--brand); font-variant-numeric: tabular-nums; margin: 10px 0 0; word-break: break-word;
}
.hero-out__note { font-size: 14px; color: var(--text-2); margin: 8px 0 0; }

.rows { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.rows td { padding: 11px 0; border-top: 1px solid var(--line-row); }
.rows td:first-child { color: var(--text-2); }
.rows td:last-child { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.rows tr.is-total td { border-top: 2px solid var(--line-strong); padding: 12px 0; }
.rows tr.is-total td:first-child { font-weight: 600; color: var(--ink); }
.rows tr.is-total td:last-child { font-weight: 700; color: var(--brand); }
.rows .is-negative { color: var(--bad); }

.callout {
  display: flex; gap: 11px; padding: 13px 15px; border-radius: 10px;
  background: var(--warn-bg); border: 1px solid var(--warn-line);
  font-size: 13.5px; line-height: 1.5; color: var(--warn-ink);
}
.callout--good { background: var(--good-bg); border-color: var(--good-line); color: var(--good-ink); }
.callout__icon { font-size: 15px; line-height: 1.3; flex: none; }
.callout[hidden] { display: none; }

.chart__bars {
  display: flex; align-items: flex-end; gap: 3px; height: 104px; padding: 0 0 2px;
  border-bottom: 1px solid var(--line-axis);
}
.chart__bar { flex: 1; border-radius: 3px 3px 0 0; background: var(--brand-bar); transition: height 120ms ease; min-height: 3px; }
.chart__bar.is-active { background: var(--brand); }
.chart__scale {
  display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted-2);
  margin: 7px 0 0; font-variant-numeric: tabular-nums;
}

.scenarios { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.scenario {
  padding: 14px 15px; border: 1px solid var(--line-row); border-radius: 11px; background: var(--surface);
  display: flex; flex-direction: column; gap: 5px;
}
.scenario.is-best { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand-line); }
.scenario__name { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.scenario__value { font-size: 23px; font-weight: 700; letter-spacing: -.02em; color: var(--brand); font-variant-numeric: tabular-nums; }
.scenario__note { font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.scenario__badge {
  align-self: flex-start; margin-top: 2px; padding: 2px 8px; border-radius: 999px;
  background: var(--brand-tint); color: var(--brand-deep); font-size: 11px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
}

/* ------------------------------------------------------------- content --- */

.ad-slot {
  width: 100%; height: 90px; max-width: 728px; margin: 36px auto 0;
  background: var(--surface-5); border: 1px solid var(--line); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-3); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
}

.section { margin: 44px 0 0; }
.section--prose { max-width: var(--prose); }
.section h2 { font-size: 25px; letter-spacing: -.022em; font-weight: 700; margin: 0; }
.section h3 { font-size: 17px; font-weight: 600; margin: 28px 0 0; }
.section p { font-size: 16px; line-height: 1.62; color: var(--text-2); margin: 12px 0 0; }
.section ul { font-size: 16px; line-height: 1.62; color: var(--text-2); margin: 12px 0 0; padding-left: 20px; }
.section li + li { margin-top: 6px; }

.formula {
  margin: 18px 0 0; padding: 20px 22px; background: var(--brand-tint);
  border: 1px solid var(--brand-line); border-left: 3px solid var(--brand); border-radius: 10px;
}
.formula__label {
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand-deep); margin: 0 0 10px;
}
.formula code {
  display: block; font-family: var(--mono); font-size: 14.5px; line-height: 1.7; color: var(--ink);
  overflow-x: auto; white-space: pre-wrap; word-break: break-word;
}
.formula__note { font-size: 13px; color: var(--text-2); margin: 12px 0 0; }

.example { margin: 14px 0 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.example__row {
  display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px;
  font-size: 14.5px; border-bottom: 1px solid var(--line-soft);
}
.example__row span:first-child { color: var(--text-2); }
.example__row span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }
.example__row.is-total { background: var(--surface-2); border-bottom: none; }
.example__row.is-total span:first-child { font-weight: 600; color: var(--ink); }
.example__row.is-total span:last-child { font-weight: 700; color: var(--brand); }

.faq { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.faq details { border-bottom: 1px solid var(--line-soft); }
.faq details:last-child { border-bottom: none; }
.faq summary {
  display: flex; justify-content: space-between; gap: 16px; padding: 17px 18px;
  font-size: 15.5px; font-weight: 600; color: var(--ink); cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-weight: 400; }
.faq details[open] summary::after { content: "\2212"; }
.faq__body { padding: 0 18px 18px; font-size: 15px; line-height: 1.62; color: var(--text-2); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.card {
  padding: 18px; border: 1px solid var(--line); border-radius: 12px;
  display: flex; flex-direction: column; gap: 6px; box-shadow: 0 1px 2px rgba(16, 21, 31, .04);
  background: var(--surface);
}
.card:hover { border-color: var(--brand); box-shadow: var(--shadow-hover); text-decoration: none; }
.card__title { font-size: 15.5px; font-weight: 600; color: var(--ink); }
.card__desc { font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.card__tag {
  align-self: flex-start; margin-top: 4px; font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2);
}
.card.is-pending { opacity: .62; pointer-events: none; }

.meta-panel {
  margin: 40px 0 48px; padding: 20px 22px; background: var(--surface-3);
  border: 1px solid var(--line); border-radius: 12px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px;
}
.meta-panel__label {
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted-2); margin: 0 0 8px;
}
.meta-panel__body { font-size: 13.5px; line-height: 1.65; color: var(--text-2); }

.data-table { width: 100%; border-collapse: collapse; font-size: 14.5px; margin: 16px 0 0; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); }
.data-table th { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); font-weight: 600; }
.data-table td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------------------------------------------------------------- home --- */

.hero { padding: 56px 0 8px; max-width: 780px; }
.hero h1 { font-size: 46px; line-height: 1.08; letter-spacing: -.032em; font-weight: 700; margin: 14px 0 0; }
.hero p { font-size: 18px; line-height: 1.55; color: var(--text-2); margin: 16px 0 0; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 0; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 20px;
  border-radius: 10px; font-size: 15px; font-weight: 600; border: 1px solid transparent;
}
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); color: #fff; text-decoration: none; }
.btn--ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line-field); }
.btn--ghost:hover { background: var(--surface-4); color: var(--ink); text-decoration: none; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin: 40px 0 0; }
.stat { padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-3); }
.stat__value { font-size: 27px; font-weight: 700; letter-spacing: -.025em; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat__label { font-size: 13.5px; color: var(--muted); margin: 4px 0 0; }

.cat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0 0 16px; }
.cat-head h2 { font-size: 21px; letter-spacing: -.02em; }
.cat-head a { font-size: 14px; font-weight: 500; }

.empty {
  margin: 26px 0 0; padding: 28px; border: 1px dashed var(--line-field); border-radius: 12px;
  background: var(--surface-3); color: var(--text-2); font-size: 15px; line-height: 1.6;
}

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

.site-footer { border-top: 1px solid var(--line); background: var(--surface-3); margin-top: 56px; }
.site-footer__inner {
  max-width: var(--wrap); margin: 0 auto; padding: 24px 20px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 20px;
}
.site-footer__copy { font-size: 13.5px; color: var(--muted); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; margin-left: auto; }
.site-footer nav a { font-size: 13.5px; color: var(--text-2); }

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

@media (max-width: 900px) {
  .nav__toggle {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; margin-left: auto;
    background: none; border: 1px solid var(--line); border-radius: 9px; cursor: pointer;
  }
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 10px 16px 16px; box-shadow: var(--shadow-pop);
  }
  .nav[data-open="true"] { display: flex; }
  .nav__menu { position: static; width: auto; box-shadow: none; border: none; padding: 2px 0 6px 10px; }
  .nav__button { width: 100%; justify-content: space-between; }
  .nav__search { display: none; }
  .site-header__inner { position: relative; }
}

@media (max-width: 700px) {
  .page-h1 { font-size: 30px; }
  .hero { padding: 36px 0 0; }
  .hero h1 { font-size: 34px; }
  .hero p { font-size: 16.5px; }
  .calc__inputs, .calc__outputs { padding: 20px; }
  .calc__outputs { border-left: none; border-top: 1px solid var(--line); }
  .hero-out__value { font-size: 42px; }
  .section h2 { font-size: 22px; }
  .ad-slot { height: 100px; }
}

@media print {
  .site-header, .site-footer, .ad-slot, .nav, .crumbs { display: none !important; }
  .calc { box-shadow: none; }
}
