.rp-crm-form {
    --rp-crm-ink: #0c0c0c;
    --rp-crm-blue: #4074a4;
    --rp-crm-fill: #deefff;
    --rp-crm-line: #c5c5c5;
    --rp-crm-close: url("/local/include/crm-form-design/close.svg");
    font-family: Montserrat, Arial, sans-serif;
}

.rp-crm-form.rp-crm-form .b24-form-wrapper {
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    background: #fff !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-family: inherit !important;
}

.rp-crm-form.rp-crm-form .b24-form-header {
    padding: 0 0 var(--rp-crm-heading-gap, 32px) !important;
    margin: 0 !important;
    border: 0 !important;
    text-align: center !important;
}

.rp-crm-form.rp-crm-form .b24-form-header-title {
    margin: 0 !important;
    color: var(--rp-crm-ink) !important;
    font: 700 var(--rp-crm-title-size, 32px)/1.2 Montserrat, Arial, sans-serif !important;
    text-transform: none !important;
}

.rp-crm-form.rp-crm-form .b24-form-header-description {
    max-width: none !important;
    margin: 16px 0 0 !important;
    color: var(--rp-crm-ink) !important;
    font: 400 16px/1.2 Montserrat, Arial, sans-serif !important;
}

.rp-crm-form.rp-crm-form :is(.b24-form-content, .b24-form-padding-side):not(.b24-form-header) {
    padding: 0 !important;
}

.rp-crm-form.rp-crm-form .b24-form-field {
    margin-bottom: 16px !important;
}

.rp-crm-form.rp-crm-form .b24-form-field:not(.b24-form-field-agreement) .b24-form-control-container {
    min-height: 0 !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: transparent !important;
    box-shadow: none !important;
}

.rp-crm-form.rp-crm-form .b24-form-control-container :is(input.b24-form-control, textarea.b24-form-control, select.b24-form-control, .b24-form-control-list .b24-form-control) {
    box-sizing: border-box;
    min-height: 54px !important;
    border: .5px solid var(--rp-crm-line) !important;
    border-radius: 8px !important;
    background: #fff !important;
    box-shadow: none !important;
    color: var(--rp-crm-ink) !important;
    font: 400 16px/1.4 Montserrat, Arial, sans-serif !important;
}

.rp-crm-form.rp-crm-form .b24-form-control-list .b24-form-control {
    min-height: 54px !important;
}

.rp-crm-form.rp-crm-form .b24-form-control-container textarea.b24-form-control {
    height: 54px;
    resize: vertical;
}

.rp-crm-form.rp-crm-form .b24-form-control-container .b24-form-control:focus {
    border-color: var(--rp-crm-blue) !important;
}

.rp-crm-form.rp-crm-form .b24-form-field-error .b24-form-control {
    border-color: #c62828 !important;
}

.rp-crm-form.rp-crm-form .b24-form-control-label {
    padding-left: 17px !important;
    color: #666 !important;
    font: 400 16px/1.4 Montserrat, Arial, sans-serif !important;
}

.rp-crm-form.rp-crm-form .b24-form-control-label-content {
    color: inherit !important;
}

