/*
 * Kredytowe-Forum.pl – kalkulatory kredytowe
 * Jedyny zielony kolor interfejsu: #096C20.
 */

/*
 * Twardy reset układu dla stron, na których shortcode został przypadkowo
 * osadzony w bloku Kod/Preformatowany albo gdzie stary CSS kalkulatora
 * nadpisuje typografię i wysokości pól.
 */
pre:has(.kfpl-calculator),
code:has(.kfpl-calculator) {
    white-space: normal !important;
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    color: inherit !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
}

.kfpl-calculator,
.kfpl-calculator * {
    white-space: normal !important;
    font-family: "Roboto", Arial, "Helvetica Neue", Helvetica, sans-serif !important;
}

.kfpl-calculator .kfpl-form {
    display: block !important;
    position: relative !important;
    float: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    transform: none !important;
}

.kfpl-calculator .kfpl-fields {
    display: grid !important;
    grid-auto-flow: row !important;
    grid-auto-rows: min-content !important;
    row-gap: 18px !important;
    column-gap: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.kfpl-calculator .kfpl-field {
    align-self: start !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}

.kfpl-calculator .kfpl-field > label {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 0 7px !important;
    color: #2b2b2b !important;
    font-size: 13px !important;
    font-style: normal !important;
    font-weight: 400 !important;
    line-height: 1.35 !important;
    text-align: left !important;
    text-transform: none !important;
}

.kfpl-calculator .kfpl-field > input,
.kfpl-calculator .kfpl-field > select,
.kfpl-calculator .kfpl-field > textarea,
.kfpl-calculator .kfpl-input-suffix > input {
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    padding: 11px 12px !important;
    color: #2b2b2b !important;
    font-size: 14px !important;
    font-style: normal !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
    text-align: left !important;
    text-transform: none !important;
}

.kfpl-calculator .kfpl-input-suffix {
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
}

.kfpl-calculator .kfpl-input-suffix > input {
    padding-right: 52px !important;
}

.kfpl-calculator .kfpl-input-suffix > span {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    color: #6f6f6f !important;
    font-size: 12px !important;
    font-style: normal !important;
    font-weight: 700 !important;
    line-height: 1 !important;
}

.kfpl-calculator .kfpl-help {
    height: auto !important;
    min-height: 0 !important;
    margin: 5px 0 0 !important;
    font-family: "Roboto", Arial, "Helvetica Neue", Helvetica, sans-serif !important;
    font-size: 11px !important;
    font-style: normal !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;
}

.kfpl-calculator .kfpl-section-heading h3 {
    font-family: "Roboto", Arial, "Helvetica Neue", Helvetica, sans-serif !important;
    font-style: normal !important;
    font-weight: 400 !important;
}

.kfpl-calculator {
    --kfpl-green: #096C20;
    --kfpl-text: #2b2b2b;
    --kfpl-heading: #1f1f1f;
    --kfpl-muted: #6f6f6f;
    --kfpl-border: #dddddd;
    --kfpl-border-strong: #c9c9c9;
    --kfpl-background: #f6f6f6;
    --kfpl-background-light: #fafafa;
    --kfpl-white: #ffffff;
    --kfpl-black: #111111;
    color: var(--kfpl-text);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.6;
    margin: 28px 0;
}

.kfpl-calculator *,
.kfpl-calculator *::before,
.kfpl-calculator *::after { box-sizing: border-box; }

/*
 * Izolacja formularzy od reguł aktywnego motywu WordPress.
 * Motyw Sydney i dodatkowe style strony nie mogą przesuwać pól,
 * nadawać im szerokości częściowej ani ustawiać ich jako float/flex.
 */
.kfpl-calculator .kfpl-fields {
    width: 100% !important;
    max-width: 100% !important;
    align-items: start;
}

.kfpl-calculator .kfpl-field {
    display: block !important;
    position: relative !important;
    float: none !important;
    clear: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    inset: auto !important;
    transform: none !important;
}

.kfpl-calculator .kfpl-field > label {
    display: block !important;
    position: static !important;
    float: none !important;
    clear: both !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 0 6px !important;
    padding: 0 !important;
    inset: auto !important;
    transform: none !important;
}

.kfpl-calculator .kfpl-field > input,
.kfpl-calculator .kfpl-field > select,
.kfpl-calculator .kfpl-field > textarea,
.kfpl-calculator .kfpl-input-suffix,
.kfpl-calculator .kfpl-input-suffix > input {
    display: block !important;
    position: static !important;
    float: none !important;
    clear: both !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    left: auto !important;
    right: auto !important;
    inset: auto !important;
    transform: none !important;
    box-sizing: border-box !important;
}

.kfpl-calculator .kfpl-input-suffix {
    position: relative !important;
    overflow: visible !important;
}

.kfpl-calculator .kfpl-input-suffix > span {
    position: absolute !important;
    top: 50% !important;
    right: 12px !important;
    left: auto !important;
    width: auto !important;
    margin: 0 !important;
    transform: translateY(-50%) !important;
}

.kfpl-calculator-shell {
    overflow: hidden;
    border: 1px solid var(--kfpl-border);
    border-radius: 4px;
    background: var(--kfpl-white);
}

.kfpl-calculator-header {
    padding: 28px 28px 24px;
    border-top: 4px solid var(--kfpl-green);
    border-bottom: 1px solid var(--kfpl-border);
    background: var(--kfpl-white);
}

.kfpl-eyebrow {
    margin: 0 0 6px !important;
    color: var(--kfpl-green) !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.kfpl-calculator-header h2 {
    margin: 0 0 8px;
    color: var(--kfpl-heading);
    font-family: inherit;
    font-size: clamp(26px, 4vw, 36px);
    font-weight: 700;
    line-height: 1.2;
}

.kfpl-calculator-header p:last-child {
    max-width: 820px;
    margin: 0;
    color: #555555;
}

.kfpl-calculator-body {
    padding: 24px;
    background: var(--kfpl-background);
}

.kfpl-form,
.kfpl-results,
.kfpl-chart-card,
.kfpl-table-card,
.kfpl-comparison-card,
.kfpl-breakdown-card,
.kfpl-legal-card {
    border: 1px solid var(--kfpl-border);
    border-radius: 4px;
    background: var(--kfpl-white);
}

.kfpl-form { padding: 22px; }
.kfpl-results { margin-top: 20px; overflow: hidden; }

.kfpl-fields {
    display: grid;
    gap: 15px;
}

.kfpl-fields-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
.kfpl-field { min-width: 0; }

.kfpl-field label {
    display: block;
    margin: 0 0 6px;
    color: var(--kfpl-heading);
    font-size: 13px;
    font-weight: 700;
}

.kfpl-field input,
.kfpl-field select {
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 9px 11px;
    border: 1px solid var(--kfpl-border-strong);
    border-radius: 3px;
    color: var(--kfpl-text);
    background: var(--kfpl-white);
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.kfpl-field input:focus,
.kfpl-field select:focus {
    border-color: var(--kfpl-green);
    box-shadow: 0 0 0 2px #e3e3e3;
}

.kfpl-field [aria-invalid="true"] {
    border-color: var(--kfpl-black);
    background: var(--kfpl-background-light);
}

.kfpl-input-suffix { position: relative; }
.kfpl-input-suffix input { padding-right: 52px; }
.kfpl-input-suffix span {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    color: var(--kfpl-muted);
    font-size: 12px;
    font-weight: 700;
    pointer-events: none;
}

.kfpl-help {
    display: block;
    margin-top: 5px;
    color: var(--kfpl-muted);
    font-size: 11px;
    line-height: 1.4;
}

.kfpl-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.kfpl-section-spaced {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--kfpl-border);
}

.kfpl-section-heading > span {
    display: grid;
    place-items: center;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    border-radius: 3px;
    color: var(--kfpl-white);
    background: var(--kfpl-green);
    font-size: 13px;
    font-weight: 700;
}

.kfpl-section-heading h3,
.kfpl-card-heading h3 {
    margin: 0 0 2px;
    color: var(--kfpl-heading);
    font-size: 18px;
    line-height: 1.3;
}

.kfpl-section-heading p,
.kfpl-card-heading p {
    margin: 0;
    color: var(--kfpl-muted);
    font-size: 12px;
}

.kfpl-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.kfpl-button,
.kfpl-small-button {
    appearance: none;
    border-radius: 3px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.kfpl-button {
    min-height: 45px;
    padding: 10px 18px;
    border: 1px solid transparent;
    font-size: 14px;
}

.kfpl-button-primary {
    flex: 1 1 220px;
    color: var(--kfpl-white);
    border-color: var(--kfpl-green);
    background: var(--kfpl-green);
}

.kfpl-button-primary:hover,
.kfpl-button-primary:focus {
    color: var(--kfpl-white);
    background: var(--kfpl-green);
    box-shadow: 0 3px 10px #cfcfcf;
}

.kfpl-button-secondary {
    color: var(--kfpl-heading);
    border-color: var(--kfpl-border-strong);
    background: var(--kfpl-white);
}

.kfpl-button-secondary:hover,
.kfpl-button-secondary:focus {
    color: var(--kfpl-green);
    border-color: var(--kfpl-green);
    background: var(--kfpl-white);
}

.kfpl-button:focus-visible,
.kfpl-small-button:focus-visible {
    outline: 2px solid var(--kfpl-green);
    outline-offset: 2px;
}

.kfpl-form-message {
    margin-top: 14px;
    padding: 10px 12px;
    border-left: 3px solid var(--kfpl-green);
    background: var(--kfpl-background-light);
    color: var(--kfpl-heading);
    font-size: 13px;
}

.kfpl-result-highlight {
    padding: 22px;
    color: var(--kfpl-white);
    background: var(--kfpl-green);
}

.kfpl-result-highlight > span {
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.kfpl-result-highlight > strong {
    display: block;
    font-size: clamp(25px, 4vw, 36px);
    line-height: 1.2;
}

.kfpl-result-highlight > small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
}

.kfpl-result-grid {
    display: grid;
    gap: 12px;
    padding: 18px;
}

.kfpl-result-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.kfpl-result-card {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--kfpl-border);
    border-radius: 3px;
    background: var(--kfpl-background-light);
}

.kfpl-result-card span {
    display: block;
    color: var(--kfpl-muted);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.3;
    text-transform: uppercase;
}

.kfpl-result-card strong {
    display: block;
    margin-top: 5px;
    color: var(--kfpl-heading);
    font-size: 19px;
    line-height: 1.25;
}

.kfpl-comparison-card,
.kfpl-chart-card,
.kfpl-table-card,
.kfpl-breakdown-card,
.kfpl-legal-card {
    margin: 0 18px 18px;
    overflow: hidden;
}

.kfpl-card-heading {
    padding: 16px 18px;
    border-bottom: 1px solid var(--kfpl-border);
    background: var(--kfpl-white);
}

.kfpl-card-heading-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.kfpl-strategy-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 16px;
}

.kfpl-strategy {
    padding: 16px;
    border: 1px solid var(--kfpl-border);
    border-radius: 3px;
    background: var(--kfpl-background-light);
}

.kfpl-strategy.is-selected { border-color: var(--kfpl-green); }
.kfpl-strategy > span {
    display: block;
    color: var(--kfpl-muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}
.kfpl-strategy > strong {
    display: block;
    margin: 5px 0 2px;
    color: var(--kfpl-green);
    font-size: 22px;
}
.kfpl-strategy > small { color: var(--kfpl-muted); font-size: 12px; }

.kfpl-chart-wrap {
    position: relative;
    min-height: 260px;
    padding: 12px 14px 4px;
}

.kfpl-chart {
    display: block;
    width: 100%;
    height: 320px;
}

.kfpl-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    padding: 8px 18px 16px;
    color: var(--kfpl-muted);
    font-size: 11px;
}

.kfpl-chart-legend span::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 3px;
    margin-right: 7px;
    vertical-align: middle;
}
.kfpl-legend-green::before { background: var(--kfpl-green); }
.kfpl-legend-gray::before { background: #9a9a9a; }

.kfpl-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kfpl-small-button {
    min-height: 34px;
    padding: 7px 11px;
    border: 1px solid var(--kfpl-border-strong);
    color: var(--kfpl-heading);
    background: var(--kfpl-white);
    font-size: 11px;
}

.kfpl-small-button:hover,
.kfpl-small-button:focus {
    color: var(--kfpl-green);
    border-color: var(--kfpl-green);
}

.kfpl-table-scroll { overflow-x: auto; }
.kfpl-table-card table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    margin: 0;
}
.kfpl-table-card th,
.kfpl-table-card td {
    padding: 11px 13px;
    border-bottom: 1px solid var(--kfpl-border);
    text-align: right;
    font-size: 12px;
}
.kfpl-table-card th:first-child,
.kfpl-table-card td:first-child { text-align: left; }
.kfpl-table-card th {
    color: var(--kfpl-heading);
    background: var(--kfpl-background-light);
    font-weight: 700;
}
.kfpl-table-card tbody tr:last-child td { border-bottom: 0; }

