/* ===================================================================
   KredytPartner - system projektowy
   Jeden plik, zero zależności, zero build stepu.
   =================================================================== */

:root {
  /* Kolory marki - granat (zaufanie) + zieleń (pieniądz, wzrost) */
  --navy-900: #0b1220;
  --navy-800: #111c2e;
  --navy-700: #1a2942;
  --navy-600: #24395a;

  --green-600: #059669;
  --green-500: #10b981;
  --green-400: #34d399;
  --green-50:  #ecfdf5;

  --amber-500: #f59e0b;
  --amber-50:  #fffbeb;
  --red-500:   #ef4444;
  --red-50:    #fef2f2;
  --blue-500:  #3b82f6;
  --blue-50:   #eff6ff;

  /* Semantyka - używamy TYCH zmiennych w kodzie, nie kolorów wprost.
     Dzięki temu tryb ciemny to podmiana kilkunastu linii niżej. */
  --bg:          #f7f9fc;
  --bg-elevated: #ffffff;
  --bg-sunken:   #eef2f7;
  --border:      #dde4ed;
  --border-strong: #c3cedd;

  --text:        #0f172a;
  --text-muted:  #5a6b83;
  --text-subtle: #8496ab;
  --text-invert: #ffffff;

  --accent:      var(--green-600);
  --accent-hover:#047857;
  --accent-soft: var(--green-50);

  /* Wykresy - kapitał vs odsetki to najważniejsza para kolorów w serwisie */
  --c-capital:  #10b981;
  --c-interest: #f43f5e;
  --c-contrib:  #64748b;
  --c-growth:   #10b981;
  --c-line:     #3b82f6;

  --radius:    12px;
  --radius-lg: 18px;
  --radius-sm: 8px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow:    0 4px 16px rgba(15, 23, 42, .08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .12);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
          'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', Menlo, monospace;

  --maxw: 1200px;
  --header-h: 68px;
}

[data-theme="dark"] {
  --bg:          #0b1220;
  --bg-elevated: #131e33;
  --bg-sunken:   #0a101c;
  --border:      #24354f;
  --border-strong: #35496a;

  --text:        #e8eef7;
  --text-muted:  #9aabc2;
  --text-subtle: #6b7d96;

  --accent:      var(--green-500);
  --accent-hover:var(--green-400);
  --accent-soft: rgba(16, 185, 129, .12);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow:    0 4px 16px rgba(0, 0, 0, .35);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
}

/* --- Reset --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.5rem); }

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

/* Dostępność: skip link dla czytników ekranu i klawiatury */
.skip-link {
  position: absolute; left: -9999px;
  background: var(--accent); color: #fff;
  padding: 12px 20px; z-index: 999; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; top: 0; }

/* --- Układ --------------------------------------------------------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 20px; }

section { padding: 72px 0; }
@media (max-width: 720px) { section { padding: 48px 0; } }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.stack > * + * { margin-top: 16px; }
.center { text-align: center; }

/* --- Nagłówek ------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg-elevated) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  height: 100%; display: flex; align-items: center; gap: 32px;
}

.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.18rem; color: var(--text);
  letter-spacing: -.03em; text-decoration: none; flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
/*
 * Znak firmowy "KP".
 *
 * Gradient jest CELOWO ciemny. Poprzedni (green-500 -> green-600) dawał
 * kontrast bieli 2,54:1, podczas gdy WCAG AA wymaga 4,5:1 - napis był
 * obiektywnie nieczytelny, nie tylko "trochę bladawy". Obecny zaczyna się
 * od 5,48:1 i schodzi do 9,72:1.
 */
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(140deg, #047857, #064e3b);
  display: grid; place-items: center;
  color: #fff;
  font-weight: 800; font-size: .92rem; letter-spacing: .02em;
  /* Delikatna jasna krawędź u góry - odrywa kafel od tła nagłówka. */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .18),
    0 2px 8px rgba(4, 120, 87, .3);
}

/* W trybie ciemnym kafel odrywamy od granatowego tła poświatą, a NIE
   rozjaśnianiem zieleni. Jaśniejszy gradient (#059669) spadał do 3,77:1,
   czyli poniżej normy - ten trzyma 5,48:1 tak samo jak w trybie jasnym. */
