/* Calculator section styling. Shared by tenant sites and the builder preview,
   so a generated calculator looks the same in the panel as on the live page.

   Two layouts, both taken from the mock-ups in sources/tpl:
     .kfc--split  formularz w kartach kroków + sticky karta wyniku z ciemnym
                  nagłówkiem kwoty (makieta „Layout A · split")
     .kfc--sheet  wąska kolumna konfiguracji, pasek ilości i szeroka tabela
                  zestawienia z podsumowaniem (makieta „Layout C · arkusz")
   .kfc--stacked i .kfc--compact to wąskie warianty układu split.

   Colour variables are resolved per template: lead-gen/business-card expose
   --accent/--surface/--line/--muted, the equipment (WYSUW) skin exposes
   --c-primary/--c-surface/--c-line/--c-body. Both are tried before the
   neutral fallback, so the block inherits the tenant's palette everywhere. */
.kfc-section, .kfc {
  --kfc-accent: var(--accent, var(--c-primary, var(--primary, #0f766e)));
  --kfc-on-accent: var(--on-accent, var(--c-on, #fff));
  --kfc-ink: var(--ink, var(--c-ink, #1b2330));
  --kfc-body: var(--muted, var(--c-body, #5b6573));
  --kfc-muted: var(--muted, var(--c-muted, #8b94a3));
  --kfc-line: var(--line, var(--c-line, #e7eaef));
  --kfc-surface: var(--surface, var(--c-surface, #fff));
  --kfc-soft: var(--c-soft, color-mix(in srgb, var(--kfc-ink) 5%, #fff));
  --kfc-tint: var(--primary-soft, var(--c-tint, color-mix(in srgb, var(--kfc-accent) 9%, #fff)));
  --kfc-ring: 0 0 0 3px color-mix(in srgb, var(--kfc-accent) 18%, transparent);
}
.kfc *, .kfc-section * { box-sizing: border-box; }

/* ── section chrome ──────────────────────────────────────────────────── */
/* Cały blok siedzi na pasku chłodniejszego tła na pełną szerokość, żeby białe
   karty formularza i wyniku odcinały się od reszty strony. */
/* scroll-margin: sekcja ma id="kalkulator", a nagłówki szablonów są sticky. */
.kfc-section { padding: 56px 0; background: var(--kfc-soft); scroll-margin-top: 90px; }
.kfc-wrap { max-width: 1200px; margin: 0 auto; padding-inline: 28px; }
.kfc-head { margin-bottom: 24px; }
.kfc-head h2 { margin: 0; font-size: clamp(26px, 3.4vw, 38px); line-height: 1.1; letter-spacing: -.02em; color: var(--kfc-ink); }
.kfc-head p { margin: 12px 0 0; max-width: 640px; line-height: 1.65; color: var(--kfc-body); }

/* Arkusz: ciemny pas nagłówka na całą szerokość i chłodne tło pod tabelą. */
.kfc-section--sheet { padding: 0 0 64px; background: var(--kfc-soft); }
.kfc-section--sheet .kfc-band { background: var(--kfc-ink); }
.kfc-section--sheet .kfc-head { margin-bottom: 26px; padding-block: 38px 34px; }
.kfc-section--sheet .kfc-head h2 { color: #fff; }
.kfc-section--sheet .kfc-head p { color: #aeb6c2; }
.kfc-section--sheet .kfc-wrap { max-width: 1280px; }
.kfc-section--sheet .kfc { padding-top: 26px; }

/* ── layout ──────────────────────────────────────────────────────────── */
.kfc { display: grid; gap: 24px; align-items: start; }
.kfc--stacked, .kfc--compact { grid-template-columns: 1fr; }
.kfc--compact { max-width: 620px; margin-inline: auto; }

@media (min-width: 900px) {
  .kfc--split { grid-template-columns: 1.35fr .85fr; gap: 32px; }
  .kfc--sheet { grid-template-columns: 370px 1fr; }
  .kfc--split .kfc-panel--results { position: sticky; top: 90px; }
  .kfc--sheet .kfc-panel:not(.kfc-panel--results) { position: sticky; top: 88px; }
}

/* Both columns are plain stacks; the chrome lives on the cards inside. */
.kfc-panel { display: grid; gap: 18px; align-content: start; min-width: 0; }
.kfc-panel [data-kfc-results] { display: grid; gap: 16px; align-content: start; }
.kfc-panel__title { margin: 0; font-size: 19px; font-weight: 800; color: var(--kfc-ink); }
.kfc-panel__intro { margin: 6px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--kfc-body); }

/* ── form: karty kroków ──────────────────────────────────────────────── */
.kfc-form { display: grid; gap: 18px; }
.kfc-card { border: 1px solid var(--kfc-line); border-radius: 16px; background: var(--kfc-surface); padding: 22px 24px 24px; }
.kfc-card__title { margin: 0 0 16px; font-size: 12px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; color: var(--kfc-accent); }
.kfc-card__fields { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.kfc--sheet .kfc-card { border-radius: 10px; padding: 20px 22px 22px; }

.kfc-field { display: grid; gap: 7px; align-content: start; min-width: 0; }
.kfc-field--wide { grid-column: 1 / -1; }
.kfc-field[hidden] { display: none; }
.kfc-field__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.kfc-label { font-weight: 600; font-size: 13.5px; color: var(--kfc-ink); }

.kfc-input { width: 100%; height: 46px; padding: 0 14px; border: 1.5px solid var(--kfc-line); border-radius: 9px; background: var(--kfc-surface); color: var(--kfc-ink); font: inherit; font-size: 15px; }
.kfc-input:focus { outline: none; border-color: var(--kfc-accent); box-shadow: var(--kfc-ring); }
textarea.kfc-input { height: auto; min-height: 88px; padding: 12px 14px; resize: vertical; line-height: 1.55; }
select.kfc-input { padding-right: 10px; }
.kfc-input[type="number"] { font-variant-numeric: tabular-nums; }
.kfc-input[type="range"] { height: 6px; padding: 0; border: 0; box-shadow: none; background: transparent; accent-color: var(--kfc-accent); }

/* Jednostka jako przystawka w ramce pola (mb, dni, m²). */
.kfc-inputwrap { display: flex; align-items: stretch; overflow: hidden; border: 1.5px solid var(--kfc-line); border-radius: 9px; background: var(--kfc-surface); }
.kfc-inputwrap:focus-within { border-color: var(--kfc-accent); box-shadow: var(--kfc-ring); }
.kfc-inputwrap .kfc-input { flex: 1; min-width: 0; border: 0; border-radius: 0; }
.kfc-inputwrap .kfc-input:focus { box-shadow: none; }
.kfc-unit { display: flex; align-items: center; padding: 0 14px; border-left: 1px solid var(--kfc-line); background: var(--kfc-soft); font-size: 13.5px; color: var(--kfc-muted); }
.kfc-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--kfc-muted); }
.kfc-readout { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 15px; color: var(--kfc-accent); }
.kfc-help { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--kfc-muted); }
.kfc-submit { margin-top: 2px; justify-self: start; }

/* ── wybory: karty z podpowiedzią i ceną ─────────────────────────────── */
.kfc-choices { display: grid; gap: 10px; }
.kfc-choices--grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.kfc-choice { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--kfc-ink); cursor: pointer; }
.kfc-choice input { flex: none; margin: 0; width: 18px; height: 18px; accent-color: var(--kfc-accent); }
.kfc-choice--card { gap: 11px; padding: 13px 15px; border: 1.5px solid var(--kfc-line); border-radius: 11px; background: var(--kfc-surface); }
.kfc-choice--card:hover { border-color: var(--kfc-accent); }
.kfc-choice--card:has(input:checked) { border-color: var(--kfc-accent); background: var(--kfc-tint); }
.kfc-choice__body { display: grid; gap: 2px; flex: 1; min-width: 0; }
.kfc-choice__label { font-weight: 700; font-size: 14.5px; }
.kfc-choice__hint { font-size: 12px; line-height: 1.45; color: var(--kfc-muted); }
.kfc-choice__price { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 14px; white-space: nowrap; color: var(--kfc-muted); }
.kfc-choice--card:has(input:checked) .kfc-choice__price { color: var(--kfc-accent); }

/* ── wynik: karta z ciemnym nagłówkiem kwoty ─────────────────────────── */
.kfc-rescard { overflow: hidden; border: 1px solid var(--kfc-line); border-radius: 16px; background: var(--kfc-surface); box-shadow: 0 16px 44px rgba(27, 35, 48, .08); }
.kfc-rescard__head { padding: 24px 26px; background: var(--kfc-ink); }
.kfc-rescard__label { display: block; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: #8b94a3; }
.kfc-rescard__value { display: block; margin-top: 6px; font-size: clamp(30px, 4.2vw, 40px); font-weight: 800; line-height: 1.05; color: #fff; font-variant-numeric: tabular-nums; }
.kfc-rescard__sub { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: #aeb6c2; }
.kfc--accent-outline .kfc-rescard__sub, .kfc--accent-plain .kfc-rescard__sub { color: var(--kfc-body); }
.kfc-rescard__body { padding: 10px 26px 22px; }
.kfc-rescard__body > .kfc-block:first-child, .kfc-rescard__body > .kfc-note:first-child { margin-top: 8px; }

.kfc-result { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--kfc-line); font-size: 14px; }
.kfc-result:last-child { border-bottom: 0; }
.kfc-result__label { color: var(--kfc-body); }
.kfc-result__value { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; color: var(--kfc-ink); }
.kfc-result--total { align-items: baseline; padding: 16px 0 4px; border-bottom: 0; }
.kfc-result--total .kfc-result__label { font-weight: 800; font-size: 17px; color: var(--kfc-ink); }
.kfc-result--total .kfc-result__value { font-weight: 800; font-size: 24px; color: var(--kfc-accent); }

.kfc--accent-outline .kfc-rescard__head { background: transparent; border-bottom: 1px solid var(--kfc-line); }
.kfc--accent-outline .kfc-rescard__label, .kfc--accent-plain .kfc-rescard__label { color: var(--kfc-muted); }
.kfc--accent-outline .kfc-rescard__value { color: var(--kfc-accent); }
.kfc--accent-plain .kfc-rescard__head { background: transparent; }
.kfc--accent-plain .kfc-rescard__value { color: var(--kfc-ink); }

/* ── arkusz: pasek ilości, tabela, podsumowanie ──────────────────────── */
.kfc-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 14px; padding: 18px 20px; border: 1px solid var(--kfc-line); border-radius: 10px; background: var(--kfc-surface); }
.kfc-tile__value { font-size: 26px; font-weight: 800; line-height: 1; color: var(--kfc-ink); font-variant-numeric: tabular-nums; }
.kfc-tile:first-child .kfc-tile__value { color: var(--kfc-accent); }
.kfc-tile__label { margin-top: 6px; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--kfc-muted); }

.kfc-rescard--sheet { border-radius: 10px; box-shadow: none; }
.kfc-sheet__bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 22px; border-bottom: 1px solid var(--kfc-line); background: var(--kfc-soft); }
.kfc-sheet__bar-title { font-size: 16px; font-weight: 800; color: var(--kfc-ink); }
.kfc-sheet__bar-note { font-size: 13px; text-align: right; color: var(--kfc-muted); }
.kfc-sheet__totals { padding: 18px 22px 22px; border-top: 1px solid var(--kfc-line); }
.kfc-sheet__totals .kfc-result:last-of-type { border-bottom: 0; }

.kfc-tablewrap { overflow-x: auto; }
.kfc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.kfc-table th, .kfc-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--kfc-line); }
.kfc-table th { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--kfc-muted); }
.kfc-table td { color: var(--kfc-body); }
.kfc-table td:first-child { font-weight: 700; color: var(--kfc-ink); }
.kfc-table th:not(:first-child), .kfc-table td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.kfc-table tr:last-child td { border-bottom: 0; }
.kfc-rescard--sheet .kfc-table th:first-child, .kfc-rescard--sheet .kfc-table td:first-child { padding-left: 22px; }
.kfc-rescard--sheet .kfc-table th:last-child, .kfc-rescard--sheet .kfc-table td:last-child { padding-right: 22px; }

/* ── bloki opisowe ───────────────────────────────────────────────────── */
.kfc-block { margin-top: 16px; }
.kfc-block:first-child { margin-top: 0; }
.kfc-block__title { margin: 0 0 12px; font-size: 15px; font-weight: 800; color: var(--kfc-ink); }
/* Karta na pasku, nie pasek na pasku: tło sekcji jest już chłodne. */
.kfc-softbox { padding: 20px 22px; border: 1px solid var(--kfc-line); border-radius: 14px; background: var(--kfc-surface); }
.kfc-softbox .kfc-block { margin-top: 18px; }
.kfc--sheet .kfc-softbox { border-radius: 10px; }
.kfc-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; line-height: 1.55; color: var(--kfc-body); }
.kfc-list li { display: flex; align-items: flex-start; gap: 10px; }
.kfc-list li::before { content: "✓"; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--kfc-accent); color: var(--kfc-on-accent); font-size: 10px; }
.kfc-list--plain li::before { content: none; }
.kfc-note { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--kfc-body); }
.kfc-note + .kfc-note, .kfc-note p { margin: 6px 0 0; }
.kfc-disclaimer { margin: 0; font-size: 11.5px; line-height: 1.6; text-align: center; color: var(--kfc-muted); }

/* ── bramka leadowa ──────────────────────────────────────────────────── */
.kfc-lead { display: grid; gap: 12px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--kfc-line); }
.kfc-lead:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.kfc-lead__form { display: grid; gap: 12px; }
.kfc-lead__hp { position: absolute; left: -9999px; }
.kfc-lead__submit { width: 100%; padding: 14px 18px; border: 0; border-radius: 10px; font: inherit; font-weight: 800; font-size: 16px; cursor: pointer; background: var(--kfc-accent); color: var(--kfc-on-accent); }
.kfc-lead__submit:hover { filter: brightness(.94); }
.kfc-consent { align-items: flex-start; gap: 9px; font-size: 12.5px; line-height: 1.5; color: var(--kfc-muted); }
.kfc-consent input { margin-top: 2px; }
.kfc-sent { margin: 0; padding: 12px 14px; border-radius: 10px; font-weight: 600; background: var(--kfc-tint); color: var(--kfc-ink); }
