/* Program landings (Команда, РО, CTO, COO, академии, Transition): phones and tablets only.
   Every rule is inside a max-width media query — the desktop layout (wider than 1024px) does not change.
   Pairs with assets/mainpage/js/lands-mobile.js (the "Подробнее о формате" toggle, the form loading text,
   hiding the run line on the registration blocks). */

/* the buttons added into the format cards by lands-mobile.js: only on a phone (see below) */
.lm-fmt-act{ display: none; }

/* ---------- tablet + phone (up to 1024px) ---------- */
@media (max-width: 1024px) {

    /* the fixed header: without breadcrumbs (they stay at the top of the page) */
    .tm-header.sh-fixed .tm-crumbs{ display: none; }

    /* "Стандартный / Продвинутый" and other small switches: a finger-sized target */
    .tm-fmt__switch button{ min-height: 44px; }

    /* payment window: first the payment options (частями / полная, amount), then the form or the card payment */
    .paymodal__side{ order: -1; }
    .paymodal__form.lm-loading{ position: relative; min-height: 220px; }
    .paymodal__form.lm-loading::before{
        content: "ЗАГРУЖАЕМ ФОРМУ";
        position: absolute;
        top: 90px;
        left: 0;
        right: 0;
        text-align: center;
        color: var(--color-text-dim, #8B9197);
        font-size: 12px;
        letter-spacing: 1.2px;
    }
    .paymodal__form.lm-loading::after{
        content: "";
        position: absolute;
        top: 92px;
        left: calc(50% + 72px);
        width: 8px;
        height: 14px;
        background: var(--color-yellow, #F7B500);
        animation: lm-blink 1s steps(1) infinite;
    }

    /* the run line hides while a registration block is on the screen; the support button goes down with it */
    #pb-hybrid{ transition: transform .25s ease, visibility .25s; }
    html.lm-pb-off #pb-hybrid{ transform: translateY(100%); visibility: hidden; }
    html.lm-pb-off body.pb-has-bar [data-fab]{ bottom: 16px !important; }
}

@keyframes lm-blink{ 50%{ opacity: 0; } }

/* ---------- tablet (768–1024px) ---------- */
@media (min-width: 768px) and (max-width: 1024px) {

    /* the three formats side by side; hours and price one under another */
    .tm-formats{ grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
    .tm-fmt__body{ padding: 20px 18px; }
    .tm-fmt__title{ font-size: 17px; }
    .tm-fmt__desc{ min-height: 0; font-size: 13px; }
    .tm-fmt__nums{ grid-template-columns: 1fr; gap: 12px; }
    .tm-fmt__val{ font-size: 22px; }
    .tm-fmt__switch button{ font-size: 11px; letter-spacing: 0; white-space: nowrap; padding-left: 4px; padding-right: 4px; }

    /* chosen format: the conditions on the left, the price and the button on the right — next to the formats */
    .tm-chosen{ grid-template-columns: minmax(0, 1fr) 300px; }
    .tm-table__row{ grid-template-columns: 140px minmax(0, 1fr); }

    /* payment window on a wide tablet: two columns again, options on the right */
    .paymodal__grid{ grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; }
    .paymodal__side{ order: 0; }
}
@media (min-width: 768px) and (max-width: 899px) {
    .paymodal__grid{ grid-template-columns: 1fr; }
    .paymodal__side{ order: -1; }
}

/* ---------- phone (up to 767px) ---------- */
@media (max-width: 767px) {

    /* chosen format: price and the button right under the formats, then the conditions, then the numbers */
    .tm-chosen__side{ display: contents; }
    .tm-chosen__box{ order: -1; }
    .tm-chosen__info{ order: 0; }
    .tm-kpis{ order: 1; }

    /* the price per month and the buttons sit in the chosen format card; the separate "Выбран формат" box is not shown */
    .tm-chosen__box{ display: none; }
    .tm-fmt.is-active .lm-fmt-act{ display: flex; }
    .lm-fmt-act{
        display: none;
        flex-direction: column;
        gap: 10px;
        margin-top: 18px;
        padding-top: 18px;
        border-top: 1px solid var(--color-line, #34373C);
    }
    .lm-fmt-act__month{ margin: 0 0 6px; color: var(--color-text-soft, #9AA0A6); font-size: 14px; }
    .lm-fmt-act .tm-btn{ min-height: 52px; }

    /* the conditions of the format are folded: "Подробнее о формате" opens them */
    .lm-more{
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: 48px;
        padding: 0;
        background: none;
        border: 0;
        color: var(--color-yellow, #F7B500);
        font-family: inherit;
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 1.2px;
        text-align: left;
        cursor: pointer;
    }
    .tm-chosen__info.lm-folded{ padding-top: 4px; padding-bottom: 4px; }
    .tm-chosen__info.lm-folded > :not(.lm-more){ display: none; }

    /* the hint bubble of the support button covers the text on a phone */
    .fab__bubble{ display: none !important; }

    /* the smallest labels: 11px -> 12px */
    .tm-crumbs .crumbs__item,
    .tm-head__note,
    .tm-fmt__label{ font-size: 12px; }
}

/* phones: the three currencies (Евро / Рубли / Крипта) fit the row without their icons */
@media (max-width: 767px) {
    .pm-cur .pm-cur-ico { display: none; }
}

/* Payment window, step «Спасибо за заявку» (all landings with js/paymodal.js; owner 23.11):
   the window took the height of the form step and the thanks floated in an empty box — now step 1 is folded to
   zero height (NOT removed: the form iframe stays loaded with what was typed, going back shows it as it was)
   and the window is as high as the thanks. Phones keep the full-screen thanks of paymodal.js. */
@media (min-width: 768px){
    html body .paymodal.is-step2-soft .paymodal__step--1{ height: 0 !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; overflow: hidden !important; }
    html body .paymodal.is-step2-soft .paymodal__step--2.is-active{
        position: static !important;
        inset: auto !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 24px !important;
        padding: 0 0 8px !important;
    }
}
