/**
 * Kultiva — leasing page. Boards: "Leasing" (desktop), "Tablet — Leasing",
 * "Mobile — Leasing" and its Armenian copy. From 992 px the calculator is a
 * white card on the Night band; below it, the steps follow the page head.
 */

/* ============================================
   PAGE HEAD AND KEY FIGURES
   ============================================ */

.k-ltop__inner {
    display: flex;
    flex-direction: column;
}

.k-lhead {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 calc(-1 * var(--k-gutter));
    padding: 0 var(--k-gutter) 20px;
    background: var(--k-surface-2);
}

.k-lhead .k-crumbs ol {
    padding-top: 16px;
}

/* Sizes, line heights and stretch come from the h1/h2 tokens in base.css */
.k-lhead h1 {
    margin: 0;
    color: var(--k-text-max);
}

.k-lhead__lead {
    margin: 0;
    color: var(--k-text);
    font-size: 15px;
    line-height: 1.5;
}

.k-lfacts {
    display: none;
}


/* ============================================
   CALCULATOR
   ============================================ */

.k-calc {
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 20px 0 28px;
}

.k-calc__head {
    display: none;
}

.k-step {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.k-step__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.k-step__title {
    float: none;
    width: auto;
    margin: 0 0 2px;
    padding: 0;
    color: var(--k-text-max);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.3;
}

.k-step__count {
    color: var(--k-text-muted);
    font-size: 14px;
}

.k-step__note {
    margin: 0;
    color: var(--k-text-muted);
    font-size: 14px;
    line-height: 1.45;
}

/* 1 · Your machines */
.k-machines {
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--k-line);
    list-style: none;
}

.k-machine {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    grid-template-areas:
        "photo text remove"
        "photo price remove";
    align-items: center;
    column-gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--k-line);
}

.k-machine__photo {
    grid-area: photo;
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    padding: 4px;
    border-radius: var(--k-radius-control);
    background: var(--k-surface-2);
    color: var(--k-text-muted);
    font-size: 22px;
    isolation: isolate;
}

