/* Kalkulator awansow rang (dokumenty/zakupy.php) - tylko to, czego nie ma w site.css */

/* ---------- Naglowek strony ---------- */
.zk-hero .promo-line {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    max-width: 100%;
    margin-top: 24px;
    padding: 6px 16px 6px 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(var(--ok-rgb), 0.12), rgba(var(--accent-rgb), 0.07));
    border: 1px solid rgba(var(--ok-rgb), 0.26);
    font-size: 13.5px;
    line-height: 1.4;
    color: var(--text);
}

.zk-hero .promo-line .badge {
    flex: none;
    padding: 4px 10px;
    font-size: 10.5px;
    background: var(--ok);
    border-color: transparent;
    color: #04140e;
}

.zk-hero .h1 {
    margin-top: 20px;
}

/* ---------- Uklad: cennik + kalkulatory ---------- */
.zk-layout {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 24px;
    align-items: start;
    padding-bottom: clamp(48px, 7vw, 96px);
}

/* Prawa kolumna: kalkulatory + kontakt; rozciaga sie na wysokosc cennika */
.zk-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-self: stretch;
    min-width: 0;
}

.zk-calcs {
    display: grid;
    gap: 20px;
}

/* Kalkulatory zostaja w widoku przy przewijaniu cennika (tylko gdy sie mieszcza),
   a kontakt laduje na dole kolumny, rowno z koncem cennika.
   Oba kalkulatory z wynikami (2-liniowy wynik kwoty) + odstep od naglowka = ok. 873px,
   wiec prog wysokosci ma zapas. */
@media (min-width: 1081px) and (min-height: 900px) {
    .zk-sticky-area {
        flex: 1 0 auto;
    }

    .zk-calcs {
        position: sticky;
        top: calc(var(--header-h) + 20px);
    }
}

/* ---------- Cennik ---------- */
.zk-table th:last-child,
.zk-table td:last-child {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.zk-table tbody {
    counter-reset: rank;
}

.zk-table tbody td {
    padding-block: 12px;
    transition: background-color .2s, box-shadow .2s;
}

.zk-table tbody td:first-child {
    color: var(--text);
    font-weight: 500;
}

.zk-table tbody td:first-child::before {
    counter-increment: rank;
    content: counter(rank, decimal-leading-zero);
    display: inline-block;
    min-width: 2.4em;
    margin-right: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 400;
    color: var(--text-3);
}

.zk-table tbody td:last-child {
    color: var(--accent-hi);
    font-weight: 600;
}

/* Najwyzsza ranga */
.zk-table tbody tr:last-child td:first-child {
    color: var(--gold);
}

/* Rangi wybrane w kalkulatorze awansu (js/pages/zakupy.js) */
.zk-table tbody tr.is-range td {
    background: rgba(var(--accent-rgb), 0.035);
}

.zk-table tbody tr.is-current td {
    background: rgba(var(--accent-rgb), 0.1);
}

.zk-table tbody tr.is-current td:first-child {
    box-shadow: inset 3px 0 0 var(--accent);
}

.zk-table tbody tr.is-target td {
    background: rgba(var(--ok-rgb), 0.1);
}

.zk-table tbody tr.is-target td:first-child {
    box-shadow: inset 3px 0 0 var(--ok);
}

.zk-table tbody tr.is-target td:last-child {
    color: var(--ok);
}

/* ---------- Kalkulatory ---------- */
.zk-calc {
    --pad: clamp(20px, 2.4vw, 28px);
    overflow: hidden;
    isolation: isolate;
}

.zk-calc::before {
    content: "";
    position: absolute;
    top: -120px;
    right: -120px;
    z-index: -1;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(var(--c-rgb, var(--accent-rgb)), 0.14), transparent);
    pointer-events: none;
}

.zk-calc-head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.zk-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
    align-items: end;
}

.zk-submit .btn {
    --btn-h: 46px;
    width: 100%;
}

/* Pole kwoty z dopiskiem PLN */
.zk-affix {
    position: relative;
}

.zk-affix .input {
    padding-right: 54px;
    -moz-appearance: textfield;
    appearance: textfield;
}

.zk-affix .input::-webkit-outer-spin-button,
.zk-affix .input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.zk-affix span {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-3);
    pointer-events: none;
}

/* Wynik */
.result {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(var(--accent-rgb), 0.06);
    border: 1px solid rgba(var(--accent-rgb), 0.22);
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--text-2);
}

.result:empty {
    display: none;
}

.result:has(.tone-ok) {
    background: rgba(var(--ok-rgb), 0.07);
    border-color: rgba(var(--ok-rgb), 0.3);
}

.result:has(.tone-bad) {
    background: rgba(var(--bad-rgb), 0.07);
    border-color: rgba(var(--bad-rgb), 0.3);
}

.result span:not(.res-ico) {
    color: var(--text);
    font-weight: 700;
}

.res-ico {
    display: inline-flex;
    vertical-align: -0.22em;
    color: rgb(var(--c-rgb, var(--accent-rgb)));
}

.res-ico .i {
    width: 18px;
    height: 18px;
}

.result.is-fresh {
    animation: zk-result-in .35s var(--ease);
}

@keyframes zk-result-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
}

/* ---------- Kontakt / sklep ---------- */
.zk-info {
    --gap: 16px;
}

.zk-info .callout {
    align-items: center;
    padding: 18px 20px;
    font-size: 14.5px;
}

.zk-info .link {
    font-weight: 600;
}

/* ---------- Responsywnosc ---------- */
@media (max-width: 1080px) {
    .zk-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .zk-calcs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .zk-calc .zk-fields {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .zk-calcs {
        grid-template-columns: minmax(0, 1fr);
    }

    .zk-calc .zk-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .zk-calc .zk-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .zk-hero .promo-line {
        align-items: flex-start;
        border-radius: 16px;
        padding: 8px 14px 8px 8px;
    }

    .zk-hero .cluster .btn {
        flex: 1 1 100%;
    }

    .zk-table th,
    .zk-table td {
        padding: 11px 14px;
    }
}