.rp-crm-form.rp-crm-form .b24-form-field-agreement .b24-form-control-container {
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.rp-crm-form.rp-crm-form .b24-form-field-agreement label {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
}

.rp-crm-form.rp-crm-form .b24-form-field-agreement input[type="checkbox"] {
    appearance: auto !important;
    display: block !important;
    position: static !important;
    flex: 0 0 20px;
    width: 20px !important;
    height: 20px !important;
    margin: 0 !important;
    opacity: 1 !important;
    accent-color: var(--rp-crm-blue);
}

.rp-crm-form.rp-crm-form .b24-form-field-agreement :is(.b24-form-control-desc, .b24-form-field-agreement-link) {
    padding: 0 !important;
    color: var(--rp-crm-ink) !important;
    font: 400 13px/1.2 Montserrat, Arial, sans-serif !important;
    text-align: left !important;
}

.rp-crm-form.rp-crm-form .b24-form-field-agreement-link {
    text-decoration: none !important;
}

.rp-crm-form.rp-crm-form .b24-form-field-agreement-link:is(:hover, :focus-visible) {
    text-decoration: underline !important;
}

.rp-crm-form.rp-crm-form .b24-form-field-agreement .b24-form-control-desc::before,
.rp-crm-form.rp-crm-form .b24-form-field-agreement .b24-form-control-desc::after {
    display: none !important;
}

.rp-crm-form.rp-crm-form .b24-form-btn-container {
    margin-top: var(--rp-crm-submit-gap, 32px) !important;
}

.rp-crm-form.rp-crm-form .b24-form-btn {
    width: 100% !important;
    min-height: 48px !important;
    padding: 10px 16px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: var(--rp-crm-fill) !important;
    box-shadow: none !important;
    color: var(--rp-crm-blue) !important;
    font: 600 16px/1.2 Montserrat, Arial, sans-serif !important;
}

.rp-crm-form.rp-crm-form .b24-form-btn:not(:disabled):hover {
    background: var(--rp-crm-blue) !important;
    color: #fff !important;
}

.rp-crm-form .rp-crm-close {
    position: absolute !important;
    z-index: 3;
    top: 20px !important;
    right: 20px !important;
    display: grid !important;
    place-items: center;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #eef7ff var(--rp-crm-close) center no-repeat !important;
    box-shadow: none !important;
    color: transparent !important;
    cursor: pointer;
}

.rp-crm-form .rp-crm-close::before,
.rp-crm-form .rp-crm-close::after {
    content: none !important;
}

.rp-crm-form :is(button, a, [role="button"]):focus-visible {
    outline: 2px solid var(--rp-crm-blue);
    outline-offset: 2px;
}

.rp-crm-form.rp-crm-form .b24-form-sign {
    display: none !important;
}

.rp-crm-form.rp-crm-form .b24-form-dropdown-container {
    box-sizing: border-box;
    max-height: min(260px, 40dvh) !important;
    padding: 4px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #aebdcc transparent;
    border: 1px solid #dce4ec !important;
    border-radius: 8px !important;
    background: #fff !important;
    box-shadow: 0 6px 20px rgba(12, 32, 55, .14) !important;
}

.rp-crm-form.rp-crm-form .b24-form-control-list [role="combobox"]::after {
    content: "" !important;
    position: absolute;
    top: 27px !important;
    right: 14px !important;
    width: 6px !important;
    height: 11px !important;
    margin: 0 !important;
    border: 0 !important;
    pointer-events: none;
    background: url("/local/include/crm-form-design/select.svg") center no-repeat !important;
    transform: translateY(-50%) rotate(-90deg) !important;
}

.rp-crm-form.rp-crm-form .b24-form-control-list [role="combobox"][aria-expanded="true"]::after {
    transform: translateY(-50%) rotate(90deg) !important;
}

.rp-crm-form.rp-crm-form .b24-form-control-list-selector-item {
    display: flex !important;
    align-items: center;
    height: auto !important;
    min-height: 40px !important;
    padding: 9px 12px !important;
    border: 0 !important;
    border-radius: 5px;
    background: transparent !important;
    color: var(--rp-crm-ink) !important;
}

.rp-crm-form.rp-crm-form .b24-form-control-list-selector-item:is(:hover, .b24-form-control-list-selector-item-focused, [aria-selected="true"]) {
    background: #eef7ff !important;
    color: var(--rp-crm-blue) !important;
}

.rp-crm-form.rp-crm-form .b24-form-control-list-selector-item-title {
    overflow: visible !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    font: 400 14px/1.35 Montserrat, Arial, sans-serif !important;
}

.rp-crm-form.rp-crm-form .b24-form-control-list-selector-item-title span {
    white-space: inherit !important;
    background: transparent !important;
}

.rp-crm-form .about-romana__consultation-form [role="combobox"] > .b24-form-dropdown {
    position: static !important;
}

.rp-crm-form .about-romana__consultation-form .b24-form-dropdown-container {
    position: absolute !important;
    z-index: 5;
    inset: 60px 0 auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
}

.rp-crm-form .about-romana__consultation-form .b24-form-dropdown-container.rp-crm-menu-above {
    inset: auto 0 calc(100% + 6px) !important;
}

.rp-crm-form .about-romana__consultation-form .b24-form-dropdown-header {
    display: none !important;
}

.rp-crm-form .about-romana__consultation-modal-dialog,
.rp-crm-form .rp-crm-popup-panel > .b24-window-popup-wrapper {
    box-sizing: border-box;
    width: min(660px, 100%) !important;
    max-width: 100% !important;
    padding: min(8vw, 78.5px) !important;
    border: .5px solid var(--rp-crm-line) !important;
    border-radius: 16px !important;
    background: #fff !important;
    box-shadow: none !important;
}

.rp-crm-form .about-romana__consultation-form {
    width: 100%;
}

.rp-crm-form.about-romana__consultation-modal,
.rp-crm-popup.b24-window {
    z-index: 10000001 !important;
}

.rp-crm-popup.b24-window {
    position: relative;
}

.rp-crm-form.about-romana__consultation-modal[hidden] {
    display: none;
}

.rp-crm-form .rp-crm-popup-panel > .b24-window-popup-wrapper > div > .b24-window-scrollable > .b24-window-popup-body {
    overflow: visible !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.rp-crm-popup-panel > .b24-window-popup-wrapper > div > .b24-window-scrollable {
    max-height: none !important;
    padding: 0 !important;
    overflow: visible !important;
}

.rp-crm-popup-panel > .b24-window-popup-wrapper {
    max-height: calc(100vh - 32px) !important;
    max-height: calc(100dvh - 32px) !important;
    overflow: auto !important;
    overscroll-behavior: contain;
}

.rp-crm-popup-panel > .b24-window-popup-wrapper > div {
    width: 100%;
}

/* CRM can open its own window before the site adds the popup class. */
@media (min-width: 768px) {
    .b24-window-popup > .b24-window-popup-wrapper:has(> div > .b24-window-scrollable > .b24-window-popup-body > .b24-form-wrapper) {
        border-radius: 16px !important;
        overflow: hidden;
    }
}

.rp-crm-form.rp-crm-form .b24-form-field[hidden] {
    display: none !important;
}

.rp-crm-form.romanaModal_forms {
    box-sizing: border-box;
    position: fixed;
    display: none;
    inset: 50% auto auto 50%;
    z-index: 10000001;
    width: min(660px, calc(100% - 32px));
    height: auto;
    max-height: calc(100dvh - 32px);
    padding: 72px min(8vw, 78.5px);
    transform: translate(-50%, -50%);
    border: .5px solid var(--rp-crm-line);
    border-radius: 16px;
    background: #fff;
    overflow: auto;
    overscroll-behavior: contain;
}

.rp-crm-form.romanaModal_forms-visibility {
    display: block;
}

.rp-crm-form.romanaModal_forms .romanaModal__menu_forms {
    width: 100%;
    margin: 0;
}

.rp-crm-form.romanaModal_forms .tabcontentform {
    display: none;
    width: 100%;
}

.rp-crm-form .romanaModal_forms__closeBtn {
    position: static;
}

.rp-crm-form .romanaModal_forms-wrap {
    min-width: 0;
}

.rp-crm-form .form_obratnyy_zvonok_crm .b24-form-inner-box,
.rp-crm-form .form_zakaz_vopros_crm .b24-form-inner-box {
    bottom: auto;
    padding-bottom: 0;
}

.romanaModal_forms__background.romanaModal_forms-visibilityFon {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 10000000;
    background: #00000040;
}

.romanaModal_forms__background:not(.romanaModal_forms-visibilityFon) {
    display: none;
}

.rp-crm-form #statpred_block {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 502px);
    max-width: 1573px;
    width: calc(100% - 30px);
    gap: clamp(32px, 8vw, 160px);
    margin: 0 auto 64px;
    padding: clamp(38px, 6vw, 83px) clamp(32px, 8vw, 156px);
    border: .5px solid var(--rp-crm-line);
    border-radius: 16px;
    background: #fff;
}

.rp-crm-form .juicy_statpred_text {
    align-items: flex-start;
    gap: 24px;
    color: var(--rp-crm-ink);
    text-align: left;
}

.rp-crm-form .juicy_statpred_text h2 {
    font-size: 32px;
    line-height: 1.2;
    text-transform: none;
}

.rp-crm-form .juicy_statpred_soc_block {
    align-items: flex-start;
    gap: 16px;
}

.rp-crm-form .juicy_statpred_soc {
    justify-content: flex-start;
    gap: 16px;
}

.rp-crm-form .juicy_statpred_soc a {
    position: relative;
    display: block;
    width: 40px;
    height: 40px;
}

.rp-crm-form .juicy_statpred_soc a.rp-crm-max::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #717171;
    mask: url("/local/include/crm-form-design/max-mask.svg") center no-repeat;
}

