html.is-survey-open,
body.is-survey-open {
    overflow: hidden;
}

.survey-popup-layer {
    --survey-pink: #ee1c83;
    --survey-pink-dark: #b70b5d;
    --survey-ink: #252024;
    --survey-muted: #756d72;
    --survey-soft: #fbf8fa;
    --survey-blush: #fff1f7;
    --survey-line: #ebe3e7;
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: grid;
    place-items: center;
    padding: 16px;
    font-family: "Avenir Next", Avenir, "Helvetica Neue", sans-serif;
}

.survey-popup-layer[hidden] {
    display: none !important;
}

.survey-popup-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(35, 27, 32, .38);
    cursor: default;
    opacity: 0;
    backdrop-filter: blur(4px);
    transition: opacity .2s ease;
}

.survey-popup {
    position: relative;
    width: min(430px, calc(100vw - 32px));
    max-height: min(640px, calc(100dvh - 32px));
    overflow: hidden;
    border: 1px solid rgba(74, 54, 65, .12);
    border-radius: 20px;
    background: #fff;
    box-shadow:
        0 24px 70px rgba(35, 18, 27, .22),
        0 2px 10px rgba(35, 18, 27, .08);
    color: var(--survey-ink);
    opacity: 0;
    outline: none;
    transform: translateY(12px) scale(.985);
    transition: opacity .2s ease, transform .24s cubic-bezier(.2, .75, .2, 1);
}

.survey-popup-layer.is-open .survey-popup-backdrop,
.survey-popup-layer.is-open .survey-popup {
    opacity: 1;
}

.survey-popup-layer.is-open .survey-popup {
    transform: translateY(0) scale(1);
}

.survey-popup-close {
    position: absolute;
    z-index: 4;
    top: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--survey-line);
    border-radius: 50%;
    background: rgba(255, 255, 255, .96);
    color: #665d62;
    cursor: pointer;
    transition: border-color .16s ease, color .16s ease, background .16s ease;
}

.survey-popup-close:hover,
.survey-popup-close:focus-visible {
    border-color: rgba(238, 28, 131, .4);
    background: var(--survey-blush);
    color: var(--survey-pink-dark);
    outline: none;
}

.survey-popup-content {
    max-height: min(640px, calc(100dvh - 32px));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 20px 22px 22px;
    scrollbar-width: thin;
    scrollbar-color: #d8cbd2 transparent;
}

.survey-popup-loading,
.survey-popup-unavailable {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    min-height: 210px;
    text-align: center;
}

.survey-popup-loading span {
    width: 26px;
    height: 26px;
    border: 2px solid #efe5ea;
    border-top-color: var(--survey-pink);
    border-radius: 50%;
    animation: survey-spin .75s linear infinite;
}

.survey-popup-loading p,
.survey-popup-unavailable p {
    margin: 0;
    color: var(--survey-muted);
    font-size: 12px;
    font-weight: 400;
}

.survey-popup-unavailable strong {
    font-size: 20px;
    font-weight: 500;
}

.survey-popup-step {
    display: grid;
    gap: 16px;
    animation: survey-step-enter .24s ease both;
}

.survey-widget-header {
    display: grid;
    gap: 9px;
    padding-right: 40px;
}

.survey-widget-meta {
    display: flex;
    align-items: center;
    min-height: 26px;
    color: var(--survey-muted);
    font-size: 11px;
    font-weight: 400;
}

.survey-widget-brand {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin-right: 8px;
    padding: 0 8px;
    border-radius: 7px;
    background: var(--survey-pink);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .08em;
}

.survey-widget-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.survey-widget-count {
    margin-left: auto;
    padding-left: 10px;
    color: #94898f;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.survey-widget-progress {
    position: relative;
    height: 3px;
    overflow: hidden;
    border-radius: 999px;
    background: #f0e8ec;
}

.survey-widget-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--survey-pink);
    transition: width .24s ease;
}

