/*
 * Sarafanovo Emailform popup redesign.
 * Release: 2026-08-09.2
 * Scope is intentionally limited to #emailform_popup so embedded forms keep
 * their existing plugin styling.
 */

#emailform_popup .overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483646;
    background: rgba(30, 17, 36, 0.68);
    opacity: 1;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

#emailform_popup .visible {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 2147483647;
    box-sizing: border-box;
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    margin: 0;
    padding: 34px 36px 32px;
    overflow: auto;
    overscroll-behavior: contain;
    transform: translate(-50%, -50%);
    color: #2a2a2a;
    border: 1px solid rgba(131, 34, 186, 0.12);
    border-radius: 24px;
    background-color: #fbf8fc;
    background-image:
        linear-gradient(90deg, rgba(255, 253, 250, 0.99) 0%, rgba(255, 253, 250, 0.96) 43%, rgba(255, 253, 250, 0.28) 58%, rgba(255, 253, 250, 0) 72%),
        url("../images/promo-popup-fabric-v2.jpg?v=20260809-2");
    background-position: center, center;
    background-repeat: no-repeat;
    background-size: cover;
    box-shadow: 0 28px 80px rgba(38, 17, 45, 0.28), 0 8px 28px rgba(38, 17, 45, 0.14);
    font-family: onest-nd, Onest, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    text-align: left;
    isolation: isolate;
}

#emailform_popup .visible::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 122px;
    height: 5px;
    border-radius: 0 0 6px 0;
    background: #fbbb0d;
}

#emailform_popup .ef-user-template,
#emailform_popup .ef-plugin-template {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    width: 100%;
    max-width: 358px;
}

#emailform_popup .ef-title {
    margin: 0 0 10px;
    padding: 0 44px 0 0;
    color: #2a2a2a;
    font-size: 28px;
    font-weight: 750;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-shadow: none;
    text-wrap: balance;
}

#emailform_popup .ef-text {
    margin: 0 0 22px;
    color: #625968;
    font-size: 15px;
    line-height: 1.5;
    text-shadow: none;
}

#emailform_popup .ef-input-wrap {
    margin: 0 0 11px;
}

#emailform_popup .ef-name-value,
#emailform_popup .ef-email-value,
#emailform_popup .ef-phone-value {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    height: 48px;
    padding: 0 15px;
    color: #2a2a2a;
    border: 1px solid #ded7e2;
    border-radius: 12px;
    outline: none;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 1px 2px rgba(42, 42, 42, 0.04);
    font: inherit;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

#emailform_popup input[placeholder]::-webkit-input-placeholder {
    color: #776f7b;
    opacity: 1;
}

#emailform_popup input[placeholder]::placeholder {
    color: #776f7b;
    opacity: 1;
}

#emailform_popup .ef-name-value:hover,
#emailform_popup .ef-email-value:hover,
#emailform_popup .ef-phone-value:hover {
    border-color: #c9bdd0;
}

#emailform_popup .ef-name-value:focus,
#emailform_popup .ef-email-value:focus,
#emailform_popup .ef-phone-value:focus {
    border-color: #8322ba;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(131, 34, 186, 0.12);
}

#emailform_popup .ef-plugin-template input.ef-input-error {
    border-color: #c81938;
    box-shadow: 0 0 0 4px rgba(200, 25, 56, 0.1);
}

#emailform_popup .ef-pdn {
    margin: 4px 0 14px;
    color: #6d6472;
    font-size: 12px;
    line-height: 1.4;
    text-shadow: none;
}

#emailform_popup .ef-pdn label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
}

#emailform_popup .ef-pdn-cbox {
    position: static;
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin: 1px 0 0;
    accent-color: #8322ba;
}

#emailform_popup .ef-pdn a {
    color: #7620a9;
    text-decoration-color: rgba(118, 32, 169, 0.38);
    text-underline-offset: 2px;
}

#emailform_popup .ef-pdn a:hover {
    color: #5f158d;
    text-decoration-color: currentColor;
}

#emailform_popup .ef-pdn.ef-pdn-error {
    color: #c81938;
}

#emailform_popup input[type="submit"].ef-submit-input {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    height: 50px;
    max-height: none;
    padding: 0 20px;
    cursor: pointer;
    color: #fff;
    border: 0;
    border-radius: 12px;
    outline: none;
    background: #8322ba;
    box-shadow: 0 8px 20px rgba(131, 34, 186, 0.24);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    text-shadow: none;
    transition: background-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    appearance: none;
}

