/* Kalkulator OKI, wersja z poprawkami z 30.10.2026. Układ i kolor z makiety: jasne tło, turkus jako jedyny akcent. */

:root {
  --ink: #0d1b3e;
  --text: #2b3650;
  --muted: #5d6880;
  --line: #e2e7ee;
  --bg: #f6f8fa;
  --card: #ffffff;
  --accent: #0d8f86;
  --accent-strong: #0a7169;
  --accent-soft: #e6f5f3;
  --loss: #b4232f;
  --loss-soft: #fdf1f2;
  --radius: 14px;
  --sans: "Inter Tight", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; color: var(--text); background: var(--bg); font: 400 16px/1.55 var(--sans); }
p { margin: 0; }
h1, h2, h3 { color: var(--ink); }
[hidden] { display: none !important; }
.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; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.topbar { max-width: 1160px; margin: 0 auto; padding: 18px 20px 0; }
.brand img { display: block; height: 32px; width: auto; }

.page { max-width: 1160px; margin: 0 auto; padding: 0 20px 64px; }

.intro { padding: 28px 0 24px; }
.intro h1 { margin: 0 0 6px; color: var(--accent-strong); font: 600 18px/1.3 var(--sans); }
.intro-big { color: var(--ink); font: 700 clamp(32px, 4.6vw, 48px)/1.08 var(--sans); letter-spacing: -.02em; }
.intro-lead { max-width: 640px; margin-top: 12px; color: var(--muted); font-size: 17px; }

.calc { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(13, 27, 62, .04), 0 8px 24px rgba(13, 27, 62, .05); }

/* formularz */
.form-card { padding: 24px; }
.part { padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.part h3 { margin: 0; font: 600 21px/1.25 var(--sans); }
.part-sub { margin: 2px 0 14px; color: var(--muted); }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 16px; }
/* podpis, pole i błąd w trzech wspólnych rzędach, żeby pola stały równo, gdy jeden podpis łamie się na dwie linie */
.field { display: grid; grid-row: span 3; grid-template-rows: subgrid; align-items: end; min-width: 0; }
.field .field-error { align-self: start; }
.field label, .adv-label, .adv-field > label:not(.check), .choice legend { display: block; margin-bottom: 6px; color: var(--text); font-weight: 500; font-size: 15px; }
.input { display: flex; align-items: center; height: 48px; padding: 0 14px; border: 1px solid #cdd5df; border-radius: 10px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(13, 143, 134, .18); }
.input input { flex: 1; width: 100%; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 500 17px var(--sans); }
.input b { margin-left: 8px; color: var(--muted); font-weight: 500; white-space: nowrap; }
.input.invalid { border-color: var(--loss); box-shadow: 0 0 0 3px rgba(180, 35, 47, .12); }
.input-short { width: 150px; }
.field-error { min-height: 0; color: var(--loss); font-size: 14px; font-weight: 500; }
.field-error:not(:empty) { margin-top: 6px; }
.hint { margin-top: 10px; color: var(--muted); font-size: 14px; }

.part-years { border-bottom: 0; margin-bottom: 8px; padding-bottom: 8px; }
.years-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.years-label { color: var(--ink); font: 600 21px/1.25 var(--sans); }
#years-range { width: 100%; margin: 18px 0 4px; accent-color: var(--accent); height: 24px; cursor: pointer; }
.range-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; }
.portfolio-error:not(:empty) { margin-bottom: 12px; }

.limit-box { display: flex; gap: 14px; margin: 8px 0 14px; padding: 16px 18px; border-radius: 12px; background: var(--accent-soft); color: var(--ink); }
.limit-icon { flex: 0 0 26px; height: 26px; border: 2px solid var(--accent-strong); border-radius: 50%; color: var(--accent-strong); font: 700 14px/22px var(--sans); text-align: center; }
.limit-main { color: var(--accent-strong); font-weight: 700; }
.limit-note { margin-top: 6px; color: var(--muted); font-size: 14px; }

