/* Kalkulator zużycia pelletu – uzupełnia wspólne ../all.css (menu, stopka, czcionki).
   Wygląd jak w czesci-zamienne/ i kalkulator-przekroju-komina/: czarne teksty, żółte akcenty, Montserrat + Source Sans 3. */
:root {
    --zolty: #ffdd00;
    --zolty-2: #fff1b0;
    --zolty-jasny: #fff8db;
    --grafit: #485156;
    --szary: #6f787d;
    --linia: #dadfe1;
    --ramka: #0000002e;
    --blad: #c62828;
}

/* all.css daje .page-container overflow:hidden – to blokuje position:sticky wyników */
.page-container {
    overflow: clip;
}

/* główne all.css na wąskim ekranie barwi linki menu na biało (ciemne menu strony głównej) */
@media (max-width: 991px) {
    #nawigacja .navbar-nav li a {
        color: #000 !important;
    }
}

/* ===== Nagłówek ===== */
#kalkulator {
    color: #000;
}

.calc-container {
    padding: 40px 20px 0;
}

.calc-header {
    margin-bottom: 64px;
}

.calc-title {
    font-family: Montserrat, sans-serif;
    font-weight: 800;
    font-size: 2.25rem;
    line-height: 1.2;
    text-transform: uppercase;
    color: #000;
    margin: 0 0 14px;
}

.calc-subtitle {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 18px;
    line-height: 1.5;
    color: #000;
    margin: 0;
}

/* ===== Układ: formularz | wyniki ===== */
.calc-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: start;
}

@media (min-width: 992px) {
    .calc-content {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 56px;
    }
}

/* ===== Pola formularza ===== */
.field {
    margin-bottom: 40px;
}

.field-last {
    margin-bottom: 0;
}

/* wartość opałowa i cena: etykiety, pola i podpowiedzi w tych samych wierszach, także gdy etykieta się zawija */
.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 18px;
}

.input-row .field {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    align-content: start;
}

.input-row label {
    align-self: end;
}

/* plakietka wartości wyższa od etykiety – podciągamy wiersz, żeby odstępy liczyły się od tekstu etykiety */
.input-header {
    display: flex;
    margin-top: -6px;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

#kalkulator label {
    display: block;
    font-family: Montserrat, sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: #000;
    margin: 0 0 6px;
}

.input-header label {
    margin-bottom: 0 !important;
}

/* jednostki w etykietach zwykłymi literami: (m²), (l), (zł/t) */
#kalkulator .unit-lc,
#kalkulator .label-optional {
    text-transform: none;
    letter-spacing: 0;
}

#kalkulator .label-optional {
    font-weight: 500;
    color: var(--szary);
}

.value-display {
    flex-shrink: 0;
    min-width: 52px;
    text-align: center;
    font-family: Montserrat, sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    color: #000;
    background: var(--zolty-2);
    padding: 7px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.hint-text {
    display: block;
    margin-top: 4px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: #000;
}

/* pola i listy jak filtr w czesci-zamienne/ */
.modern-select,
.modern-input {
    display: block;
    width: 100%;
    height: 50px;
    padding: 0 14px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 16px;
    color: #000;
    background-color: #fff;
    border: 1px solid var(--ramka);
    border-radius: 6px;
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
    appearance: none;
}

.modern-select {
    padding-right: 40px;
    cursor: pointer;
    text-overflow: ellipsis;
    background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") no-repeat right 14px center / 14px 14px;
}

.modern-select:focus,
.modern-input:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 3px #fedd0080;
}

.modern-input::placeholder {
    color: #9aa1a5;
}

.postcode-input {
    max-width: 180px;
}

/* ===== Suwaki: tor wypełniony do bieżącej wartości (--fill ustawia script.js) ===== */
.slider {
    --fill: 50%;
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    height: 6px;
    margin: 18px 0 9px;
    border-radius: 3px;
    background: linear-gradient(to right, #929ba0 var(--fill), var(--linia) var(--fill));
    outline: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--zolty);
    border: 0;
    cursor: pointer;
    transition: box-shadow .15s;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--zolty);
    border: 0;
    cursor: pointer;
    transition: box-shadow .15s;
}

.slider:hover::-webkit-slider-thumb,
.slider:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 6px #fedd0080;
}

.slider:hover::-moz-range-thumb,
.slider:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 6px #fedd0080;
}

/* ===== Klimat i błędy ===== */
.climate-info {
    margin-top: 10px;
    padding: 10px 14px;
    background: var(--zolty-jasny);
    border-left: 4px solid var(--zolty);
    border-radius: 0 6px 6px 0;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 16px;
    line-height: 1.45;
    color: #000;
}

.climate-info[hidden] {
    display: none;
}

.climate-info strong {
    font-weight: 700;
    white-space: nowrap;
}

.modern-input.is-invalid {
    border-color: var(--blad);
    box-shadow: 0 0 0 3px rgba(198, 40, 40, .15);
}

.error-text {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-top: 8px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 600;
    color: var(--blad);
}