#emailform_popup input[type="submit"].ef-submit-input:hover {
    background: #721aa6;
    box-shadow: 0 10px 24px rgba(131, 34, 186, 0.3);
    transform: translateY(-1px);
}

#emailform_popup input[type="submit"].ef-submit-input:focus-visible {
    box-shadow: 0 0 0 4px rgba(251, 187, 13, 0.42), 0 8px 20px rgba(131, 34, 186, 0.24);
}

#emailform_popup input[type="submit"].ef-submit-input:active {
    box-shadow: 0 5px 14px rgba(131, 34, 186, 0.24);
    transform: translateY(0);
}

#emailform_popup input[type="submit"].ef-submit-input:disabled {
    cursor: wait;
    background: #aa76c4;
    box-shadow: none;
    transform: none;
}

#emailform_popup .ef-slose {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    color: transparent;
    border: 1px solid rgba(42, 42, 42, 0.09);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    background-image: none;
    box-shadow: 0 6px 18px rgba(42, 42, 42, 0.12);
    text-indent: -9999px;
    transition: background-color 0.18s ease, transform 0.18s ease;
    touch-action: manipulation;
}

#emailform_popup .ef-slose::before,
#emailform_popup .ef-slose::after {
    content: "";
    position: absolute;
    left: 12px;
    top: 21px;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: #2a2a2a;
}

#emailform_popup .ef-slose::before {
    transform: rotate(45deg);
}

#emailform_popup .ef-slose::after {
    transform: rotate(-45deg);
}

#emailform_popup .ef-slose:hover {
    background: #fff;
    transform: rotate(4deg) scale(1.04);
}

#emailform_popup .ef-slose:focus-visible {
    outline: 3px solid rgba(251, 187, 13, 0.78);
    outline-offset: 2px;
}

#emailform_popup.ef-subscribe-success .ef-title,
#emailform_popup.ef-subscribe-success .ef-text {
    color: #4b1768;
}

@media (prefers-reduced-motion: reduce) {
    #emailform_popup *,
    #emailform_popup *::before,
    #emailform_popup *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

@media screen and (max-width: 630px) {
    #emailform_popup .visible {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
        max-height: calc(100dvh - 24px);
        padding: 28px 24px 24px;
        border-radius: 20px;
        background-color: #fbf8fc;
        background-image:
            linear-gradient(180deg, rgba(255, 253, 250, 0.22) 0%, rgba(251, 248, 252, 0.9) 31%, #fbf8fc 47%),
            url("../images/promo-popup-fabric-v2.jpg?v=20260809-2");
        background-position: center, top center;
        background-repeat: no-repeat;
        background-size: cover, 100% auto;
        text-align: left;
    }

    #emailform_popup .visible::after {
        width: 92px;
    }

    #emailform_popup .ef-user-template,
    #emailform_popup .ef-plugin-template {
        max-width: none;
    }

    #emailform_popup .ef-title {
        padding-right: 54px;
        font-size: 24px;
    }

    #emailform_popup .ef-text {
        margin-bottom: 18px;
        font-size: 14px;
    }

    #emailform_popup .ef-name-value,
    #emailform_popup .ef-email-value,
    #emailform_popup .ef-phone-value {
        font-size: 16px;
    }

    #emailform_popup .ef-slose {
        top: 12px;
        right: 12px;
        box-shadow: 0 4px 14px rgba(42, 42, 42, 0.1);
    }
}

@media screen and (max-width: 380px), screen and (max-height: 610px) {
    #emailform_popup .visible {
        padding: 23px 18px 18px;
        border-radius: 17px;
    }

    #emailform_popup .ef-title {
        margin-bottom: 7px;
        font-size: 21px;
    }

    #emailform_popup .ef-text {
        margin-bottom: 13px;
        line-height: 1.4;
    }

    #emailform_popup .ef-input-wrap {
        margin-bottom: 8px;
    }

    #emailform_popup .ef-name-value,
    #emailform_popup .ef-email-value,
    #emailform_popup .ef-phone-value {
        height: 44px;
    }

    #emailform_popup .ef-pdn {
        margin-bottom: 10px;
    }

    #emailform_popup input[type="submit"].ef-submit-input {
        height: 46px;
    }

    #emailform_popup .ef-slose {
        width: 44px;
        height: 44px;
        top: 9px;
        right: 9px;
    }

    #emailform_popup .ef-slose::before,
    #emailform_popup .ef-slose::after {
        left: 12px;
        top: 21px;
        width: 18px;
    }
}