.advanced { border: 1px solid var(--line); border-radius: 12px; }
.advanced summary, .method summary { display: flex; align-items: center; gap: 12px; list-style: none; cursor: pointer; }
.advanced summary::-webkit-details-marker, .method summary::-webkit-details-marker { display: none; }
.advanced summary { padding: 14px 18px; color: var(--ink); font-weight: 600; }
.advanced summary > span:first-child { flex: 1; }
.plus { position: relative; flex: 0 0 16px; height: 16px; }
.plus::before, .plus::after { content: ""; position: absolute; left: 0; top: 7px; width: 16px; height: 2px; border-radius: 1px; background: var(--ink); transition: transform .2s; }
.plus::after { transform: rotate(90deg); }
details[open] > summary .plus::after { transform: rotate(0); }
.custom-badge { padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 13px; font-weight: 600; white-space: nowrap; }
.advanced-body { padding: 4px 18px 18px; }
.advanced-title { color: var(--ink); font-weight: 600; }
.advanced-lead { margin: 4px 0 16px; color: var(--muted); font-size: 15px; }
.adv-field { margin: 0 0 18px; padding: 0; border: 0; }
.adv-field select { width: 100%; height: 46px; padding: 0 12px; border: 1px solid #cdd5df; border-radius: 10px; background: #fff; color: var(--ink); font: 500 16px var(--sans); }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice legend { grid-column: 1 / -1; padding: 0; }
.choice label { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: block; padding: 10px 12px; border: 1px solid #cdd5df; border-radius: 10px; text-align: center; font-size: 15px; font-weight: 500; }
.choice input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.choice input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; color: var(--text); font-weight: 500; font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 3px 0 0; flex: 0 0 auto; accent-color: var(--accent); }
.rate-line { margin-top: 4px; color: var(--ink); font-size: 15px; }
.rate-future { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.rate-future label { margin: 0 !important; }
.rate-future .input-short { width: 170px; height: 42px; }
.reset { padding: 10px 16px; border: 1px solid var(--accent); border-radius: 10px; background: #fff; color: var(--accent-strong); font: 600 15px var(--sans); cursor: pointer; }
.reset:hover { background: var(--accent-soft); }
.auto-note { margin-top: 12px; color: var(--muted); font-size: 14px; }

/* wynik */
.result-card { position: sticky; top: 16px; padding: 28px 24px 24px; }
.result-message { padding: 16px; border-radius: 10px; background: var(--bg); color: var(--ink); font-weight: 500; }
.headline { color: var(--ink); font: 600 22px/1.3 var(--sans); text-align: center; }
.big { margin: 8px 0 4px; color: var(--accent); font: 800 clamp(44px, 6vw, 64px)/1.05 var(--sans); letter-spacing: -.02em; text-align: center; }
[data-winner="regular"] .big { color: var(--ink); }
.period { margin-top: 6px; color: var(--muted); text-align: center; }
.threshold { margin: 22px 0 18px; padding: 16px 20px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); }
.threshold-title { font-weight: 700; }
.threshold p + p { margin-top: 4px; }
#threshold-text { color: var(--ink); font-weight: 600; white-space: pre-line; }
.threshold-note { color: var(--muted); font-size: 14px; }
.final { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.final-box { padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.final-box.better { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.final-label { color: var(--muted); font-size: 15px; }
.final-value { margin-top: 2px; color: var(--ink); font: 700 24px/1.2 var(--sans); }
.final-tag { margin-top: 4px; color: var(--accent-strong); font-size: 13px; font-weight: 700; }
.rows { margin: 14px 0 0; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row dt { color: var(--text); }
.row dt small { display: block; color: var(--muted); font-size: 13px; }
.row dd { display: grid; gap: 2px; margin: 0; text-align: right; color: var(--muted); font-size: 15px; }
.row dd strong { color: var(--ink); font-weight: 700; }
.share-na { margin-top: 8px; }
.loss-note { margin-top: 14px; padding: 12px 14px; border-left: 3px solid var(--loss); border-radius: 6px; background: var(--loss-soft); color: var(--ink); font-size: 14px; font-weight: 500; }
.assumptions-now { margin-top: 14px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.assumptions-now .custom-badge { font-size: 12px; }
.outline-button { display: block; width: 100%; margin-top: 18px; padding: 14px; border: 2px solid var(--accent); border-radius: 12px; background: #fff; color: var(--accent-strong); font: 700 17px var(--sans); cursor: pointer; }
.outline-button:hover { background: var(--accent-soft); }
.disclaimer { margin-top: 14px; color: var(--muted); font-size: 13px; }

/* tabela rok po roku */
.table-card { margin-top: 20px; padding: 24px; }
.table-card h2 { margin: 0; font: 700 26px/1.2 var(--sans); }
.table-lead { margin: 4px 0 16px; color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.year-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.year-table th, .year-table td { padding: 11px 14px; text-align: right; white-space: nowrap; }
.year-table thead th { color: var(--muted); font-size: 13px; font-weight: 600; background: var(--bg); }
.year-table th:first-child, .year-table td:first-child { text-align: left; }
.year-table tbody tr:not(.year-detail) { border-top: 1px solid var(--line); }
.year-table tbody th { color: var(--ink); font-weight: 600; }
.year-table td.tax { color: var(--ink); font-weight: 700; }
.year-table tr.loss > * { background: var(--loss-soft); }
.year-table .narrow { display: none; }
.year-detail { display: none; }
.year-more { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--accent-strong); font: 600 13px var(--sans); cursor: pointer; }

/* metodologia */
.method { margin-top: 28px; }
.method > h2 { margin: 0 0 12px; font: 700 26px/1.2 var(--sans); }
.method details { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.method summary { padding: 16px 20px; }
.method summary h3 { flex: 1; margin: 0; font: 600 18px/1.35 var(--sans); }
.method-body { max-width: 820px; padding: 0 20px 18px; }
.method-body p + p, .method-body ul + p { margin-top: 10px; }
.sources { margin: 10px 0 0; padding-left: 20px; }
.sources li + li { margin-top: 8px; }
.method a { color: var(--accent-strong); font-weight: 600; }

/* treść pod kalkulatorem */
.seo { max-width: 780px; margin-top: 40px; }
.seo h2 { margin: 32px 0 10px; font: 700 24px/1.25 var(--sans); }
.seo h2:first-child { margin-top: 0; }
.seo h3 { margin: 20px 0 6px; font: 600 18px/1.35 var(--sans); }
.seo p + p { margin-top: 10px; }
.link-spot { color: var(--accent-strong); font-weight: 600; }

.mobile-result { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 10; display: flex; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: 12px; background: var(--accent-strong); color: #fff; text-decoration: none; box-shadow: 0 8px 24px rgba(13, 27, 62, .25); }

@media (max-width: 860px) {
  .calc { grid-template-columns: 1fr; }
  .result-card { position: static; }
}

@media (max-width: 560px) {
  .page, .topbar { padding-left: 16px; padding-right: 16px; }
  .form-card, .result-card, .table-card { padding: 18px 16px; }
  .pair { gap: 10px; }
  .final { grid-template-columns: 1fr; }
  .final-value { font-size: 22px; }
  .row { grid-template-columns: 1fr; gap: 4px; }
  .row dd { text-align: left; }
  .year-table .wide { display: none; }
  .year-table .narrow { display: table-cell; }
  .year-table th, .year-table td { padding: 10px; white-space: normal; }
  .year-table th, .year-table td { padding: 10px 8px; }
  .year-more { width: 118px; padding: 5px 6px; font-size: 12px; line-height: 1.25; }
  .year-detail:not([hidden]) { display: table-row; }
  .year-detail td { padding: 10px 14px 14px; background: var(--bg); }
  .year-detail dl { display: grid; gap: 6px; margin: 0; }
  .year-detail dl div { display: flex; justify-content: space-between; gap: 12px; }
  .year-detail dt { color: var(--muted); }
  .year-detail dd { margin: 0; color: var(--ink); font-weight: 600; }
}
