/* Bitrix24 forms ("Заказать звонок", "Оформить заявку", the consent window and the inline form 20 on
   business pages) in the site's design code: a white card with a 24px radius, light #f3f6f9 fields,
   a pill gradient button and a compact consent line. Loaded on every page.
   The form app (corp.well-comm.ru) appends its app.bundle.min.css to <head> after this file, so every
   form rule starts with "html body" to win on specificity instead of order. Form instance ids are random
   per render, so nothing here is keyed by them. */

/* palette: the app writes it per instance as ".b24-form #b24-<id>, .b24-window-mounts #b24-window-mount-<id>
   { --b24-...: ... }" (id specificity), so these values need !important to win */
html body .b24-form > div[id^="b24-"],
html body .b24-window-mounts > .b24-form {
    --b24-primary-color: #00a2de !important;
    --b24-primary-text-color: #fff !important;
    --b24-text-color: #14233c !important;
    --b24-background-color: #fff !important;
    --b24-field-border-color: transparent !important;
    --b24-field-background-color: #f3f6f9 !important;
    --b24-field-focus-background-color: #fff !important;
    --b24-popup-background-color: #fff !important;
    --b24-primary-hover-color: #0091c7 !important;
    --b24-font-family: Helvetica, Arial, sans-serif !important;
}

/* ------------------------------------------------------------------ window */
html body .b24-form .b24-window-overlay {
    background-color: rgba(20, 35, 60, .45);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

html body .b24-form .b24-window-popup-wrapper {
    max-width: 440px;
    overflow: hidden;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(20, 35, 60, .25);
}

html body .b24-form .b24-window-close {
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f3f6f9;
    opacity: 1;
    transition: background-color .2s;
}

/* the cross is drawn by the form app's ::before/::after lines (white by default) */
html body .b24-form .b24-window-close::before,
html body .b24-form .b24-window-close::after {
    width: 2px;
    height: 15px;
    border-radius: 1px;
    background-color: #14233c;
}

html body .b24-form .b24-window-close:hover {
    background-color: #e6edf3;
}

/* ------------------------------------------------------------------ form */
html body .b24-form .b24-form-wrapper,
html body .b24-form .b24-form-wrapper.b24-form-border-top,
html body .b24-form .b24-form-wrapper.b24-form-border-bottom {
    border: 0;
    background: #fff;
}

/* inline forms (form 20 in the business hero): the same card as the popups; the open lines chat
   shows its own inline form inside a message bubble, so it is left out */
html body :not(.bx-imopenlines-form-content) > .b24-form > div > .b24-form-wrapper {
    overflow: hidden;
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(20, 35, 60, .25);
}

html body .b24-form .b24-form-padding-side {
    padding-right: 32px;
    padding-left: 32px;
}

html body .b24-form .b24-form-header {
    padding-top: 32px;
    padding-bottom: 6px;
    border-bottom: 0;
    text-align: left;
}

/* popups: room for the X; the header stays on top while a long form scrolls on short screens,
   so the X never covers a field */
html body .b24-form .b24-window-popup .b24-form-header {
    position: sticky;
    top: 0;
    z-index: 2;
    padding-right: 72px;
    background: #fff;
}

html body .b24-form .b24-form-header-title {
    margin: 0;
    font: 700 26px/1.2 Helvetica, Arial, sans-serif;
    letter-spacing: 0;
    color: #14233c;
}

html body .b24-form .b24-form-content {
    padding-top: 18px;
}

/* text fields with floating labels */
html body .b24-form .b24-form-control-string .b24-form-control {
    height: 56px;
    padding: 22px 16px 6px;
    border: 1.5px solid transparent;
    border-radius: 14px;
    background-color: #f3f6f9;
    font: 400 16px/20px Helvetica, Arial, sans-serif;
    letter-spacing: 0;
    color: #14233c;
}

html body .b24-form .b24-form-control-string .b24-form-control:hover {
    border-color: #dfe8ef;
}

html body .b24-form .b24-form-control-string .b24-form-control:focus {
    border-color: #00a2de;
    background-color: #fff;
}

html body .b24-form .b24-form-control-string .b24-form-control-label {
    top: 18px;
    padding-left: 17px;
    transform: none;
    font: 400 16px/20px Helvetica, Arial, sans-serif;
    color: #7a8aa0;
    opacity: 1;
}

html body .b24-form .b24-form-control-string .b24-form-control:focus + .b24-form-control-label,
html body .b24-form .b24-form-control-string .b24-form-control-not-empty + .b24-form-control-label {
    top: 9px;
    font-size: 12px;
    line-height: 14px;
}

html body .b24-form .b24-form-control-required {
    color: #00a2de;
}

html body .b24-form .b24-form-control-alert .b24-form-control {
    border-color: rgba(242, 88, 48, .6);
    background-color: rgba(242, 88, 48, .05);
}

/* errors: a quiet red line under the field instead of the orange tag */
html body .b24-form .b24-form-control-alert-message {
    position: static;
    max-width: none;
    margin-top: 6px;
    padding: 0 0 0 16px;
    border-radius: 0;
    background: none;
    font: 400 12px/1.3 Helvetica, Arial, sans-serif;
    color: #e5533d;
}

html body .b24-form .b24-form-control-alert-message::before,
html body .b24-form .b24-form-control-alert-message::after {
    display: none;
}

html body .b24-form .b24-form-field-agreement .b24-form-control-alert-message {
    padding-left: 28px;
}

/* consent: small grey text next to a brand-coloured box */
html body .b24-form .b24-form-field-agreement label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
}

