@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body.kl-no-scroll { overflow: hidden; }

/* ══ Base ══ */
.kl-wrap {
    --kl-white:   #ffffff;
    --kl-border:  #dde3ef;
    --kl-primary: #1a3a6b;
    --kl-blue-bg: #eaf0fb;
    --kl-blue:    #3a6fd8;
    --kl-blue-lt: #cddaf7;
    --kl-red:     #c0392b;
    --kl-red-dk:  #a93226;
    --kl-text:    #1a2340;
    --kl-muted:   #7a8499;
    --kl-muted2:  #b0b8cc;
    --kl-font:    'Inter', system-ui, sans-serif;
    font-family:  var(--kl-font);
    color:        var(--kl-text);
}
.kl-wrap *, .kl-wrap *::before, .kl-wrap *::after { box-sizing: border-box; }
.kl-wrap { max-width: 780px; margin: 0 auto; padding: 16px; }

/* ══ Card ══ */
.kl-calculator {
    background: #fff;
    border: 0px solid #dde3ef;
    border-radius: 15px;
    padding: 18px 38px 18px 38px;
    /*box-shadow: 0 4px 32px rgba(30,60,120,0.10);*/
    overflow: visible; /* let slider thumb breathe but contained by section padding */
}
@media(max-width:600px){ .kl-calculator { padding: 24px 18px; } }

