/* Aurica Figma forms: layout glue around the existing Xleb form components. */

.popup-content:has(.aurica-form-popup),
.modal-content:has(.aurica-form-success) {
    box-sizing: border-box;
    min-height: 100vh;
    margin: 0 0 0 auto !important;
    padding: 32px 36px 64px;
    background: var(--pageBg, #fffbf6);
    color: var(--contentPrimaryColor, #0a2753);
    -webkit-overflow-scrolling: touch;
}

.popup-content:has(.aurica-form-popup) .mfp-close,
.modal-content:has(.aurica-form-success) .mfp-close {
    top: 17px;
    right: 20px;
    width: 40px;
    height: 40px;
    color: var(--contentPrimaryColor, #0a2753);
    font-size: 30px;
    font-weight: 300;
    opacity: 0.5;
}

.aurica-form-popup > .vc_column_container {
    min-width: 0;
}

.aurica-form-popup .titleXXS {
    padding-right: 48px;
}

.aurica-form-popup .xleb-form,
.aurica-collaboration-template .xleb-form {
    gap: var(--gapX5, 20px);
}

.aurica-form-popup .radio-group,
.aurica-collaboration-template .radio-group {
    gap: var(--gapX5, 20px);
}

.aurica-form-popup .radio-group > label,
.aurica-collaboration-template .radio-group > label {
    margin-top: var(--textStopS);
    margin-bottom: var(--textSbottomS);
    font-size: var(--textSsize);
    line-height: var(--textSheightS);
}

.aurica-form-popup .radio-item label,
.aurica-collaboration-template .radio-item label {
    box-sizing: border-box;
    min-height: 36px;
    padding: 7px 16px;
    font-size: var(--textSsize, 16px);
    line-height: var(--textSheightT, 20px);
}

.aurica-form-popup .radio-item + .radio-item label,
.aurica-collaboration-template .radio-item + .radio-item label {
    margin-left: -1px;
}

.aurica-form-popup .required,
.aurica-collaboration-template .required {
    display: none;
}

.aurica-form-popup .terms-field,
.aurica-collaboration-template .terms-field {
    align-items: flex-start;
}

.aurica-form-popup .terms-label,
.aurica-collaboration-template .terms-label {
    padding-top: 4px;
    margin-top: var(--textXStopT);
    margin-bottom: var(--textXSbottomT);
    font-size: var(--textXSsize, 14px);
    line-height: var(--textXSheightT, 16px);
}

.aurica-form-popup .terms-label p,
.aurica-collaboration-template .terms-label p {
    margin-top: var(--textXStopT);
    margin-bottom: var(--textXSbottomT);
    font-size: var(--textXSsize);
    line-height: var(--textXSheightT);
}

.aurica-form-popup--catalog .terms-label,
.aurica-form-popup--catalog .terms-label p,
.aurica-form-popup--materials .terms-label,
.aurica-form-popup--materials .terms-label p {
    margin-top: var(--textStopT);
    margin-bottom: var(--textSbottomT);
    font-size: var(--textSsize);
    line-height: var(--textSheightT);
}

.aurica-form-popup .terms-label a,
.aurica-collaboration-template .terms-label a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.aurica-form-popup .submit-input,
.aurica-collaboration-template .submit-input {
    box-sizing: border-box;
    width: fit-content;
    min-height: 48px;
    padding: 13px 20px;
    border: 1px solid var(--btnDefaultBg, #0a2753);
    border-radius: 4px;
    color: var(--btnDefaultColor, #fff);
    background: var(--btnDefaultBg, #0a2753);
    font-family: inherit;
    font-size: var(--textSsize, 16px);
    line-height: var(--textSheightT, 20px);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.aurica-form-popup .submit-input:disabled,
.aurica-collaboration-template .submit-input:disabled {
    cursor: default;
    opacity: 0.55;
}

.custom-dropdown-container {
    background: transparent;
}

.aurica-select-invalid .custom-dropdown-selected {
    border-bottom-color: var(--inputErrorBorder, #b42318) !important;
}

.aurica-form-popup .custom-dropdown-options,
.aurica-collaboration-template .custom-dropdown-options {
    z-index: 20;
    max-height: none;
    overflow: visible;
    border: 0;
    border-bottom: 1px solid var(--inputBorder, rgba(10, 39, 83, 0.25));
    background: var(--pageBg, #fffbf6);
}

.aurica-form-popup .custom-dropdown-selected,
.aurica-collaboration-template .custom-dropdown-selected {
    box-sizing: border-box;
    height: 48px;
    align-items: center;
    padding: 14px 0;
    color: var(--primary500, #0a2753);
    font-size: var(--textSsize);
    line-height: var(--textSheightT);
}

.aurica-form-popup .custom-dropdown-selected.aurica-role-placeholder,
.aurica-collaboration-template .custom-dropdown-selected.aurica-role-placeholder {
    color: var(--primaryOpacity500, rgba(10, 39, 83, 0.5));
}

.aurica-form-popup .custom-option,
.aurica-collaboration-template .custom-option {
    box-sizing: border-box;
    display: flex;
    height: 44px;
    align-items: center;
    padding: 0;
    border-bottom: 1px solid var(--inputBorder, rgba(10, 39, 83, 0.25));
    color: var(--primary500, #0a2753);
    background: var(--pageBg, #fffbf6);
    font-size: var(--textSsize);
    line-height: var(--textSheightT);
}

.aurica-form-popup .custom-option:last-child,
.aurica-collaboration-template .custom-option:last-child {
    border-bottom: 0;
}

.aurica-form-popup .custom-option.selected,
.aurica-collaboration-template .custom-option.selected {
    color: var(--primary500, #0a2753);
    background: var(--pageBg, #fffbf6);
}

.aurica-form-popup .xleb-form.underline.sep-yes .custom-option:hover,
.aurica-collaboration-template .xleb-form.underline.sep-yes .custom-option:hover,
.aurica-form-popup .custom-option:hover,
.aurica-collaboration-template .custom-option:hover {
    color: var(--primaryOpacity500, rgba(10, 39, 83, 0.5));
    background: var(--pageBg, #fffbf6);
}

.aurica-order-back {
    display: inline-flex;
    padding: 0;
    border: 0;
    color: var(--contentPrimaryColor, #0a2753);
    background: transparent;
    font-family: inherit;
    font-size: var(--textSsize, 16px);
    line-height: var(--textSheightT, 20px);
    cursor: pointer;
}

.aurica-order-delivery-fields {
    display: flex;
    flex-direction: column;
    gap: var(--gapX5, 20px);
}

.aurica-order-delivery-fields .city-suggestions-container {
    margin-bottom: 0;
}

.aurica-order-pickup-fields {
    display: flex;
    flex-direction: column;
    gap: var(--gapX2, 8px);
}

.aurica-order-pickup-fields[hidden],
.aurica-order-delivery-fields[hidden] {
    display: none !important;
}

.aurica-order-pickup-fields p {
    margin: 0;
}

.aurica-form-success {
    display: flex;
    min-height: calc(100dvh - 64px);
    align-items: flex-start;
    justify-content: flex-start;
}

.aurica-form-success__inner {
    display: flex;
    width: min(527px, 100%);
    flex-direction: column;
    align-items: flex-start;
}

.aurica-form-success__icon {
    margin-bottom: var(--gapX6, 24px);
    color: #21a453;
    font-size: 32px;
    line-height: 1;
}

.aurica-form-success__inner .titleXXS + .textS {
    margin-top: var(--gapX5, 20px);
}

.aurica-form-success .aurica-form-success__inner > .textS > p {
    margin-top: var(--textStopT);
    margin-bottom: var(--textSbottomT);
    font-size: var(--textSsize);
    line-height: var(--textSheightT);
}

.aurica-form-success__inner > .aurica-form-success__schedule.textS {
    display: flex;
    flex-direction: column;
    gap: var(--gapX5, 20px);
    margin-top: var(--gapX8, 32px);
}

@media (min-width: 768px) {
    .popup-content:has(.aurica-form-popup),
    .modal-content:has(.aurica-form-success) {
        width: min(714px, 50vw) !important;
        max-width: 714px !important;
    }

    .aurica-form-success {
        position: relative;
    }

    .aurica-form-success__inner {
        position: absolute;
        top: calc(50% - var(--gapX27, 108px));
        transform: translateY(-50%);
    }

    .aurica-form-success--catalog .aurica-form-success__inner,
    .aurica-form-success--materials .aurica-form-success__inner {
        width: min(642px, 100%);
    }

    .aurica-form-popup .vc_inner .vc_column_container > .textS > p,
    .aurica-collaboration-template__intro .textS > p {
        margin-top: var(--textStopT);
        margin-bottom: var(--textSbottomT);
        font-size: var(--textSsize);
        line-height: var(--textSheightT);
    }

    .aurica-form-popup .xleb-form.underline.m input:not(.submit-input, .terms, .input-box input[type="checkbox"]),
    .aurica-collaboration-template .xleb-form.underline.m input:not(.submit-input, .terms, .input-box input[type="checkbox"]) {
        box-sizing: border-box;
        height: 48px;
        margin-top: 0;
        margin-bottom: 0;
        padding: 14px 20px 13px 0;
        font-size: var(--textSsize);
        line-height: var(--textSheightT);
    }

    .aurica-form-popup:not(.aurica-form-popup--order) .xleb-form > .radio-group,
    .aurica-collaboration-template .xleb-form > .radio-group {
        margin-top: var(--gapX3, 12px);
    }

    .aurica-form-popup:not(.aurica-form-popup--order) .xleb-form > .terms-field,
    .aurica-collaboration-template .xleb-form > .terms-field {
        margin-top: var(--gapX1, 4px);
    }

    .aurica-form-popup:not(.aurica-form-popup--order) .xleb-form > .input-box:has(> .submit-input),
    .aurica-collaboration-template .xleb-form > .input-box:has(> .submit-input) {
        margin-top: var(--gapX5, 20px);
    }

    .aurica-form-popup--order > .vc_column_container > .titleXXS {
        min-height: var(--titleXXSheightT);
    }

    .aurica-form-popup--order > .vc_column_container > .aurica-order-back {
        margin-top: var(--textStopT);
        margin-bottom: var(--textSbottomT);
        font-size: var(--textSsize);
        line-height: var(--textSheightT);
    }

    .aurica-form-popup--order .xleb-form > .radio-group {
        gap: var(--gapX5);
    }

    .aurica-form-popup--order .xleb-form > .radio-group > label {
        margin-top: var(--textStopS);
        margin-bottom: var(--textSbottomS);
        font-size: var(--textSsize);
        line-height: var(--textSheightS);
    }

    .aurica-form-popup--order .radio-item label {
        font-size: var(--textSsize);
        line-height: var(--textSheightT);
    }

    .aurica-form-popup--order .xleb-form > .radio-group:has(input[name="order_delivery_method"]) {
        margin-top: var(--gapX5, 20px);
    }

    .aurica-form-popup--order .aurica-order-pickup-fields {
        display: flex;
        flex-direction: column;
        gap: var(--gapX5);
        margin-top: var(--gapX3, 12px);
    }

    .aurica-form-popup--order .aurica-order-pickup-fields::before,
    .aurica-form-popup--order .aurica-order-pickup-fields::after {
        margin-top: var(--textStopS);
        margin-bottom: var(--textSbottomS);
        color: var(--contentPrimaryColor);
        font-size: var(--textSsize);
        line-height: var(--textSheightS);
    }

    .aurica-form-popup--order .aurica-order-pickup-fields::before {
        content: attr(data-pickup-label);
    }

    .aurica-form-popup--order .aurica-order-pickup-fields::after {
        content: attr(data-pickup-address);
    }

    .aurica-form-popup--order .xleb-form > .radio-group:has(input[name="order_contact_method"]) {
        margin-top: var(--gapX10);
    }

    .aurica-form-popup--order .xleb-form > .terms-field {
        margin-top: var(--gapX1, 4px);
        font-size: var(--textXSsize);
        line-height: var(--textXSheightT);
    }

    .aurica-form-popup--order .terms-label,
    .aurica-form-popup--order .terms-label p {
        margin-top: var(--textXStopT);
        margin-bottom: var(--textXSbottomT);
        font-size: var(--textXSsize);
        line-height: var(--textXSheightT);
    }

    .aurica-form-popup--order .xleb-form > .input-box:has(> .submit-input) {
        margin-top: var(--gapX5, 20px);
    }

    .aurica-form-popup--order .submit-input {
        font-size: var(--textSsize);
        line-height: var(--textSheightT);
    }

}

.aurica-collaboration-template__intro {
    max-width: none;
}

@media (max-width: 767px) {
    .aurica-form-popup,
    .aurica-form-success,
    .aurica-collaboration-template {
        /* Parent theme overrides Xleb's mobile Text/S tight token to 14px. */
        --textSheightT: 16px;
    }

    html.aurica-form-modal-open,
    body.aurica-form-modal-open {
        width: 100%;
        overflow: hidden !important;
        overscroll-behavior: none;
        touch-action: none;
    }

    body.aurica-form-modal-open > .mfp-bg {
        position: fixed !important;
        inset: 0 !important;
        width: 100%;
        height: 100vh !important;
        height: 100dvh !important;
    }

    .mfp-wrap:has(.aurica-form-popup),
    .mfp-wrap:has(.aurica-form-success) {
        position: fixed !important;
        inset: 0 !important;
        width: 100%;
        height: 100vh !important;
        height: 100dvh !important;
        overflow: hidden !important;
    }

    .mfp-wrap:has(.aurica-form-popup) .mfp-container,
    .mfp-wrap:has(.aurica-form-success) .mfp-container {
        height: 100%;
        padding: 0;
    }

    .mfp-wrap:has(.aurica-form-popup) .mfp-container::before,
    .mfp-wrap:has(.aurica-form-success) .mfp-container::before {
        display: none;
    }

    .mfp-wrap:has(.aurica-form-popup) .mfp-content,
    .mfp-wrap:has(.aurica-form-success) .mfp-content {
        display: block;
        height: 100%;
        margin: 0;
    }

    .mfp-wrap .mfp-content > .popup-content:has(.aurica-form-popup),
    .mfp-wrap .mfp-content > .modal-content:has(.aurica-form-success) {
        height: 100%;
        min-height: 100%;
        max-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }

    .popup-content:has(.aurica-form-popup),
    .modal-content:has(.aurica-form-success) {
        width: 100%;
        max-width: none;
        min-height: 100dvh;
        margin: 0 !important;
        padding: 28px 16px calc(32px + env(safe-area-inset-bottom)) !important;
        border-radius: 0 !important;
    }

    .popup-content:has(.aurica-form-popup) .mfp-close,
    .modal-content:has(.aurica-form-success) .mfp-close {
        top: 12px;
        right: 6px;
    }

    .aurica-form-popup .vc_column_container.vc_col-sm-10 {
        width: 100%;
        grid-column: 1 / -1;
    }

    .aurica-form-popup > .vc_column_container > .titleXXS {
        box-sizing: border-box;
        min-height: 22px;
    }

    .aurica-form-popup .vc_inner .vc_column_container > .textS > p,
    .aurica-form-success__inner > .textS > p,
    .aurica-collaboration-template__intro .textS > p {
        margin-top: var(--textStopT);
        margin-bottom: var(--textSbottomT);
        font-size: var(--textSsize);
        line-height: var(--textSheightT);
    }

    .aurica-form-popup .xleb-form,
    .aurica-collaboration-template .xleb-form {
        gap: var(--gapX4, 16px);
    }

    .aurica-form-popup .xleb-form.underline.m input:not(.submit-input, .terms, .input-box input[type="checkbox"]),
    .aurica-collaboration-template .xleb-form.underline.m input:not(.submit-input, .terms, .input-box input[type="checkbox"]) {
        box-sizing: border-box;
        height: 44px;
        padding: 14px 20px 14px 0;
        font-size: var(--textSsize);
        line-height: var(--textSheightT);
    }

    .aurica-form-popup .custom-dropdown-selected,
    .aurica-collaboration-template .custom-dropdown-selected {
        height: 44px;
        padding: 14px 0;
        font-size: var(--textSsize);
        line-height: var(--textSheightT);
    }

    .aurica-form-popup .custom-option,
    .aurica-collaboration-template .custom-option {
        height: 44px;
        font-size: var(--textSsize);
        line-height: var(--textSheightT);
    }

    .aurica-form-popup .radio-group,
    .aurica-collaboration-template .radio-group {
        gap: var(--gapX4, 16px);
    }

    .aurica-form-popup .radio-group > label,
    .aurica-collaboration-template .radio-group > label {
        margin-top: var(--textStopT);
        margin-bottom: var(--textSbottomT);
        font-size: var(--textSsize);
        line-height: var(--textSheightT);
    }

    .aurica-form-popup .radio-item label,
    .aurica-collaboration-template .radio-item label {
        min-height: 32px;
        padding: 7px 12px;
        font-size: var(--textSsize);
        line-height: var(--textSheightT);
    }

    .aurica-form-popup .xleb-form > .radio-group,
    .aurica-collaboration-template .xleb-form > .radio-group {
        margin-top: var(--gapX3, 12px);
    }

    .aurica-form-popup--order .xleb-form > .radio-group {
        margin-top: var(--gapX1, 4px);
    }

    .aurica-form-popup .xleb-form > .terms-field,
    .aurica-collaboration-template .xleb-form > .terms-field {
        margin-top: var(--gapX2, 8px);
    }

    .aurica-form-popup .xleb-form > .input-box:has(> .submit-input),
    .aurica-collaboration-template .xleb-form > .input-box:has(> .submit-input) {
        margin-top: var(--gapX6, 24px);
    }

    .aurica-form-popup .terms-field input[type="checkbox"],
    .aurica-collaboration-template .terms-field input[type="checkbox"] {
        box-sizing: border-box;
        width: 20px;
        height: 20px;
        min-width: 20px;
        min-height: 20px;
    }

    .aurica-form-popup .terms-label,
    .aurica-form-popup .terms-label p,
    .aurica-collaboration-template .terms-label,
    .aurica-collaboration-template .terms-label p {
        margin-top: var(--textStopT);
        margin-bottom: var(--textSbottomT);
        font-size: var(--textSsize);
        line-height: var(--textSheightT);
    }

    .aurica-form-popup .submit-input,
    .aurica-collaboration-template .submit-input {
        box-sizing: border-box;
        width: 100%;
        min-height: 44px;
        height: 44px;
        padding: 13px 20px;
        font-size: var(--textSsize);
        line-height: var(--textSheightT);
    }

    .aurica-form-popup--order .radio-group:has(input[name="order_delivery_method"]) .radio-buttons {
        width: 100%;
    }

    .aurica-form-popup--order .radio-group:has(input[name="order_delivery_method"]) .radio-item {
        flex: 1 1 50%;
    }

    .aurica-form-popup--order .radio-group:has(input[name="order_delivery_method"]) .radio-item label {
        width: 100%;
    }

    .aurica-order-back {
        min-height: 16px;
        margin-top: var(--textStopT);
        margin-bottom: var(--textSbottomT);
        font-size: var(--textSsize);
        line-height: var(--textSheightT);
    }

    .aurica-collaboration-template {
        display: flex !important;
        flex-direction: column;
        gap: var(--gapX8, 32px);
    }

    .aurica-collaboration-template > .vc_column_container {
        width: 100% !important;
        grid-column: 1 / -1 !important;
    }

    .aurica-collaboration-template__gutter {
        display: none !important;
    }

    .aurica-form-success {
        box-sizing: border-box;
        min-height: calc(100dvh - 56px);
        padding-top: 140px;
    }
}

@media (max-width: 480px) {
    .aurica-form-popup .radio-item label,
    .aurica-collaboration-template .radio-item label {
        padding-right: 12px;
        padding-left: 12px;
        font-size: var(--textSsize);
    }

    .aurica-form-popup .radio-buttons,
    .aurica-collaboration-template .radio-buttons {
        max-width: 100%;
    }
}

.mfp-content .popup-content .mfp-close{
    position: absolute;
    right: var(--outsideGap);
    top: var(--outsideGap);
    width: unset;
    height: unset;
    line-height: unset;
}


.mfp-content .popup-content .mfp-close::before{
    font-size: var(--gapX7);
}


span.field-error{
    position: absolute;
    top: calc(100% + var(--gapX2));
}

@media(max-width:991px){
    span.field-error{
        position: absolute;
        top: calc(50% + var(--gapX3));
        padding-top: var(--gapX4);
    }
}