.rp-crm-form .juicy_statpred_soc a.rp-crm-max img {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    margin: auto;
}

.rp-crm-form #statpred_block .juicy_mob_form,
.rp-crm-form #statpred_block .b24-form {
    --rp-crm-title-size: 20px;
    width: 100%;
    padding: 0;
}

.rp-crm-dealer-dialog {
    box-sizing: border-box;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: max(37px, env(safe-area-inset-top)) max(15px, env(safe-area-inset-right))
             max(38px, env(safe-area-inset-bottom)) max(15px, env(safe-area-inset-left));
    border: 0;
    background: #fff;
    overscroll-behavior: contain;
}

html:has(.rp-crm-dealer-dialog[open]) {
    overflow: hidden;
}

@media (max-width: 767px) {
    .rp-crm-form {
        --rp-crm-title-size: 20px;
        --rp-crm-submit-gap: 24px;
    }

    .rp-crm-form.about-romana__consultation-modal,
    .rp-crm-form .rp-crm-popup-panel {
        inset: 0 !important;
        padding: 0 !important;
    }

    .rp-crm-form .about-romana__consultation-modal-dialog,
    .rp-crm-form .rp-crm-popup-panel > .b24-window-popup-wrapper {
        display: flex !important;
        flex-direction: column;
        width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: none !important;
        margin: 0 !important;
        padding: max(70px, env(safe-area-inset-top)) max(15px, env(safe-area-inset-right))
                 max(70px, env(safe-area-inset-bottom)) max(15px, env(safe-area-inset-left)) !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        border: 0 !important;
        border-radius: 0 !important;
    }

    .rp-crm-form .about-romana__consultation-form {
        flex: 0 0 auto;
        width: 100%;
        margin-block: auto !important;
    }

    .rp-crm-popup-panel > .b24-window-popup-wrapper > div {
        margin-block: auto;
    }

    .rp-crm-form.romanaModal_forms {
        inset: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        padding: max(70px, env(safe-area-inset-top)) max(15px, env(safe-area-inset-right))
                 max(34px, env(safe-area-inset-bottom)) max(15px, env(safe-area-inset-left));
        transform: none;
        border: 0;
        border-radius: 0;
    }

    .rp-crm-form.romanaModal_forms-visibility {
        display: flex;
        flex-direction: column;
    }

    .rp-crm-form.romanaModal_forms .romanaModal_forms-wrap {
        margin-block: auto;
    }

    .rp-crm-form #statpred_block {
        display: flex;
        flex-direction: column;
        gap: 24px;
        width: 100%;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
    }

    .partners-page .rp-crm-form #statpred_block {
        padding: 32px 15px;
    }

    .rp-crm-dealer-dialog.rp-crm-form #statpred_block {
        padding: 0;
    }

    .rp-crm-form .juicy_statpred_text,
    .rp-crm-form .juicy_statpred_soc_block {
        align-items: center;
        text-align: center;
    }

    .rp-crm-form .juicy_statpred_text h2 {
        max-width: 290px;
        font-size: 20px;
    }

    .rp-crm-form .juicy_mob_form .b24-form-header {
        padding-bottom: 16px !important;
    }

    .rp-crm-form .rp-crm-close {
        position: fixed !important;
        top: max(15px, env(safe-area-inset-top)) !important;
        right: max(15px, env(safe-area-inset-right)) !important;
    }
}
