/* ===== Окно заявки (inc/lead.php) ===== */

/* «Teirautis» в таблице цен — теперь кнопка */
.twc-price-table button.twc-price--ask {
    min-height: 0;
    margin: 0;
    padding: 6px 14px;
    border: 1.5px solid var(--wd-primary-color, #2e6bc6);
    border-radius: 999px;
    background: #fff;
    box-shadow: none;
    color: var(--wd-primary-color, #2e6bc6);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}

.twc-price-table button.twc-price--ask::after {
    content: " →";
}

.twc-price-table button.twc-price--ask:hover {
    background: var(--wd-primary-color, #2e6bc6);
    color: #fff;
}

/* «Pasiteiraukite» на карточке категории */
.twc-model__prices .is-ask {
    cursor: pointer;
}

.twc-home .twc-model__prices .is-ask b {
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(46, 107, 198, .08);
    color: var(--wd-primary-color, #2e6bc6);
    font-weight: 600;
}

.twc-home .twc-model__prices .is-ask:hover b {
    background: var(--wd-primary-color, #2e6bc6);
    color: #fff;
}

/* Окно */
html.twc-modal-open {
    overflow: hidden;
}

.twc-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.twc-modal[hidden] {
    display: none;
}

.twc-modal *,
.twc-modal *::before,
.twc-modal *::after {
    box-sizing: border-box;
}

.twc-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 18, 34, .55);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .2s ease;
}

.twc-modal__box {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 32px);
    padding: 30px 30px 26px;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 40px 80px -20px rgba(10, 18, 34, .45);
    overflow-y: auto;
    opacity: 0;
    transform: translateY(16px) scale(.98);
    transition: opacity .2s ease, transform .25s cubic-bezier(.34, 1.4, .64, 1);
    color: #5b6472;
    font-family: var(--wd-text-font);
    font-size: 15px;
    text-align: left;
}

.twc-modal.is-open .twc-modal__backdrop {
    opacity: 1;
}

.twc-modal.is-open .twc-modal__box {
    opacity: 1;
    transform: none;
}

.twc-modal .twc-modal__x {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f1f3f6;
    box-shadow: none;
    color: #14181f;
    font-size: 22px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
}

.twc-modal .twc-modal__x:hover {
    background: #e4e8ee;
    color: #14181f;
}

.twc-modal__head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding-right: 30px;
}

.twc-modal__ico {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: linear-gradient(140deg, #6ea8ff 0%, var(--wd-primary-color, #2e6bc6) 100%);
    color: #fff;
}

.twc-modal__title {
    color: #14181f;
    font-family: var(--wd-title-font);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

.twc-modal__sub {
    margin-top: 2px;
    color: var(--wd-primary-color, #2e6bc6);
    font-size: 14px;
    font-weight: 600;
}

.twc-modal__call {
    display: flex;
    gap: 8px;
}

.twc-modal .twc-modal__phone,
.twc-modal .twc-modal__wa {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 54px;
    border-radius: 14px;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}

.twc-modal .twc-modal__phone {
    flex: 2;
    background: #e5f6ec;
    color: #1e7a3e;
}

.twc-modal .twc-modal__wa {
    background: #25d366;
    color: #fff;
    font-size: 15px;
}

.twc-modal__or {
    position: relative;
    margin: 18px 0 14px;
    text-align: center;
    font-size: 13px;
}

.twc-modal__or::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    border-top: 1px solid rgba(16, 24, 40, .08);
}

.twc-modal__or span {
    position: relative;
    padding: 0 10px;
    background: #fff;
}

.twc-field {
    margin-bottom: 12px;
}

.twc-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.twc-modal .twc-field label {
    display: block;
    margin: 0 0 5px;
    color: #14181f;
    font-size: 13px;
    font-weight: 600;
}

.twc-field label b {
    color: #e5484d;
}

.twc-modal .twc-field input,
.twc-modal .twc-field textarea {
    display: block;
    width: 100%;
    height: auto;
    min-height: 48px;
    margin: 0;
    padding: 12px 14px;
    border: 1.5px solid rgba(16, 24, 40, .12);
    border-radius: 12px;
    background: #f8fafc;
    box-shadow: none;
    color: #14181f;
    font-size: 16px; /* 16px — iPhone не зумит поле */
    line-height: 1.4;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.twc-modal .twc-field textarea {
    resize: vertical;
}

.twc-modal .twc-field input:focus,
.twc-modal .twc-field textarea:focus {
    border-color: var(--wd-primary-color, #2e6bc6);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(46, 107, 198, .1);
    outline: none;
}

.twc-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.twc-modal__error {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    background: #fdecec;
    color: #b42318;
    font-size: 14px;
}

.twc-modal__error[hidden] {
    display: none;
}

.twc-modal .twc-modal__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    margin: 4px 0 0;
    padding: 0 20px;
    border: 0;
    border-radius: 14px;
    background: var(--wd-primary-color, #2e6bc6);
    box-shadow: 0 14px 30px -14px rgba(46, 107, 198, .8);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    transition: transform .15s ease, opacity .15s ease;
}

.twc-modal .twc-modal__submit:hover {
    background: var(--wd-primary-color, #2e6bc6);
    color: #fff;
    transform: translateY(-1px);
}

.twc-modal .twc-modal__submit.is-loading {
    opacity: .6;
    pointer-events: none;
}

.twc-modal__note {
    margin: 12px 0 0;
    font-size: 12px;
    text-align: center;
}

.twc-modal__done {
    padding: 20px 0 4px;
    text-align: center;
}

.twc-modal__done[hidden],
.twc-modal__form-wrap[hidden] {
    display: none;
}

.twc-modal__check {
    display: inline-grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin-bottom: 18px;
    border-radius: 50%;
    background: #e5f6ec;
    color: #1e9e57;
    animation: twc-pop .4s cubic-bezier(.34, 1.56, .64, 1);
}

.twc-modal__done p {
    margin: 8px 0 22px;
}

@keyframes twc-pop {
    from { transform: scale(.5); opacity: 0; }
    to { transform: none; opacity: 1; }
}

@media (max-width: 480px) {
    .twc-modal {
        align-items: flex-end;
        padding: 0;
    }

    .twc-modal__box {
        max-width: none;
        max-height: 92vh;
        padding: 26px 20px 22px;
        border-radius: 24px 24px 0 0;
        transform: translateY(40px);
    }

    .twc-field-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Альтернатива под формой: позвонить */
.twc-modal__alt {
    margin-top: 6px;
}

.twc-modal__alt .twc-modal__or {
    margin: 20px 0 12px;
    color: #14181f;
    font-weight: 600;
}

.twc-modal .twc-modal__phone {
    justify-content: flex-start;
    gap: 14px;
    min-height: 64px;
    padding: 10px 16px;
    border: 1.5px solid #c9ecd7;
    transition: background-color .15s ease, transform .15s ease;
}

.twc-modal .twc-modal__phone:hover {
    background: #d6f1e1;
    color: #1e7a3e;
    transform: translateY(-1px);
}

.twc-modal__phone-ico {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #1e9e57;
    color: #fff;
}

.twc-modal__phone small {
    display: block;
    color: #3d8a5a;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
}

.twc-modal__done-call {
    margin: -10px 0 20px !important;
    font-size: 14px;
}

.twc-modal__done-call a {
    color: #1e9e57;
    font-weight: 700;
    white-space: nowrap;
}