/* ══ Header ══ */
.kl-header { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #dde3ef; }
.kl-tag { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: #3a6fd8; background: #eaf0fb; border-radius: 100px; padding: 4px 14px; margin-bottom: 12px; }
.kl-title { font-size: clamp(24px,4vw,34px); font-weight: 700; line-height: 1.15; color: #1a3a6b; margin: 0 0 6px; }
.kl-title em { font-style: normal; color: #c0392b; }
.kl-subtitle { font-size: 14px; color: #7a8499; margin: 0; }

/* ══ Section ══ */
.kl-section {
    margin-bottom: 18px;
    position: relative;
    /* guarantee slider thumb stays inside card visually */
}
.kl-label { display: block; font-size: 11px; font-weight: 600; color: #7a8499; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 10px; }
.kl-input-hint { font-size: 11px; color: #b0b8cc; margin-top: 5px; }

/* ══ Money input ══ */
.kl-input-money-row {
    display: flex; align-items: stretch;
    border: 1.5px solid #dde3ef; border-radius: 10px; overflow: hidden;
    max-width: 300px; transition: border-color 0.15s, box-shadow 0.15s;
}
.kl-input-money-row:focus-within { border-color: #7a9fd4; box-shadow: 0 0 0 3px rgba(122,159,212,0.15); }
.kl-money-input {
    flex: 1; border: none; outline: none;
    font-family: var(--kl-font); font-size: 20px; font-weight: 700; color: #1a3a6b;
    padding: 12px 16px; background: transparent;
    -moz-appearance: textfield; min-width: 0;
}
.kl-money-input::-webkit-inner-spin-button,
.kl-money-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.kl-money-unit {
    font-size: 13px; font-weight: 600; color: #7a8499; background: #eaf0fb;
    padding: 12px 14px; border-left: 1.5px solid #dde3ef;
    display: flex; align-items: center; white-space: nowrap;
}

/* ══ Cena box (ogłoszenie) ══ */
.kl-cena-box { background: #eaf0fb; border: 1.5px solid #cddaf7; border-radius: 10px; padding: 14px 20px; display: inline-block; min-width: 240px; }
.kl-cena-netto { font-size: 26px; font-weight: 700; color: #1a3a6b; line-height: 1.1; }
.kl-cena-curr  { font-size: 14px; font-weight: 500; color: #7a8499; }
.kl-cena-brutto { font-size: 12px; color: #7a8499; margin-top: 4px; }
.kl-cena-hint { font-size: 12px; color: #c0392b; margin-top: 6px; }

/* ══ Okres buttons ══ */
.kl-okres-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.kl-okres-btn {
    background: #eaf0fb; border: 1.5px solid #cddaf7; border-radius: 8px;
    color: #3a6fd8; font-family: var(--kl-font); font-size: 14px; font-weight: 600;
    padding: 10px 22px; cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.kl-okres-btn:hover   { background: #d5e4f7; border-color: #3a6fd8; }
.kl-okres-btn.kl-active { background: #3a6fd8; border-color: #3a6fd8; color: #fff; box-shadow: 0 2px 10px rgba(58,111,216,0.3); }

/* ══ Slider row ══ */
.kl-slider-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.kl-pct-box {
    display: flex; align-items: center; gap: 3px;
    background: #eaf0fb; border: 1.5px solid #cddaf7; border-radius: 10px;
    padding: 4px 12px 4px 12px; flex-shrink: 0; min-width: 72px; justify-content: flex-end;
}
.kl-pct-val  { font-size: 17px; font-weight: 700; color: #3a6fd8; }
.kl-unit     { font-size: 13px; font-weight: 500; color: #7a8499; margin-left: 2px; }
.kl-kwota-inline { font-size: 15px; font-weight: 600; color: #1a3a6b; white-space: nowrap; }

/* ══ Slider track ══
   thumb is 22px wide; track has 11px horizontal padding so thumb
   never visually overflows the containing section.
══ */
.kl-slider-track {
    position: relative;
    height: 6px;
    background: #cddaf7;
    border-radius: 99px;
    cursor: pointer;
    user-select: none;
    /* horizontal padding so thumb at 0% and 100% stays inside */
    margin: 0 11px;
}
.kl-fill {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    background: linear-gradient(90deg, #3a6fd8, #5a9ff5);
    border-radius: 99px;
    pointer-events: none;
    width: 0%;
}
.kl-thumb {
    position: absolute;
    top: 50%;
    left: -11px;           /* starts at left edge, JS uses calc(p% - 11px) */
    transform: translateY(-50%);
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #3a6fd8;
    box-shadow: 0 2px 10px rgba(58,111,216,0.30);
    cursor: grab;
    z-index: 3;
    pointer-events: all;
    transition: box-shadow 0.12s;
}
.kl-thumb:hover   { box-shadow: 0 2px 18px rgba(58,111,216,0.45); }
.kl-thumb:active  { cursor: grabbing; box-shadow: 0 2px 20px rgba(58,111,216,0.55); }

.kl-range-labels { display: flex; justify-content: space-between; font-size: 10px; color: #b0b8cc; margin-top: 8px; }

/* ══ Result bar ══ */
.kl-result {
    background: #eaf0fb; border: 1.5px solid #dde3ef; border-radius: 16px;
    padding: 22px 28px; display: flex; align-items: center; gap: 20px;
    flex-wrap: wrap; margin-bottom: 22px;
}
.kl-result-left  { flex-shrink: 0; }
.kl-result-okres { font-size: 13px; color: #7a8499; line-height: 1.5; }
.kl-result-okres strong { font-size: 16px; color: #1a3a6b; display: block; }
.kl-result-mid   { display: flex; gap: 24px; flex: 1; flex-wrap: wrap; }
.kl-result-item  { display: flex; flex-direction: column; gap: 3px; }
.kl-result-item span   { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: #7a8499; }
.kl-result-item strong { font-size: 15px; font-weight: 600; color: #1a2340; }
.kl-result-right { flex-shrink: 0; text-align: right; margin-left: auto; }
.kl-result-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: #7a8499; margin-bottom: 4px; }
.kl-result-value { font-size: clamp(24px,4vw,36px); font-weight: 700; color: #1a3a6b; line-height: 1; letter-spacing: -0.5px; min-width: 200px; text-align: right; white-space: nowrap; }
.kl-result-brutto { font-size: 12px; color: #7a8499; margin-top: 5px; text-align: right; }
.kl-result-brutto span { font-weight: 600; color: #1a3a6b; }

/* ══ Ogłoszenie result – vertical centred ══ */
.kl-result-ogl { display: block; padding: 10px 20px 10px 20px; }
.kl-result-ogl-item { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 0px; }
.kl-roi-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: #7a8499; margin-bottom: 4px; }
.kl-roi-val   { font-size: 26px; font-weight: 600; color: #1a3a6b; }
.kl-roi-brutto { display: block; font-size: 12px; color: #7a8499; margin-top: 3px; font-style: normal; }
.kl-roi-brutto span { font-weight: 600; color: #1a3a6b; }

/* ══ Button row ══ */
.kl-btn-row { display: flex; justify-content: center; margin-top: 8px; }
.kl-btn-lead {
    display: inline-flex; align-items: center; gap: 10px;
    background: #c0392b; color: #fff;
    font-family: var(--kl-font); font-size: 16px; font-weight: 600;
    border: none; border-radius: 10px; padding: 16px 40px;
    cursor: pointer; white-space: nowrap; letter-spacing: 0.2px;
    box-shadow: 0 4px 16px rgba(192,57,43,0.28);
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
    text-decoration: none;
}
.kl-btn-lead:hover { background: #a93226; transform: translateY(-2px); box-shadow: 0 6px 24px rgba(192,57,43,0.38); color: #fff; }
.kl-btn-lead span  { transition: transform 0.2s; display: inline-block; }
.kl-btn-lead:hover span { transform: translateX(4px); }

/* ══ Popup overlay – NO display rule here; JS sets it ══ */
.kl-lead-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20,35,70,0.60);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 999999;
    /* display controlled ONLY by JS */
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.kl-lead-modal {
    background: #fff; border: 1px solid #dde3ef; border-radius: 16px;
    padding: 40px; max-width: 540px; width: 100%; position: relative;
    box-shadow: 0 8px 48px rgba(30,60,120,0.18);
    max-height: 92vh; overflow-y: auto;
    animation: kl-slide-up 0.25s ease;
}
@keyframes kl-slide-up { from{transform:translateY(24px);opacity:0} to{transform:translateY(0);opacity:1} }

.kl-modal-close {
    position: absolute; top: 14px; right: 14px;
    background: #eaf0fb; border: 1px solid #dde3ef;
    color: #7a8499; font-size: 20px; width: 36px; height: 36px;
    border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-family: var(--kl-font); line-height: 1; z-index: 10; padding: 0;
}
.kl-modal-close:hover { background: #fde8e6; color: #c0392b; border-color: #c0392b; }
.kl-modal-header { margin-bottom: 18px; padding-right: 32px; }
.kl-modal-header h3 { font-size: 22px; font-weight: 700; color: #1a3a6b; margin: 0 0 4px; }
.kl-modal-header p  { font-size: 14px; color: #7a8499; margin: 0; }
.kl-modal-summary {
    background: #eaf0fb; border: 1px solid #dde3ef; border-left: 4px solid #3a6fd8;
    border-radius: 10px; padding: 11px 15px; margin-bottom: 20px;
    font-size: 13px; color: #1a2340; line-height: 1.75;
}
.kl-modal-summary strong { color: #1a3a6b; }
.kl-form-group { margin-bottom: 13px; }
.kl-form-group label { display: block; font-size: 13px; font-weight: 500; color: #1a2340; margin-bottom: 5px; }
.kl-nip-label { display: block; font-size: 13px; font-weight: 600; color: #1a2340; margin: 6px 0 7px; }
.kl-form-group input {
    width: 100%; background: #fff; border: 1.5px solid #dde3ef;
    border-radius: 10px; padding: 11px 14px;
    font-family: var(--kl-font); font-size: 14px; color: #1a2340;
    outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.kl-form-group input::placeholder { color: #b0b8cc; }
.kl-form-group input:focus { border-color: #7a9fd4; box-shadow: 0 0 0 3px rgba(122,159,212,0.15); }
.kl-rodo-row { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0 18px; }
.kl-rodo-row input[type="checkbox"] { width: 17px; height: 17px; min-width: 17px; margin-top: 2px; cursor: pointer; accent-color: #c0392b; padding: 0; flex-shrink: 0; }
.kl-rodo-text { font-size: 12px; color: #7a8499; line-height: 1.6; cursor: pointer; }
.kl-rodo-text a { color: #c0392b; text-decoration: none; }
.kl-rodo-text a:hover { text-decoration: underline; }
.kl-btn-submit {
    width: 100%; background: #c0392b; color: #fff;
    font-family: var(--kl-font); font-size: 15px; font-weight: 600;
    border: none; border-radius: 10px; padding: 15px; cursor: pointer;
    box-shadow: 0 4px 14px rgba(192,57,43,0.25);
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.kl-btn-submit:hover { background: #a93226; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(192,57,43,0.35); }
.kl-btn-submit:disabled { opacity: 0.6; cursor: wait; transform: none; box-shadow: none; }
.kl-form-msg { margin-top: 10px; font-size: 13px; color: #c0392b; min-height: 18px; text-align: center; }
.kl-form-body {}
.kl-success-body { text-align: center; padding: 16px 0; }
.kl-success-icon { width: 60px; height: 60px; border-radius: 50%; background: #c0392b; color: #fff; font-size: 26px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; box-shadow: 0 4px 20px rgba(192,57,43,0.3); }
.kl-success-body h3 { font-size: 24px; font-weight: 700; color: #1a3a6b; margin: 0 0 8px; }
.kl-success-body p  { font-size: 14px; color: #7a8499; margin: 0 0 24px; line-height: 1.6; }

@keyframes kl-pulse { 0%{opacity:1} 50%{opacity:0.3} 100%{opacity:1} }
.kl-updating { animation: kl-pulse 0.35s ease; }