html body .b24-form .b24-form-field-agreement input[type=checkbox] {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: #00a2de;
}

html body .b24-form .b24-form-field-agreement .b24-form-control-desc,
html body .b24-form .b24-form-field-agreement-link {
    font-size: 12px;
    line-height: 1.45;
    color: #5b6b80;
    text-decoration: none;
    opacity: 1;
}

html body .b24-form .b24-form-field-agreement-link:hover {
    color: #00a2de;
}

/* the consent is required anyway (the form shows an error); the lone "*" would hang at the far right */
html body .b24-form .b24-form-field-agreement .b24-form-control-required {
    display: none;
}

/* buttons */
html body .b24-form .b24-form-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 8px 16px;
    border-radius: 27px !important;
    background: linear-gradient(85.41deg, #00bbe4 40.54%, #a2d537 102.22%);
    box-shadow: none;
    font: 700 16px/1.2 Helvetica, Arial, sans-serif;
    letter-spacing: 0;
    color: #fff;
}

html body .b24-form .b24-form-btn:hover,
html body .b24-form .b24-form-btn:focus-visible {
    background: linear-gradient(284.88deg, #00bbe4 32.8%, #a2d537 118.11%);
    box-shadow: 0 12px 28px rgba(100, 212, 219, .35);
}

/* "Не принимаю" in the consent window */
html body .b24-form .b24-form-btn.b24-form-btn-white,
html body .b24-form .b24-form-btn.b24-form-btn-border {
    border: 0;
    background: #f3f6f9;
    color: #14233c;
}

html body .b24-form .b24-form-btn.b24-form-btn-white:hover,
html body .b24-form .b24-form-btn.b24-form-btn-border:hover {
    background: #e6edf3;
    box-shadow: none;
}

/* reCAPTCHA badge: stays visible (Google requires it), centred under the button */
html body .b24-form .b24-form-recaptcha {
    justify-content: center;
    margin: 0;
    padding: 0 32px 26px;
}

/* ------------------------------------------------------------------ consent window */
html body .b24-form .b24-window-popup-head {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 28px 72px 12px 32px;
    border-bottom: 1px solid #eef2f6;
    background: #fff;
}

html body .b24-form .b24-window-popup-title {
    overflow: visible;
    white-space: normal;
    font: 700 18px/1.3 Helvetica, Arial, sans-serif;
    color: #14233c;
}

/* the consent text: the site resets line-height to 1 on every div */
html body .b24-window-mounts .b24-window-popup-body > div {
    padding: 4px 32px 20px !important;
    font-size: 14px;
    line-height: 1.55;
    color: #3b4a5e;
}

html body .b24-window-mounts .b24-window-popup-body > div div {
    line-height: inherit;
}

@media screen and (max-width: 480px) {
    html body .b24-window-mounts .b24-window-popup-body > div {
        padding: 4px 20px 16px !important;
    }

    html body .b24-form .b24-window-popup-head {
        padding: 22px 64px 10px 20px;
    }
}

/* ------------------------------------------------------------------ phones */
@media screen and (max-width: 512px) {
    /* the form app reserves 95px under the form for its "sign" block, which these forms do not show */
    html body .b24-form .b24-window-scrollable {
        padding-bottom: 0;
    }
}

@media screen and (max-width: 480px) {
    html body .b24-form .b24-window-popup-wrapper {
        width: calc(100% - 24px);
        border-radius: 20px;
    }

    html body :not(.bx-imopenlines-form-content) > .b24-form > div > .b24-form-wrapper {
        border-radius: 20px;
    }

    html body .b24-form .b24-form-padding-side {
        padding-right: 20px;
        padding-left: 20px;
    }

    html body .b24-form .b24-form-header {
        padding-top: 24px;
    }

    html body .b24-form .b24-window-popup .b24-form-header {
        padding-right: 64px;
    }

    html body .b24-form .b24-form-header-title {
        font-size: 22px;
    }

    html body .b24-form .b24-window-close {
        top: 16px;
        right: 16px;
    }

    html body .b24-form .b24-form-recaptcha {
        padding: 0 20px 20px;
    }
}

@media screen and (max-height: 700px) {
    html body .b24-form .b24-window-popup-wrapper .b24-window-scrollable {
        max-height: calc(100vh - 32px);
    }
}

/* ------------------------------------------------------------------ tariff request (#startModal)
   The site's own Bootstrap modal (CMS web form 11) behind the "Подключить за … ₽/мес" buttons, in the same style. */
.modal-backdrop {
    background-color: #14233c;
}

.modal-backdrop.show {
    opacity: .45;
}

#startModal.show {
    display: flex !important;
    padding-top: 12px;
    padding-bottom: 12px;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

/* auto margins centre it in the flex overlay and fall back to the top when it is taller */
#startModal .modal-dialog {
    max-width: 440px;
    margin: auto;
    padding: 32px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(20, 35, 60, .25);
}