[data-theme="dark"] .logo-mark {
  background: linear-gradient(140deg, #047857, #065f46);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .25),
    0 0 0 1px rgba(16, 185, 129, .25),
    0 2px 12px rgba(5, 150, 105, .3);
}
.logo span { color: var(--accent); }

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }

/* :not(.btn) jest tu KONIECZNE.
   Selektor ".nav a" ma wyższą specyficzność niż ".btn-primary", więc bez
   tego wyłączenia nadpisywał kolor przycisku "Znajdź kredyt" na szary
   (--text-muted) - szary tekst na zielonym tle, praktycznie nieczytelny. */
.nav a:not(.btn) {
  padding: 8px 14px; border-radius: 8px;
  color: var(--text-muted); font-weight: 500; font-size: .94rem;
  transition: background .15s, color .15s;
}
.nav a:not(.btn):hover, .nav a:not(.btn).active {
  background: var(--bg-sunken); color: var(--text); text-decoration: none;
}

/* Przycisk w nagłówku ma być wyraźny - to główne wezwanie do działania. */
.nav .btn-primary {
  color: #fff;
  font-weight: 650;
  padding: 9px 18px;
  margin-left: 6px;
}
.nav .btn-primary:hover { color: #fff; }

.nav-toggle, .theme-toggle {
  background: transparent; border: 1px solid var(--border);
  border-radius: 8px; width: 38px; height: 38px;
  display: grid; place-items: center; cursor: pointer;
  color: var(--text-muted); font-size: 1.1rem; flex-shrink: 0;
}
.nav-toggle:hover, .theme-toggle:hover {
  background: var(--bg-sunken); color: var(--text);
}
.nav-toggle { display: none; }

@media (max-width: 900px) {
  .nav-toggle { display: grid; margin-left: auto; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 12px; margin-left: 0;
    box-shadow: var(--shadow-lg);
    transform: translateY(-150%); transition: transform .25s ease;
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .nav.open { transform: translateY(0); }
  .nav a { padding: 14px 16px; font-size: 1rem; }
  .nav .btn { margin-top: 8px; }
}

/* --- Przyciski ----------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 10px;
  font-weight: 600; font-size: .96rem; font-family: inherit;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .12s, box-shadow .2s, background .2s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 2px 10px rgba(5, 150, 105, .3);
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 6px 20px rgba(5, 150, 105, .4); }

.btn-secondary {
  background: var(--bg-elevated); color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-sunken); }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-sunken); color: var(--text); }

.btn-lg { padding: 15px 32px; font-size: 1.05rem; border-radius: 12px; }
.btn-sm { padding: 8px 16px; font-size: .87rem; }
.btn-block { width: 100%; }

/* --- Karty --------------------------------------------------------- */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.card-hover { transition: transform .18s, box-shadow .18s, border-color .18s; }
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; letter-spacing: .01em;
  background: var(--accent-soft); color: var(--accent);
}
.badge-amber { background: var(--amber-50); color: #b45309; }
.badge-red   { background: var(--red-50);   color: #b91c1c; }
.badge-blue  { background: var(--blue-50);  color: #1d4ed8; }
[data-theme="dark"] .badge-amber { background: rgba(245,158,11,.14); color: #fbbf24; }
[data-theme="dark"] .badge-red   { background: rgba(239,68,68,.14);  color: #f87171; }
[data-theme="dark"] .badge-blue  { background: rgba(59,130,246,.14); color: #60a5fa; }

/* --- Kalkulator: układ dwukolumnowy -------------------------------- */
.calc {
  display: grid;
  grid-template-columns: minmax(320px, 400px) 1fr;
  gap: 32px;
  align-items: start;
}
@media (max-width: 980px) { .calc { grid-template-columns: 1fr; } }

.calc-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  position: sticky; top: calc(var(--header-h) + 20px);
}
@media (max-width: 980px) { .calc-panel { position: static; } }

.calc-results { min-width: 0; } /* pozwala wykresom kurczyć się w gridzie */

/* --- Pola formularza ----------------------------------------------- */
.field { margin-bottom: 22px; }
.field:last-child { margin-bottom: 0; }

.field-label {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
}
.field-label label {
  font-weight: 600; font-size: .9rem; color: var(--text);
  display: flex; align-items: center; gap: 6px;
}

.field-value {
  font-weight: 700; font-size: .95rem; color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.input-wrap { position: relative; display: flex; align-items: center; }
.input-suffix {
  position: absolute; right: 14px;
  color: var(--text-subtle); font-size: .88rem; font-weight: 500;
  pointer-events: none;
}

input[type="text"], input[type="number"], input[type="email"],
input[type="tel"], select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-family: inherit; font-size: 1rem;
  font-variant-numeric: tabular-nums;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input.has-suffix { padding-right: 52px; }

/* Suwak - główny sposób interakcji z kalkulatorem */
input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; margin-top: 12px;
  border-radius: 999px;
  background: var(--bg-sunken);
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--bg-elevated);
  box-shadow: 0 2px 8px rgba(5, 150, 105, .4);
  cursor: grab; transition: transform .12s;
}
input[type="range"]::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.15); }
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--bg-elevated);
  box-shadow: 0 2px 8px rgba(5, 150, 105, .4);
  cursor: grab; border-width: 3px;
}

/* Przełącznik segmentowy (rata równa / malejąca itp.) */
.segmented {
  display: flex; gap: 4px; padding: 4px;
  background: var(--bg-sunken);
  border-radius: 10px;
}
.segmented button {
  flex: 1; padding: 9px 12px;
  border: none; border-radius: 7px;
  background: transparent; color: var(--text-muted);
  font-family: inherit; font-size: .88rem; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"] {
  background: var(--bg-elevated); color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* Podpowiedź (i) - wyjaśnia pojęcia bez zaśmiecania interfejsu */
.hint {
  display: inline-grid; place-items: center;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--bg-sunken); color: var(--text-subtle);
  font-size: .68rem; font-weight: 700; cursor: help;
  border: 1px solid var(--border); flex-shrink: 0;
}
.hint:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* --- Wyniki -------------------------------------------------------- */
.result-hero {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  border-radius: var(--radius-lg);
  padding: 32px;
  color: #fff;
  margin-bottom: 24px;
  position: relative; overflow: hidden;
}
.result-hero::after {
  /* subtelna poświata, żeby kafel nie był płaskim prostokątem */
  content: ''; position: absolute; top: -60%; right: -10%;
  width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(circle, rgba(16,185,129,.22), transparent 65%);
  pointer-events: none;
}
.result-hero-label {
  font-size: .84rem; text-transform: uppercase; letter-spacing: .08em;
  color: rgba(255,255,255,.62); font-weight: 600; margin-bottom: 6px;
}
.result-hero-value {
  font-size: clamp(2.2rem, 6vw, 3.4rem); font-weight: 800;
  letter-spacing: -.03em; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.result-hero-note { color: rgba(255,255,255,.72); font-size: .92rem; margin-top: 8px; }

.stats { display: grid; gap: 14px; }
.stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.stat-label {
  font-size: .8rem; color: var(--text-muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
}
.stat-value {
  font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.stat-value.accent   { color: var(--accent); }
.stat-value.danger   { color: var(--red-500); }
.stat-value.warning  { color: var(--amber-500); }
.stat-sub { font-size: .84rem; color: var(--text-subtle); margin-top: 2px; }

/* Pasek proporcji kapitał / odsetki - jedna z ważniejszych wizualizacji */
.split-bar {
  display: flex; height: 40px; border-radius: 10px;
  overflow: hidden; margin: 8px 0 12px;
  border: 1px solid var(--border);
}
.split-bar > div {
  display: grid; place-items: center;
  font-size: .8rem; font-weight: 700; color: #fff;
  transition: flex-grow .5s cubic-bezier(.4, 0, .2, 1);
  min-width: 0; overflow: hidden; white-space: nowrap;
}
.split-capital  { background: var(--c-capital); }
.split-interest { background: var(--c-interest); }

.legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 12px; }
.legend-item {
  display: flex; align-items: center; gap: 7px;
  font-size: .86rem; color: var(--text-muted);
}
.legend-dot { width: 11px; height: 11px; border-radius: 3px; flex-shrink: 0; }

/* --- Wykresy ------------------------------------------------------- */
.chart-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.chart-title {
  font-weight: 700; font-size: 1.05rem; margin-bottom: 2px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.chart-desc { font-size: .88rem; color: var(--text-muted); margin-bottom: 18px; }
.chart-svg { width: 100%; height: auto; overflow: visible; }

.chart-tooltip {
  position: fixed; z-index: 200;
  background: var(--navy-900); color: #fff;
  padding: 10px 14px; border-radius: 9px;
  font-size: .84rem; line-height: 1.5;
  pointer-events: none; opacity: 0;
  transition: opacity .12s;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chart-tooltip.show { opacity: 1; }
.chart-tooltip b { color: var(--green-400); }

/* --- Tabele -------------------------------------------------------- */
.table-wrap {
  overflow-x: auto;                 /* tabela przewija się sama, strona nie */
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
thead { background: var(--bg-sunken); }
th {
  text-align: right; padding: 13px 16px;
  font-weight: 600; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); white-space: nowrap;
}
th:first-child, td:first-child { text-align: left; }
td {
  padding: 12px 16px; text-align: right;
  border-top: 1px solid var(--border);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
tbody tr:hover { background: var(--bg-sunken); }
tr.row-year { background: var(--accent-soft); font-weight: 600; }
tr.row-year td { color: var(--text); }
.t-interest { color: var(--c-interest); }
.t-capital  { color: var(--c-capital); }

/* --- Treść edukacyjna ---------------------------------------------- */
.prose { max-width: 720px; }
.prose h2 { margin: 44px 0 16px; }
.prose h3 { margin: 32px 0 12px; }
.prose p  { margin-bottom: 16px; color: var(--text-muted); font-size: 1.03rem; }
.prose ul, .prose ol { margin: 0 0 18px 22px; color: var(--text-muted); }
.prose li { margin-bottom: 8px; }
.prose strong { color: var(--text); font-weight: 650; }
.prose > *:first-child { margin-top: 0; }

/* Wzór matematyczny - wyeksponowany, bo to serce wyjaśnień */
.formula {
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 24px 0;
  font-family: var(--mono);
  overflow-x: auto;
}
.formula-eq {
  font-size: 1.28rem; color: var(--text); font-weight: 600;
  text-align: center; margin-bottom: 14px; white-space: nowrap;
}
.formula-where {
  font-family: var(--font); font-size: .89rem;
  color: var(--text-muted); line-height: 1.9;
  border-top: 1px dashed var(--border); padding-top: 14px;
}
.formula-where b { color: var(--text); font-family: var(--mono); }

/* Ramka „uwaga” - ostrzeżenia i ciekawostki */
.callout {
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 24px 0;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
}
.callout-title {
  font-weight: 700; margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px; color: var(--text);
}
.callout p { margin: 0; color: var(--text-muted); font-size: .96rem; }
.callout p + p { margin-top: 10px; }

.callout-warn   { border-left-color: var(--amber-500); background: var(--amber-50); }
.callout-danger { border-left-color: var(--red-500);   background: var(--red-50); }
.callout-info   { border-left-color: var(--blue-500);  background: var(--blue-50); }
[data-theme="dark"] .callout-warn   { background: rgba(245,158,11,.09); }
[data-theme="dark"] .callout-danger { background: rgba(239,68,68,.09); }
[data-theme="dark"] .callout-info   { background: rgba(59,130,246,.09); }

/* --- Hero ---------------------------------------------------------- */
.hero {
  padding: 90px 0 80px;
  background:
    radial-gradient(ellipse 900px 520px at 75% -5%, rgba(16,185,129,.13), transparent),
    radial-gradient(ellipse 700px 460px at 15% 100%, rgba(59,130,246,.09), transparent);
}
.hero h1 { margin-bottom: 20px; }
.hero-lead {
  font-size: clamp(1.05rem, 2.2vw, 1.28rem);
  color: var(--text-muted); max-width: 620px; margin-bottom: 32px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 44px; }
.hero-trust {
  display: flex; flex-wrap: wrap; gap: 28px;
  font-size: .89rem; color: var(--text-subtle);
}
.hero-trust span { display: flex; align-items: center; gap: 7px; }

/* --- Ranking ofert ------------------------------------------------- */
.offer {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 28px; align-items: center;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 16px;
  transition: box-shadow .18s, border-color .18s, transform .18s;
  position: relative;
}
.offer:hover {
  box-shadow: var(--shadow-lg); transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}
.offer-featured {
  border-color: var(--accent); border-width: 2px;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.offer-ribbon {
  position: absolute; top: -11px; left: 28px;
  background: var(--accent); color: #fff;
  font-size: .72rem; font-weight: 700;
  padding: 4px 12px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .05em;
}
.offer-brand { display: flex; flex-direction: column; gap: 8px; }
.offer-logo {
  height: 40px; display: flex; align-items: center;
  font-weight: 800; font-size: 1.05rem; color: var(--text);
}
.offer-rating { display: flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--text-muted); }
.offer-stars { color: var(--amber-500); letter-spacing: -1px; }

.offer-params { display: flex; flex-wrap: wrap; gap: 24px 32px; }
.offer-param-label {
  font-size: .74rem; color: var(--text-muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .04em;
}
.offer-param-value {
  font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.offer-param-value.accent { color: var(--accent); }
.offer-cta { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.offer-cta small { text-align: center; color: var(--text-subtle); font-size: .74rem; }

@media (max-width: 860px) {
  .offer { grid-template-columns: 1fr; gap: 20px; }
  .offer-params { gap: 16px 24px; }
}

/* Ujawnienie afiliacji - wymóg prawny i element zaufania */
.affiliate-disclosure {
  background: var(--bg-sunken);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: .87rem; color: var(--text-muted);
  margin-bottom: 28px;
  display: flex; gap: 12px; align-items: flex-start;
}
.affiliate-disclosure strong { color: var(--text); }

/* --- Formularz wniosku (lead-gen) ---------------------------------- */
.steps { display: flex; gap: 8px; margin-bottom: 36px; }
.step-dot {
  flex: 1; height: 4px; border-radius: 999px;
  background: var(--bg-sunken); transition: background .35s;
}
.step-dot.done { background: var(--accent); }

.step-count {
  font-size: .82rem; color: var(--text-muted);
  font-weight: 600; margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: .06em;
}

.form-step { display: none; }
.form-step.active { display: block; animation: slideIn .3s ease; }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: translateX(0); }
}

.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 560px) { .choice-grid { grid-template-columns: 1fr; } }

.choice {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  cursor: pointer; background: var(--bg-elevated);
  transition: all .15s; text-align: left;
  font-family: inherit; width: 100%;
}
.choice:hover { border-color: var(--border-strong); background: var(--bg-sunken); }
.choice[aria-pressed="true"] {
  border-color: var(--accent); background: var(--accent-soft);
}
.choice-title { font-weight: 650; color: var(--text); margin-bottom: 2px; }
.choice-desc  { font-size: .85rem; color: var(--text-muted); }

.consent {
  display: flex; gap: 12px; align-items: flex-start;
  font-size: .86rem; color: var(--text-muted);
  padding: 14px; border-radius: var(--radius-sm);
  background: var(--bg-sunken); margin-bottom: 12px;
  cursor: pointer;
}
.consent input[type="checkbox"] {
  width: 19px; height: 19px; margin-top: 1px;
  accent-color: var(--accent); flex-shrink: 0; cursor: pointer;
}
.consent a { text-decoration: underline; }

.form-error {
  color: var(--red-500); font-size: .85rem; margin-top: 6px;
  display: none; font-weight: 500;
}
.form-error.show { display: block; }
input[aria-invalid="true"] { border-color: var(--red-500); }

/* --- Stopka -------------------------------------------------------- */
.site-footer {
  background: var(--navy-900);
  color: rgba(255,255,255,.65);
  padding: 60px 0 28px;
  margin-top: 80px;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px; margin-bottom: 44px;
}
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

.site-footer h4 {
  color: #fff; font-size: .82rem; text-transform: uppercase;
  letter-spacing: .07em; margin-bottom: 16px;
}
.site-footer a { color: rgba(255,255,255,.65); display: block; padding: 5px 0; font-size: .93rem; }
.site-footer a:hover { color: #fff; }
.site-footer .logo { color: #fff; margin-bottom: 14px; }

.footer-legal {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 24px;
  font-size: .82rem; line-height: 1.7;
  color: rgba(255,255,255,.45);
}
.footer-legal p + p { margin-top: 10px; }

/* --- Baner zgody na cookies (Consent Mode v2) ----------------------- */

/*
 * Baner ma dwa widoki w jednym elemencie: prosty (Akceptuj / Odrzuć /
 * Ustawienia) oraz szczegółowy z przełącznikami kategorii. Renderuje go
 * ui.js na KAŻDEJ stronie, więc jak nagłówek i stopka - jedno źródło.
 *
 * Kolory bierze z tokenów motywu, więc działa w trybie jasnym i ciemnym
 * bez osobnych reguł.
 */
.cc-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 400;
  max-width: 720px; margin: 0 auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(150%);
  opacity: 0;
  transition: transform .4s cubic-bezier(.4,0,.2,1), opacity .3s ease;
}
.cc-banner.show { transform: translateY(0); opacity: 1; }
.cc-inner { padding: 22px 24px; }

.cc-title { font-size: 1.06rem; font-weight: 700; color: var(--text); margin: 0 0 8px; }
.cc-text  { font-size: .92rem; color: var(--text-muted); margin: 0; line-height: 1.55; }
.cc-text a { color: var(--accent); text-decoration: underline; font-weight: 600; }

.cc-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.cc-actions .btn { flex: 1 1 auto; min-width: 128px; justify-content: center; }
.cc-actions-detail .btn { min-width: 110px; }

/* Widok szczegółowy - lista kategorii z przełącznikami */
.cc-cats {
  display: flex; flex-direction: column; gap: 12px;
  margin: 4px 0 4px; max-height: 46vh; overflow-y: auto;
}
.cc-cat {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 16px;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cc-cat-info { flex: 1; min-width: 0; }
.cc-cat-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cc-cat-name { font-weight: 650; color: var(--text); font-size: .96rem; }
.cc-cat-badge {
  font-size: .68rem; font-weight: 600; padding: 2px 9px; border-radius: 20px;
  background: var(--accent-soft); color: var(--accent);
  text-transform: uppercase; letter-spacing: .03em;
}
.cc-cat-desc { margin: 6px 0 0; font-size: .86rem; color: var(--text-muted); line-height: 1.5; }

/* Przełącznik (switch) - czysty CSS, bez obrazków */
.cc-switch { position: relative; flex-shrink: 0; width: 44px; height: 26px; }
.cc-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.cc-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--border-strong); border-radius: 26px;
  transition: background .2s ease;
}
.cc-slider::before {
  content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
  transition: transform .2s ease;
}
.cc-switch input:checked + .cc-slider { background: var(--accent); }
.cc-switch input:checked + .cc-slider::before { transform: translateX(18px); }
.cc-switch input:disabled + .cc-slider { opacity: .55; cursor: not-allowed; }
.cc-switch input:focus-visible + .cc-slider { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Pływający przycisk „Ustawienia cookies" po podjęciu decyzji */
.cc-reopen {
  position: fixed; left: 16px; bottom: 16px; z-index: 390;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text-muted);
  box-shadow: var(--shadow); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s ease, color .2s ease;
}
.cc-reopen:hover { transform: scale(1.08); color: var(--accent); }
.cc-reopen .icon { width: 20px; height: 20px; }

/* Przycisk-duszek: mniejsza waga wizualna, do akcji drugorzędnych */
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg-sunken); color: var(--text); }

@media (max-width: 520px) {
  .cc-actions .btn { flex: 1 1 100%; }
  .cc-inner { padding: 20px; }
}

/* --- Ikony ----------------------------------------------------------- */

/*
 * Ikony rysowane kreską, w jednym kolorze, dziedziczące kolor tekstu.
 * Zastąpiły emoji: te wyświetlały się inaczej na każdym systemie,
 * wnosiły do serwisu finansowego niepotrzebną krzykliwość i nie dawały
 * się dopasować kolorystycznie do trybu ciemnego.
 */
.icon {
  width: 1.15em;
  height: 1.15em;
  display: inline-block;
  vertical-align: -0.18em;
  flex-shrink: 0;
  stroke-width: 1.75;
}

/* Ikona wiodąca w karcie - duża, wyciszona kolorem akcentu. */
.icon-lg {
  width: 26px;
  height: 26px;
  vertical-align: middle;
  stroke-width: 1.6;
  color: var(--accent);
}

/*
 * Ikona wiodąca karty: wyśrodkowana, osadzona w miękkim kaflu.
 *
 * Sama ikona przyklejona do lewej krawędzi wyglądała jak zawieszona
 * w próżni. Kafel nadaje jej wagę i sprawia, że wygląda na element
 * zaprojektowany, a nie doklejony.
 */
.card-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  transition: transform .18s, background .18s;
}

/* Karta reaguje na najechanie - ikona lekko rośnie razem z nią. */
.card-hover:hover .card-icon,
a:hover > .card-icon {
  transform: scale(1.06);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

/* Tekst karty z wyśrodkowaną ikoną też wyrównujemy do środka - inaczej
   ikona na osi i tekst przy lewej krawędzi gryzą się ze sobą. */
.card-icon ~ h3,
.card-icon ~ p { text-align: center; }

/* Ikona w nagłówku ramki informacyjnej. */
.callout-title .icon {
  width: 1.1em;
  height: 1.1em;
  color: var(--accent);
}
.callout-warn   .callout-title .icon { color: var(--amber-500); }
.callout-danger .callout-title .icon { color: var(--red-500); }
.callout-info   .callout-title .icon { color: var(--blue-500); }

/* Ikona w przycisku - lekko przygaszona, żeby nie konkurowała z tekstem. */
.btn .icon {
  width: 1.05em;
  height: 1.05em;
  opacity: .9;
}

/* Ikona w polu statystyki i w liście zalet. */
.legend-item .icon,
.hero-trust .icon { color: var(--accent); }

/* Ikona sukcesu - duża, na potwierdzeniach. */
.icon-success {
  width: 56px;
  height: 56px;
  color: var(--accent);
  stroke-width: 1.4;
}

/* Gwiazdki oceny w rankingu. */
.offer-stars { display: inline-flex; gap: 1px; letter-spacing: 0; }
.offer-stars .icon { width: 14px; height: 14px; vertical-align: middle; }

/* Ikony w nagłówku serwisu (menu, motyw) - bez koloru akcentu. */
.nav-toggle .icon, .theme-toggle .icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

/* --- Miejsca reklamowe (AdSense) ------------------------------------ */

.ad-slot {
  margin: 36px auto;
  max-width: 100%;
  min-height: 90px;
  overflow: hidden;      /* baner nigdy nie rozpycha układu strony */
}

/*
 * Pasek pod nagłówkiem - obecny na każdej stronie.
 *
 * Niski i wąski celowo. Baner spychający treść w dół psuje Core Web Vitals,
 * a Google karze to niższym Quality Score, czyli DROŻSZYMI kliknięciami
 * w kampaniach. Zarezerwowana wysokość sprawia, że po doładowaniu reklamy
 * układ strony nie podskakuje.
 */
.ad-slot-top {
  margin: 14px auto 0;
  min-height: 90px;
  max-height: 110px;
}

/* Na telefonie pasek jest jeszcze niższy - tam każdy piksel nad zgięciem
   strony walczy o uwagę z treścią, po którą użytkownik przyszedł. */
@media (max-width: 720px) {
  .ad-slot-top { min-height: 60px; max-height: 70px; margin-top: 10px; }
  .ad-slot-top.ad-slot-preview { padding: 12px; min-height: 60px; }
  .ad-slot-top .ad-slot-hint { display: none; }
}

/* Etykieta wymagana przez zasady AdSense - reklama musi być odróżnialna
   od treści serwisu. Nie usuwaj jej. */
.ad-slot-label {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-subtle);
  text-align: center;
  margin-bottom: 8px;
  font-weight: 600;
}

/* Podgląd - widoczny, dopóki nie wpiszesz swojego ID AdSense. */
.ad-slot-preview {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-sunken);
  padding: 28px 20px;
  text-align: center;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.ad-slot-preview .ad-slot-label { margin-bottom: 2px; }
.ad-slot-name {
  font-family: var(--mono);
  font-size: .84rem;
  color: var(--text);
  font-weight: 600;
}
.ad-slot-hint {
  font-size: .78rem;
  color: var(--text-subtle);
}

/* Wariant w treści artykułu - węższy, wtopiony w kolumnę tekstu. */
.ad-slot-inline { margin: 32px 0; }

@media print { .ad-slot { display: none !important; } }

/* --- Pomocnicze ---------------------------------------------------- */
.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;
}
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: .88rem; }
.hidden { display: none !important; }

.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head.center { margin-left: auto; margin-right: auto; }
.section-head h2 { margin-bottom: 12px; }
.section-head p { color: var(--text-muted); font-size: 1.05rem; }

@media print {
  .site-header, .site-footer, .calc-panel, .cc-banner, .cc-reopen, .btn { display: none !important; }
  body { background: #fff; }
  .card, .chart-box, .table-wrap { break-inside: avoid; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