.survey-popup-heading {
    display: grid;
    gap: 5px;
    padding-right: 26px;
}

.survey-popup-heading h2 {
    margin: 0;
    color: var(--survey-ink);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -.025em;
    line-height: 1.18;
}

.survey-popup-heading p {
    margin: 0;
    color: var(--survey-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
}

.survey-form {
    display: grid;
    gap: 14px;
}

.survey-form-questions {
    display: grid;
}

.survey-question {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 14px;
    border: 1px solid var(--survey-line);
    border-radius: 14px;
    background: var(--survey-soft);
}

.survey-question.has-error {
    border-color: rgba(183, 11, 93, .45);
    background: #fff6f9;
    box-shadow: 0 0 0 3px rgba(238, 28, 131, .06);
}

.survey-question legend,
.survey-question-title {
    display: block;
    margin: 0;
    padding: 0;
    color: var(--survey-ink);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.survey-question-description {
    margin: -4px 0 1px;
    color: var(--survey-muted);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
}

.survey-required-mark {
    color: var(--survey-pink);
}

.survey-stars {
    direction: rtl;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    width: 100%;
}

.survey-stars input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.survey-stars label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 42px;
    border: 1px solid #e9dfe4;
    border-radius: 10px;
    background: #fff;
    color: #d8cdd3;
    cursor: pointer;
    font-size: 25px;
    line-height: 1;
    transition: color .14s ease, border-color .14s ease, background .14s ease, transform .14s ease;
}

.survey-stars label:hover,
.survey-stars label:hover ~ label,
.survey-stars input:checked ~ label {
    border-color: rgba(238, 28, 131, .34);
    background: var(--survey-blush);
    color: var(--survey-pink);
}

.survey-stars label:hover {
    transform: translateY(-1px);
}

.survey-stars input:focus-visible + label {
    outline: 2px solid var(--survey-pink);
    outline-offset: 2px;
}

.survey-field-input,
.survey-field-textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #ded3d9;
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: var(--survey-ink);
    font: inherit;
    font-size: 13px;
    font-weight: 400;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.survey-field-textarea {
    min-height: 82px;
    resize: vertical;
}

.survey-field-input:focus,
.survey-field-textarea:focus {
    border-color: rgba(238, 28, 131, .58);
    box-shadow: 0 0 0 3px rgba(238, 28, 131, .07);
}

.survey-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.survey-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 7px 9px;
    border: 1px solid #e7dce2;
    border-radius: 10px;
    background: #fff;
    color: var(--survey-ink);
    cursor: pointer;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.3;
}

.survey-option:hover {
    border-color: rgba(238, 28, 131, .34);
}

.survey-option:has(input:checked) {
    border-color: rgba(238, 28, 131, .48);
    background: var(--survey-blush);
}

.survey-option input {
    accent-color: var(--survey-pink);
}

.survey-contact-grid {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--survey-line);
    border-radius: 14px;
    background: var(--survey-soft);
}

.survey-contact-grid label {
    display: grid;
    gap: 5px;
    color: #5f565b;
    font-size: 11px;
    font-weight: 500;
}

.survey-form-error {
    margin: 0;
    padding: 8px 10px;
    border-radius: 9px;
    background: #fff0f3;
    color: #9a224c;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
}

.survey-form-error[hidden] {
    display: none;
}

.survey-step-navigation {
    display: grid;
    grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr);
    gap: 8px;
}

.survey-next-button,
.survey-submit,
.survey-back-button,
.survey-questionnaire-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 500;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}

.survey-next-button,
.survey-submit {
    border: 1px solid var(--survey-pink);
    background: var(--survey-pink);
    color: #fff;
    box-shadow: 0 8px 18px rgba(238, 28, 131, .16);
}

.survey-next-button:hover,
.survey-submit:hover {
    border-color: var(--survey-pink-dark);
    background: var(--survey-pink-dark);
    transform: translateY(-1px);
}

