/* ──────────────────────────────────────────────────────────────────────────
   Оплата телемедицинской консультации: баннер на главной и модальное окно
   с формой. Палитра и радиусы взяты из основной темы quansmed:
   бирюзовый #0abab5 / #089894, текст #101010, границы #e8e7ec, фон #f3fcfb.
   ────────────────────────────────────────────────────────────────────────── */

/* ── Баннер-призыв на главной ─────────────────────────────────────────────── */

.tm-cta {
    align-items: center;
    background: linear-gradient(135deg, #0abab5 0%, #089894 100%);
    border-radius: 32px;
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: space-between;
    margin: 32px 0;
    overflow: hidden;
    padding: 32px 28px;
    position: relative;
}

.tm-cta:after {
    background: rgba(255, 255, 255, .08);
    border-radius: 50%;
    content: "";
    height: 320px;
    position: absolute;
    right: -110px;
    top: -140px;
    width: 320px;
}

.tm-cta__body {
    flex: 1 1 380px;
    position: relative;
    z-index: 1;
}

.tm-cta__badge {
    align-items: center;
    background: rgba(255, 255, 255, .18);
    border-radius: 999px;
    display: inline-flex;
    font-size: 13px;
    font-weight: 600;
    gap: 8px;
    letter-spacing: .02em;
    margin-bottom: 12px;
    padding: 6px 14px;
    text-transform: uppercase;
}

.tm-cta__title {
    color: #fff;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 10px;
}

.tm-cta__desc {
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
    max-width: 620px;
    opacity: .92;
}

.tm-cta__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-top: 16px;
}

.tm-cta__meta-item {
    align-items: center;
    display: flex;
    font-size: 14px;
    gap: 8px;
    opacity: .92;
}

.tm-cta__aside {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 1;
}

.tm-cta__price {
    font-size: 15px;
    opacity: .9;
}

.tm-cta__price b {
    display: block;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.1;
}