.k-machine__photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.k-machine__text {
    grid-area: text;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.k-machine__name {
    color: var(--k-text-max);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
    .k-machine__name:hover {
        color: var(--k-text-green);
        text-decoration: underline;
    }
}

.k-machine__kind {
    color: var(--k-text-muted);
    font-size: 14px;
}

.k-machine__price {
    grid-area: price;
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.k-machine__remove-form {
    grid-area: remove;
    margin: 0;
}

.k-machine__remove {
    display: grid;
    place-items: center;
    width: 44px;
    height: var(--k-control);
    border: 1px solid var(--k-line);
    border-radius: var(--k-radius-control);
    background: var(--k-surface);
    color: var(--k-text);
    font-size: 17px;
    transition: background-color var(--k-fast) ease-out, border-color var(--k-fast) ease-out,
        transform var(--k-fast) var(--k-ease-out);
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
    .k-machine__remove:hover {
        border-color: var(--k-danger);
        color: var(--k-danger);
    }
}

.k-machine__remove:active {
    border-color: var(--k-danger);
    background: var(--k-danger-bg);
    color: var(--k-danger);
}

@media (prefers-reduced-motion: no-preference) {
    .k-machine__remove:active,
    .k-undo__button:active {
        transform: scale(0.97);
    }
}

.k-machines__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.k-machines__foot .k-btn {
    min-height: var(--k-control);
}

.k-machines__total {
    margin-left: auto;
    font-size: 16px;
    font-weight: 700;
}

.k-machines__total strong {
    margin-left: 6px;
    color: var(--k-text-max);
    font-size: 20px;
    font-weight: 800;
    font-stretch: 88%;
    font-variant-numeric: tabular-nums;
}

/* Removed at once; Undo stays 6 seconds, longer while focused or hovered (Bootstrap toast) */
.k-undo.toast {
    display: none;
    width: 100%;
    max-width: none;
    border: 0;
    border-radius: var(--k-radius-button);
    background: var(--k-band);
    color: var(--k-white);
    box-shadow: none;
    font-size: 15px;
}

.k-undo.toast.show,
.k-undo.toast.showing {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 0 6px 0 16px;
}

.k-undo form {
    margin: 0;
}

.k-undo__button {
    min-height: var(--k-control);
    padding: 0 14px;
    border: 0;
    border-radius: var(--k-radius-nav);
    background: transparent;
    color: var(--k-harvest);
    font-size: 15px;
    font-weight: 800;
    transition: background-color var(--k-fast) ease-out, transform var(--k-fast) var(--k-ease-out);
    -webkit-tap-highlight-color: transparent;
}

.k-undo__button:active {
    background: var(--k-fill-ink);
}

@media (hover: hover) and (pointer: fine) {
    .k-undo__button:hover {
        background: var(--k-fill-ink);
    }
}

.k-lempty {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 18px;
    border: 1.5px dashed #9FAA98;
    border-radius: var(--k-radius-card);
    background: var(--k-surface-2);
}

.k-lempty p {
    flex: 1 1 260px;
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

.k-lempty strong {
    display: block;
    color: var(--k-text-max);
    font-size: 18px;
}

.k-lempty form {
    margin: 0;
}

/* 2–4 · Down payment, term, rate */
.k-lform {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.k-lform__row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 22px 18px;
}

.k-choices.k-lchips {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.k-lchips .k-choice {
    gap: 4px;
    min-height: var(--k-control);
    font-variant-numeric: tabular-nums;
}

.k-lrate {
    display: inline-flex;
    flex-direction: column;
    align-self: flex-start;
    gap: 2px;
    margin: 0;
    color: var(--k-text-max);
}

.k-lrate span {
    color: var(--k-text-muted);
    font-size: 14px;
}

.k-lform .k-nojs {
    align-self: flex-start;
}

/* The result */
.k-result {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
    border-radius: var(--k-radius-dialog);
    background: var(--k-surface-2);
}

.k-result__label {
    margin: 0;
    color: var(--k-text-muted);
    font-size: 14px;
}

.k-result__main {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    margin: 0;
}

.k-result__amount {
    color: var(--k-text-max);
    font-size: 44px;
    font-weight: 800;
    font-stretch: 85%;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.k-result__per {
    color: var(--k-text-muted);
    font-size: 15px;
}

.k-result__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding-top: 14px;
    border-top: 1px solid var(--k-line);
    font-size: 14px;
}

.k-result__grid dt {
    color: var(--k-text-muted);
    font-weight: 400;
}

.k-result__grid dd {
    margin: 0;
    color: var(--k-text-strong);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Where the money goes: a thin bar over the list, which names each part and gives its amount; a dot before
   each name ties the two together, so colour only repeats the words. The three colours are steps of the
   brand's navy, green and harvest that stay apart for colour-blind readers (checked with a validator; the
   pure Ink and Harvest tokens fail it). The harvest step is light against the card, which is why the bar
   never stands without the list. static/js/leasing.js moves the parts when a choice changes; a choice made
   from the keyboard moves them at once. */
.k-result {
    --k-part-down: #3B5BA5;
    --k-part-financed: var(--k-green);
    --k-part-interest: #C4930A;
}

.k-split {
    display: block;
    overflow: hidden;
    border-radius: var(--k-radius-badge);
}

.k-split rect {
    transition: x var(--k-base) var(--k-ease-out), width var(--k-base) var(--k-ease-out);
}

.k-split.is-instant rect {
    transition: none;
}

.k-split__down {
    fill: var(--k-part-down);
}

.k-split__financed {
    fill: var(--k-part-financed);
}

.k-split__interest {
    fill: var(--k-part-interest);
}

/* Two pixels of the card between the parts */
.k-split__gap {
    fill: var(--k-surface-2);
    transform: translateX(-1px);
}

.k-result__part dt::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border-radius: 2px;
}

.k-result__part--down dt::before {
    background: var(--k-part-down);
}

.k-result__part--financed dt::before {
    background: var(--k-part-financed);
}

.k-result__part--interest dt::before {
    background: var(--k-part-interest);
}

.k-result__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
}

.k-result__actions > .k-btn,
.k-result__chat {
    flex: 1 1 240px;
}

.k-result__actions .k-btn {
    min-height: var(--k-control-lg);
}

.k-lpdf {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 8px;
    min-height: var(--k-control);
    margin-top: -10px;
    color: var(--k-text-strong);
    font-weight: 700;
}

.k-lnotice {
    display: flex;
    gap: 12px;
    padding: 18px;
    border-radius: var(--k-radius-card);
    background: var(--k-warning-bg);
    color: var(--k-warning);
    font-size: 16px;
    line-height: 1.5;
}

.k-lnotice .bi {
    font-size: 20px;
    line-height: 1.3;
}

.k-lnotice p {
    margin: 0;
}

.k-lfine {
    margin: 0;
    color: var(--k-text-muted);
    font-size: 13px;
    line-height: 1.5;
}

/* Phones: no text under 14 px (brief, answer 1; QA-014) */
@media (max-width: 767.98px) {
    .k-lfine {
        font-size: 14px;
    }
}

.k-lfine a {
    color: var(--k-text-strong);
    font-weight: 700;
}


/* ============================================
   A SPECIALIST
   ============================================ */

.k-lhelp {
    padding: var(--k-section-y) 0;
    background: var(--k-surface-2);
}

.k-lhelp__inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.k-lhelp h2 {
    margin: 0 0 6px;
    color: var(--k-text-max);
}

.k-lhelp__text p,
.k-lhelp__contact p {
    margin: 0;
    color: var(--k-text);
}

.k-lhelp__contact {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}


/* ============================================
   PHONE AND TABLET SUMMARY BAR
   Without JavaScript it stays; with it, it shows while the result card is off screen.
   ============================================ */

.k-lbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px max(10px, env(safe-area-inset-bottom)) 16px;
    background: var(--k-surface);
    box-shadow: var(--k-shadow-bar);
    transition: transform var(--k-base) var(--k-ease), visibility 0s linear 0s;
}

.js .k-lbar:not(.is-shown) {
    transform: translateY(110%);
    visibility: hidden;
    transition: transform var(--k-base) var(--k-ease), visibility 0s linear var(--k-base);
}

.k-lbar__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin: 0;
    color: var(--k-text);
    font-size: 14px;
    line-height: 1.35;
}