#startModal .modal__close {
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f3f6f9;
    transition: background-color .2s;
}

#startModal .modal__close svg {
    width: 13px;
    height: 13px;
}

#startModal .modal__close path {
    fill: #14233c;
}

#startModal .modal__close:hover {
    background: #e6edf3;
}

/* "Заявка на тариф" over the tariff name that main.min.js writes into the title */
#startModal .modal__title {
    padding-right: 48px;
    font: 700 26px/1.2 Helvetica, Arial, sans-serif;
    letter-spacing: 0;
    text-align: left;
    color: #14233c;
}

#startModal .modal__title::before {
    content: 'Заявка на тариф';
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #7a8aa0;
}

#startModal .modal__price {
    margin-top: 10px;
    font: 700 30px/1.1 Helvetica, Arial, sans-serif;
    text-align: left;
    color: #00a2de;
}

#startModal .modal__price-title {
    margin-left: 4px;
    font-size: 16px;
    font-weight: 500;
    color: #3b4a5e;
}

#startModal .modal__form {
    margin-top: 22px;
}

#startModal .fg + .fg {
    margin-top: 12px;
}

#startModal .fg input {
    height: 56px;
    padding: 0 16px;
    border: 1.5px solid transparent;
    border-radius: 14px;
    background-color: #f3f6f9;
    font: 400 16px/20px Helvetica, Arial, sans-serif;
    letter-spacing: 0;
    color: #14233c;
    transition: border-color .2s, background-color .2s;
}

#startModal .fg input::placeholder {
    color: #7a8aa0;
}

#startModal .fg input:hover {
    border-color: #dfe8ef;
}

#startModal .fg input:focus {
    border-color: #00a2de;
    background-color: #fff;
    outline: none;
}

/* main.min.js marks fields with an inline border-bottom: neutral after typing, red when empty on submit */
#startModal .fg input[style*="border-bottom"] {
    border: 1.5px solid transparent !important;
}

#startModal .fg input[style*="border-bottom"]:focus {
    border-color: #00a2de !important;
}

#startModal .fg input[style*="rgb(255, 0, 0)"] {
    border-color: rgba(242, 88, 48, .6) !important;
    background-color: rgba(242, 88, 48, .05);
}

/* consent box: the same small brand checkbox as in the tariff cards */
#startModal .modal__check {
    margin-top: 16px;
}

#startModal .modal__check label {
    min-height: 20px;
    padding-left: 30px;
    font: 400 13px/1.4 Helvetica, Arial, sans-serif;
    letter-spacing: 0;
    color: #5b6b80;
}

/* main.min.js colours the label inline: black when ticked, pure red when not */
#startModal .modal__check label[style*="rgb(0, 0, 0)"] {
    color: #5b6b80 !important;
}

#startModal .modal__check label[style*="rgb(255, 0, 0)"] {
    color: #e5533d !important;
}

#startModal .modal__check input:focus-visible + label::before {
    box-shadow: 0 0 0 3px rgba(0, 162, 222, .3);
}

#startModal .modal__check label::before {
    position: absolute;
    top: 0;
    left: 0;
    box-sizing: border-box;
    width: 20px;
    height: 20px;
    background-color: #fff;
    border: 1.5px solid #c5ccd6;
    border-radius: 5px;
}

#startModal .modal__check input:checked + label::before {
    background: #00a2de url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
    border-color: #00a2de;
}

#startModal .modal__check .policy_link {
    color: #00a2de;
}

#startModal .modal__btn {
    gap: 10px;
    justify-content: center;
    width: 100%;
    height: 54px;
    margin-top: 22px;
    border-radius: 27px;
    font: 700 16px/1 Helvetica, Arial, sans-serif;
    letter-spacing: 0;
    text-transform: none;
}

#startModal .modal__btn svg {
    width: 18px;
    height: 18px;
    margin: 0;
    transition: transform .2s;
}

#startModal .modal__btn:hover svg {
    transform: translateX(3px);
}

@media screen and (max-width: 576px) {
    #startModal .modal-dialog {
        width: calc(100% - 24px);
        max-width: 440px;
        padding: 24px 20px;
        border-radius: 20px;
    }

    #startModal .modal__close {
        top: 16px;
        right: 16px;
    }

    #startModal .modal__title {
        font-size: 24px;
    }

    #startModal .fg input {
        height: 52px;
    }
}

/* ------------------------------------------------------------------ keyboard focus
   The site resets outline-width to 0 with !important, so focus is shown with a ring (box-shadow). */
html body .b24-form .b24-window-close:focus-visible,
#startModal .modal__close:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 162, 222, .35);
}

#startModal .modal__btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(0, 162, 222, .35);
}

#startModal .policy_link:focus-visible {
    border-radius: 3px;
    box-shadow: 0 0 0 2px rgba(0, 162, 222, .45);
}