/* Кнопка открытия формы — работает и как <button>, и как <a> */
.tm-btn,
a.tm-btn,
button.tm-btn {
    align-items: center;
    background-color: #fff;
    border: none;
    border-radius: 24px;
    color: #0abab5;
    cursor: pointer;
    display: inline-flex;
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    gap: 10px;
    justify-content: center;
    line-height: 1.2;
    padding: 16px 32px;
    text-align: center;
    text-decoration: none;
    transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

.tm-btn:hover,
a.tm-btn:hover,
button.tm-btn:hover {
    background-color: #f3fcfb;
    color: #089894;
    transform: translateY(-1px);
}

.tm-btn:focus-visible {
    outline: 3px solid rgba(255, 255, 255, .8);
    outline-offset: 2px;
}

/* Вариант кнопки для светлого фона (например, в блоке hero) */
.tm-btn--solid,
a.tm-btn--solid,
button.tm-btn--solid {
    background-color: #0abab5;
    color: #fff;
}

.tm-btn--solid:hover,
a.tm-btn--solid:hover,
button.tm-btn--solid:hover {
    background-color: #089894;
    color: #fff;
}

.tm-btn__icon {
    flex: 0 0 auto;
    height: 20px;
    width: 20px;
}

/* ── Модальное окно ───────────────────────────────────────────────────────── */

.tm-modal {
    inset: 0;
    overflow-y: auto;
    padding: 24px 16px;
    position: fixed;
    z-index: 12000;
}

.tm-modal[hidden] {
    display: none !important;
}

.tm-modal__overlay {
    background: rgba(16, 16, 16, .55);
    inset: 0;
    position: fixed;
}

.tm-modal__dialog {
    animation: tm-modal-in .22s ease-out;
    background: #fff;
    border-radius: 28px;
    box-shadow: 0 24px 60px rgba(16, 16, 16, .25);
    margin: 0 auto;
    max-width: 560px;
    overflow: hidden;
    position: relative;
    width: 100%;
}

@keyframes tm-modal-in {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .tm-modal__dialog { animation: none; }
    .tm-btn { transition: none; }
}

.tm-modal__close {
    background: rgba(255, 255, 255, .2);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    font-size: 24px;
    height: 36px;
    line-height: 1;
    position: absolute;
    right: 16px;
    top: 16px;
    transition: background-color .2s ease;
    width: 36px;
    z-index: 2;
}

.tm-modal__close:hover {
    background: rgba(255, 255, 255, .35);
}

.tm-modal__head {
    background: linear-gradient(135deg, #0abab5 0%, #089894 100%);
    color: #fff;
    padding: 28px 28px 24px;
}

.tm-modal__badge {
    background: rgba(255, 255, 255, .18);
    border-radius: 999px;
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    margin-bottom: 12px;
    padding: 5px 12px;
    text-transform: uppercase;
}

.tm-modal__title {
    color: #fff;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    padding-right: 32px;
    text-transform: none;
}

.tm-modal__doctor {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.tm-modal__doctor-photo {
    border: 2px solid rgba(255, 255, 255, .5);
    border-radius: 50%;
    flex: 0 0 auto;
    height: 52px;
    object-fit: cover;
    width: 52px;
}

.tm-modal__doctor-name {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}

.tm-modal__doctor-spec {
    font-size: 13px;
    margin: 2px 0 0;
    opacity: .9;
}

.tm-modal__body {
    padding: 8px 28px 28px;
}

.tm-modal__price {
    align-items: center;
    background: #f3fcfb;
    border: 1px solid #d3f0ef;
    border-radius: 16px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin: 20px 0 4px;
    padding: 14px 18px;
}

.tm-modal__price-label {
    color: #4a4a4a;
    font-size: 15px;
    margin: 0;
}

.tm-modal__price-value {
    color: #0abab5;
    font-size: 24px;
    font-weight: 700;
    white-space: nowrap;
}

/* Форма внутри модалки: убираем «карточные» отступы базового стиля */
.tm-modal .b-application-form {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 8px 0 0;
}

.tm-modal .b-application-form .buttons {
    margin-top: 20px;
}

.tm-modal .b-application-form .btn {
    min-width: 100%;
    width: 100%;
}

.tm-modal__secure {
    align-items: flex-start;
    color: #9d9d9d;
    display: flex;
    font-size: 13px;
    gap: 8px;
    line-height: 1.45;
    margin: 18px 0 0;
}

.tm-modal__secure svg {
    flex: 0 0 auto;
    height: 16px;
    margin-top: 1px;
    width: 16px;
}

/* ── Блок согласий ────────────────────────────────────────────────────────── */

/* Два текста согласий выводятся списком, ниже — одна общая галочка */
.tm-consents {
    color: #4a4a4a;
    font-size: 13px;
    line-height: 1.5;
    margin-top: 4px;
}

.tm-consents ol {
    margin: 0;
    padding-left: 18px;
}

.tm-consents li + li {
    margin-top: 8px;
}

.tm-consents a {
    color: #0abab5;
}

/* Поле display рисует пустую подпись — она здесь только мешает */
.b-application-form .form-field:has(.tm-consents) > .form-label {
    display: none;
}

/* ── Отдельная страница формы и страница результата ───────────────────────── */

.tm-page {
    margin: 40px auto 64px;
    max-width: 620px;
}

.tm-page__card {
    background: #fff;
    border: 1px solid #e8e7ec;
    border-radius: 28px;
    overflow: hidden;
}

.tm-page__card .tm-modal__head {
    border-radius: 0;
}

.tm-page__card .tm-modal__body {
    padding: 8px 28px 32px;
}

.tm-result {
    /* Шаблон рендерится на тёмном фоне темы, поэтому карточку красим сами */
    background: #fff;
    border: 1px solid #e8e7ec;
    border-radius: 28px;
    color: #101010;
    margin: 48px auto 72px;
    max-width: 620px;
    padding: 44px 28px 40px;
    text-align: center;
}

.tm-result__icon {
    align-items: center;
    border-radius: 50%;
    display: inline-flex;
    height: 76px;
    justify-content: center;
    margin-bottom: 20px;
    width: 76px;
}

.tm-result__icon--ok {
    background: #e6f8f7;
    color: #0abab5;
}

.tm-result__icon--fail {
    background: #fdecea;
    color: #e53935;
}

.tm-result__icon svg {
    height: 38px;
    width: 38px;
}

.tm-result__title {
    font-size: 26px;
    line-height: 1.25;
    margin: 0 0 12px;
}

.tm-result__message {
    color: #4a4a4a;
    font-size: 16px;
    line-height: 1.55;
    margin: 0 auto 24px;
    max-width: 480px;
}

.tm-result__details {
    background: #fcfcfc;
    border: 1px solid #e8e7ec;
    border-radius: 20px;
    margin: 0 auto 28px;
    max-width: 480px;
    padding: 8px 20px;
    text-align: left;
}

.tm-result__row {
    border-bottom: 1px solid #f0f0f3;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 12px 0;
}

.tm-result__row:last-child {
    border-bottom: none;
}

.tm-result__row dt {
    color: #9d9d9d;
    font-size: 14px;
    margin: 0;
}

.tm-result__row dd {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    text-align: right;
}

.tm-result__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

/* ── Адаптив ──────────────────────────────────────────────────────────────── */

@media (max-width: 767px) {
    .tm-cta {
        border-radius: 24px;
        padding: 24px 20px;
    }

    .tm-cta__title {
        font-size: 22px;
    }

    .tm-cta__aside {
        align-items: stretch;
        width: 100%;
    }

    .tm-cta__aside .tm-btn {
        width: 100%;
    }

    .tm-cta__price {
        text-align: center;
    }

    .tm-modal {
        padding: 0;
    }

    .tm-modal__dialog {
        border-radius: 24px 24px 0 0;
        margin-top: 40px;
        min-height: calc(100vh - 40px);
    }

    .tm-modal__head {
        padding: 24px 20px 20px;
    }

    .tm-modal__title {
        font-size: 19px;
    }

    .tm-modal__body,
    .tm-page__card .tm-modal__body {
        padding: 8px 20px 28px;
    }
}

/* ── Кнопка оплаты в карточках врачей (/vrachi, /vrachi/<врач>) ───────────── */

/* Контурная кнопка под основной «Записаться»: форма и размер как у .btn
   мини-карточки, цвет — фирменный бирюзовый. z-index нужен, потому что имя
   врача растянуто ссылкой на всю карточку (::after с inset: 0). */
.tm-card-pay {
    align-items: center;
    background-color: #fff;
    border: 1.5px solid #0abab5;
    border-radius: 16px;
    color: #089894;
    cursor: pointer;
    display: flex;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    gap: 8px;
    justify-content: center;
    line-height: 1.25;
    margin-top: 8px;
    padding: 10px 14px;
    position: relative;
    text-align: center;
    text-transform: none;
    transition: background-color .2s ease, color .2s ease;
    width: 100%;
    z-index: 1;
}

.tm-card-pay:hover {
    background-color: #f3fcfb;
    color: #0abab5;
}

.tm-card-pay:focus-visible {
    outline: 3px solid rgba(10, 186, 181, .45);
    outline-offset: 2px;
}

.tm-card-pay .tm-btn__icon {
    height: 18px;
    width: 18px;
}

/* В полной карточке кнопки стоят рядом, на телефоне — друг под другом */
.tm-card-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.tm-card-pay--full {
    font-size: 16px;
    margin-top: 0;
    padding: 14px 24px;
    width: auto;
}

@media (max-width: 767px) {
    .tm-card-actions > * {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tm-card-pay { transition: none; }
}

/* Кнопка оплаты в hero-блоке: <button> не наследует шрифт страницы сам */
button.p-intro__btn {
    font-family: inherit;
}