.survey-back-button {
    border: 1px solid var(--survey-line);
    background: #fff;
    color: #665d62;
}

.survey-back-button:hover {
    border-color: #d6c8cf;
    background: var(--survey-soft);
    color: var(--survey-ink);
}

.survey-next-button:disabled,
.survey-submit:disabled,
.survey-questionnaire-button:disabled {
    cursor: wait;
    opacity: .62;
}

.survey-questionnaire-offer {
    display: grid;
    gap: 6px;
    padding-top: 12px;
    border-top: 1px solid var(--survey-line);
}

.survey-questionnaire-button {
    width: 100%;
    border: 1px solid rgba(238, 28, 131, .28);
    background: var(--survey-blush);
    color: var(--survey-pink-dark);
}

.survey-questionnaire-button:hover {
    border-color: rgba(238, 28, 131, .48);
    background: #ffe7f1;
}

.survey-questionnaire-caption {
    margin: 0 auto;
    max-width: 340px;
    color: var(--survey-muted);
    font-size: 10px;
    font-weight: 400;
    line-height: 1.4;
    text-align: center;
}

.survey-success {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 13px;
    min-height: 320px;
    text-align: center;
    animation: survey-step-enter .26s ease both;
}

.survey-success-mark {
    position: relative;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--survey-blush);
    color: var(--survey-pink);
    font-size: 20px;
    font-weight: 500;
}

.survey-success-mark::after {
    position: absolute;
    inset: -5px;
    border: 1px dashed rgba(238, 28, 131, .36);
    border-radius: 50%;
    content: "";
    animation: survey-success-ring 18s linear infinite;
}

.survey-success h2 {
    max-width: 340px;
    margin: 5px 0 -3px;
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -.025em;
    line-height: 1.15;
}

.survey-success p {
    max-width: 330px;
    margin: 0;
    color: var(--survey-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.45;
}

.survey-promo {
    display: grid;
    gap: 7px;
    width: min(280px, 100%);
    padding: 12px;
    border: 1px dashed rgba(238, 28, 131, .4);
    border-radius: 12px;
    background: #fffbfd;
}

.survey-promo span {
    color: var(--survey-muted);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.survey-promo strong {
    color: var(--survey-pink-dark);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 25px;
    font-weight: 500;
    letter-spacing: .13em;
    line-height: 1.15;
}

.survey-copy-button,
.survey-success-close {
    min-height: 40px;
    border-radius: 9px;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 500;
}

.survey-copy-button {
    border: 1px solid rgba(238, 28, 131, .24);
    background: var(--survey-blush);
    color: var(--survey-pink-dark);
}

.survey-copy-button.is-copied {
    border-color: #81cdb3;
    background: #e9f8f2;
    color: #087750;
}

.survey-success-close {
    padding: 0 20px;
    border: 1px solid var(--survey-ink);
    background: var(--survey-ink);
    color: #fff;
}

@keyframes survey-spin {
    to { transform: rotate(360deg); }
}

@keyframes survey-step-enter {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes survey-success-ring {
    to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
    .survey-popup-layer {
        align-items: end;
        padding: 0;
    }

    .survey-popup {
        width: 100%;
        max-height: min(78dvh, 620px);
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 20px 20px 0 0;
        transform: translateY(18px);
    }

    .survey-popup-content {
        max-height: min(78dvh, 620px);
        padding: 18px 16px 22px;
    }

    .survey-popup-heading h2 {
        font-size: 21px;
    }

    .survey-options {
        grid-template-columns: 1fr;
    }

    .survey-stars {
        gap: 6px;
    }

    .survey-stars label {
        height: 44px;
    }

    .survey-step-navigation {
        grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
    }

    .survey-next-button,
    .survey-submit,
    .survey-back-button,
    .survey-questionnaire-button {
        min-height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .survey-popup,
    .survey-popup-backdrop,
    .survey-popup-step,
    .survey-success {
        transition: none;
        animation: none;
    }
}