/* ikona „!” w kółku */
.error-text::before {
    content: "!";
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border-radius: 50%;
    background: var(--blad);
    color: #fff;
    font-family: Montserrat, sans-serif;
    font-weight: 800;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
}

.error-text[hidden] {
    display: none;
}

/* przy błędzie podpowiedź „Zazwyczaj…” chowamy, żeby nie dublować tekstów */
.modern-input.is-invalid + .hint-text {
    display: none;
}

/* ===== Wyniki ===== */
.results-panel {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .2);
    border-radius: 0;
    padding: 28px;
}

@media (min-width: 992px) and (min-height: 760px) {
    .results-panel {
        position: sticky;
        top: 96px;
    }
}

/* nagłówki jak nagłówki grup w czesci-zamienne/: Montserrat 500 (bez kreski pod spodem – decyzja właściciela) */
.results-title {
    font-family: Montserrat, sans-serif;
    font-weight: 600;
    font-size: 24px;
    line-height: 1.25;
    color: #000;
    margin: 0 0 18px;
}

.results-title-next {
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid rgba(0, 0, 0, .2); /* jak kreska nad przypisami */
}

.result-card {
    display: flex;
    flex-direction: column;
    background: #f2f4f5;
    border-radius: 0;
    padding: 16px 18px;
}

/* liczby w sąsiednich kafelkach na jednej wysokości, nawet gdy etykieta ma dwie linie */
.result-label {
    flex-grow: 1;
}

.result-card.primary {
    margin-bottom: 12px;
    background: #ffe343;
}

.result-card.primary .result-label,
.result-card.primary .result-value,
.result-card.primary .result-value .unit {
    color: #000;
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.result-label {
    font-family: Montserrat, sans-serif;
    font-weight: 700;
    font-size: 12px;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--grafit);
    margin-bottom: 6px;
}

.result-value {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 6px;
    font-family: Montserrat, sans-serif;
    font-weight: 800;
    font-size: 56px;
    line-height: 1.1;
    letter-spacing: -.02em;
    color: #000;
    font-variant-numeric: tabular-nums;
}

.result-value.small {
    font-size: 28px;
}

.result-value.small .unit {
    font-size: 14px;
}

.result-value .unit {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 600;
    font-size: 16px;
    letter-spacing: 0;
    color: #000;
}

.result-note {
    margin: 16px 0 0;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--grafit);
}

/* ===== Uwagi pod kalkulatorem ===== */
.calc-footnote {
    margin-top: 64px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, .2); /* jak .divider-h w stopce */
    font-family: 'Source Sans 3', sans-serif;
    color: var(--szary);
}

.calc-footnote p {
    margin: 0 0 2px;
    font-size: 14px;
    line-height: 1.35;
    color: var(--szary) !important; /* all.css barwi każde p i a na czarno z !important */
}

.sources-note a {
    color: inherit !important;
    text-decoration: underline;
}

.sources-note a:hover {
    color: #000 !important;
}

/* ===== Pasek z dobowym zużyciem – tylko wąskie ekrany (jak pasek koszyka w czesci-zamienne/) ===== */
.result-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    display: flex;
    justify-content: flex-end; /* do prawej – z lewej w rogu jest przycisk zgód na cookies */
    align-items: center;
    gap: 16px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: #ffe343; /* jak kafelek dobowego zużycia */
    color: #000;
}

.result-bar[hidden] {
    display: none;
}

.result-bar-info {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 16px;
    white-space: nowrap;
}

.result-bar-info strong {
    font-family: Montserrat, sans-serif;
    font-weight: 700;
}

/* jak przycisk OBLICZ w kalkulatorze przekroju komina */
.result-bar-btn {
    background: #000;
    color: #fefffe !important;
    border-radius: 6px;
    font-family: Montserrat, sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 24px;
    padding: 8px 16px;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background-color .15s;
}

.result-bar-btn:hover,
.result-bar-btn:focus-visible {
    background: #596469;
}

@media (min-width: 992px) {
    .result-bar {
        display: none !important;
    }
}

@media (max-width: 991px) {
    body.ma-pasek .page-container {
        padding-bottom: 64px;
    }

    body.ma-pasek .scrollToTop {
        bottom: 80px;
    }
}

#wyniki {
    scroll-margin-top: 90px;
}

/* ===== Telefon ===== */
@media (max-width: 767px) {
    .calc-container {
        padding: 28px 16px 40px;
    }

    .calc-header {
        margin-bottom: 40px;
    }

    .calc-title {
        font-size: 1.6rem;
    }

    .calc-subtitle {
        font-size: 17px;
    }

    .results-panel {
        padding: 22px 16px;
        margin: 0 -4px;
    }

    .result-value {
        font-size: 48px;
    }

    .result-value.small {
        font-size: 24px;
    }

    .result-card {
        padding: 14px;
    }
}

@media (max-width: 340px) {
    .input-row {
        grid-template-columns: 1fr;
        grid-template-rows: none;
    }

    .input-row .field {
        grid-row: auto;
        grid-template-rows: none;
    }
}