.kfpl-breakdown-list { padding: 4px 18px; }
.kfpl-breakdown-list > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid var(--kfpl-border);
}
.kfpl-breakdown-list > div:last-child { border-bottom: 0; }
.kfpl-breakdown-list span { color: var(--kfpl-muted); font-size: 13px; }
.kfpl-breakdown-list strong { color: var(--kfpl-heading); font-size: 15px; }

.kfpl-legal-message {
    padding: 16px 18px;
    color: var(--kfpl-text);
    font-size: 13px;
}
.kfpl-legal-message p { margin: 0 0 10px; }
.kfpl-legal-message p:last-child { margin-bottom: 0; }
.kfpl-legal-message strong { color: var(--kfpl-green); }
.kfpl-legal-card > .kfpl-inline-actions { padding: 0 18px 18px; }

.kfpl-calculator-footer {
    padding: 15px 22px;
    border-top: 1px solid var(--kfpl-border);
    background: var(--kfpl-white);
}
.kfpl-calculator-footer p {
    margin: 0;
    color: var(--kfpl-muted);
    font-size: 11px;
}

.kfpl-calculator [hidden] { display: none !important; }

@media (max-width: 760px) {
    .kfpl-calculator { margin: 20px 0; }
    .kfpl-calculator-header { padding: 22px 18px 18px; }
    .kfpl-calculator-body { padding: 14px; }
    .kfpl-form { padding: 16px; }
    .kfpl-fields-2,
    .kfpl-result-grid-3,
    .kfpl-strategy-grid { grid-template-columns: 1fr !important; }
    .kfpl-card-heading-actions { align-items: flex-start; flex-direction: column; }
    .kfpl-comparison-card,
    .kfpl-chart-card,
    .kfpl-table-card,
    .kfpl-breakdown-card,
    .kfpl-legal-card { margin: 0 12px 12px; }
    .kfpl-result-grid { padding: 12px; }
    .kfpl-chart { height: 260px; }
}

@media print {
    body * { visibility: hidden !important; }
    .kfpl-calculator.kfpl-printing,
    .kfpl-calculator.kfpl-printing * { visibility: visible !important; }
    .kfpl-calculator.kfpl-printing {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
    }
    .kfpl-calculator.kfpl-printing .kfpl-form,
    .kfpl-calculator.kfpl-printing .kfpl-actions,
    .kfpl-calculator.kfpl-printing .kfpl-inline-actions { display: none !important; }
    .kfpl-calculator.kfpl-printing .kfpl-results { display: block !important; }
    .kfpl-calculator.kfpl-printing .kfpl-calculator-body { background: var(--kfpl-white); }
}