.k-lbar__text strong {
    white-space: nowrap;
    color: var(--k-text-max);
    font-size: 17px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.k-lbar .k-btn {
    flex: 0 0 auto;
    padding-inline: 14px;
}

body:has(.k-lbar) {
    padding-bottom: 76px;
}

@media (prefers-reduced-motion: reduce) {
    .k-lbar,
    .js .k-lbar:not(.is-shown) {
        transition: none;
    }
}


/* ============================================
   768 PX AND UP
   ============================================ */

@media (min-width: 768px) {
    .k-lhead__lead {
        font-size: 17px;
    }

    .k-machine {
        grid-template-columns: 56px minmax(0, 1fr) auto auto;
        grid-template-areas: "photo text price remove";
        column-gap: 14px;
    }

    .k-machine__price {
        font-size: 16px;
    }

    .k-result {
        padding: 22px;
    }

    .k-result__amount {
        font-size: 56px;
    }


    .k-lhelp__inner {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 20px 48px;
    }

    .k-lhelp__text {
        flex: 1 1 420px;
    }
}


/* ============================================
   992 PX AND UP: THE CALCULATOR CARD ON THE NIGHT BAND
   ============================================ */

@media (min-width: 992px) {
    .k-ltop {
        position: relative;
        overflow: hidden;
        background: var(--k-band);
        color: var(--k-on-night);
    }

    .k-ltop::before {
        content: "";
        position: absolute;
        inset: 0;
        background-image: repeating-linear-gradient(100deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 22px);
        pointer-events: none;
    }

    .k-ltop__inner {
        position: relative;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 48px;
        padding-top: clamp(40px, 5vw, 80px);
        padding-bottom: clamp(40px, 5vw, 80px);
    }

    .k-lhead {
        flex: 1 1 440px;
        gap: 22px;
        min-width: 0;
        margin: 0;
        padding: 12px 0 0;
        background: none;
    }

    .k-lhead .k-crumbs ol {
        padding-top: 0;
        color: var(--k-on-night-muted);
    }

    .k-lhead .k-crumbs a {
        color: var(--k-on-night-2);
    }

    .k-lhead .k-crumbs [aria-current] {
        color: var(--k-on-night);
    }

    .k-lhead h1 {
        color: var(--k-on-night);
        overflow-wrap: break-word;
    }

    /* Armenian runs about a quarter longer, and "գյուղատնտեսական" is one word */
    html[lang="hy"] .k-lhead h1 {
        font-size: clamp(36px, 3.4vw, 54px);
        line-height: 1.04;
    }

    .k-lhead__lead {
        max-width: 540px;
        color: var(--k-on-night-2);
        font-size: 20px;
        line-height: 1.55;
    }

    .k-lfacts {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        margin: 8px 0 0;
    }

    .k-lfacts div {
        padding: 16px;
        border: 1px solid var(--k-on-night-edge);
        border-radius: var(--k-radius-card);
        background: rgba(255, 255, 255, 0.06);
    }

    .k-lfacts dt {
        color: var(--k-on-night-2);
        font-size: 13px;
        font-weight: 400;
    }

    .k-lfacts dd {
        margin: 4px 0 0;
        font-size: 28px;
        font-weight: 800;
        font-stretch: 85%;
    }

    .k-lfacts__gold {
        color: var(--k-harvest);
    }

    .k-calc {
        flex: 1 1 520px;
        min-width: 0;
        padding: 28px;
        border-radius: var(--k-radius-panel);
        background: var(--k-surface);
        color: var(--k-text-strong);
        box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
    }

    .k-calc__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .k-calc__head h2 {
        margin: 0;
        color: var(--k-text-max);
        font-size: 24px;
        font-weight: 800;
        font-stretch: 88%;
    }

    .k-calc__tag {
        color: var(--k-text-muted);
        font-family: var(--k-mono);
        font-size: 12px;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .k-step__title {
        color: var(--k-text-muted);
        font-family: var(--k-mono);
        font-size: 12px;
        font-weight: 500;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .k-lbar {
        display: none;
    }

    body:has(.k-lbar) {
        padding-bottom: 0;
    }
}


/* Wide screens: four figures in a row, as on the board */
@media (min-width: 1400px) {
    .k-result__grid,
    .k-lfacts {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Armenian labels: no capitals and no letter-spacing (design brief, answer 2) */
:lang(hy) .k-calc__tag,
:lang(hy) .k-step__title {
    text-transform: none;
    letter-spacing: 0;
}

/* ============================================
   LEASING CONDITIONS (includes/leasing_terms.html; 2026-11-02)
   ============================================ */

.k-lterms {
    padding: var(--k-section-y) 0;
    border-top: 1px solid var(--k-line);
}

.k-lterms__title {
    margin: 0 0 12px;
    color: var(--k-text-max);
}

@media (min-width: 768px) {
    .k-lterms__title {
        margin-bottom: 28px;
    }
}

.k-lterms__list {
    max-width: 68ch;
    margin: 0;
    padding-left: 1.2em;
    line-height: 1.55;
    color: var(--k-text);
}

.k-lterms__list li + li {
    margin-top: 6px;
}
