.spg-video-widget {
    --spgvw-accent: #07879a;
    --spgvw-circle-desktop: 156px;
    --spgvw-circle-mobile: 96px;
    --spgvw-side: 24px;
    --spgvw-bottom: 24px;
    position: fixed;
    z-index: 9998;
    left: var(--spgvw-side);
    bottom: var(--spgvw-bottom);
    font-family: inherit;
}

.spg-video-widget *,
.spg-video-widget *::before,
.spg-video-widget *::after {
    box-sizing: border-box;
}

.spg-video-widget [hidden] {
    display: none !important;
}

.spg-video-widget__teaser {
    position: relative;
    display: block;
    width: var(--spgvw-circle-desktop);
    height: var(--spgvw-circle-desktop);
    padding: 0;
    border: 4px solid var(--spgvw-accent);
    border-radius: 50%;
    overflow: hidden;
    background: #111;
    box-shadow: 0 12px 34px rgba(0, 0, 0, .24);
    cursor: pointer;
    isolation: isolate;
    transition: transform .24s ease, box-shadow .24s ease;
}

.spg-video-widget__teaser::before {
    content: "";
    position: absolute;
    z-index: 2;
    inset: -9px;
    border: 2px solid color-mix(in srgb, var(--spgvw-accent) 68%, transparent);
    border-radius: 50%;
    animation: spgvw-pulse 3.5s ease-out infinite;
    pointer-events: none;
}

.spg-video-widget__teaser:hover,
.spg-video-widget__teaser:focus-visible {
    transform: translateY(-4px) scale(1.025);
    box-shadow: 0 16px 42px rgba(0, 0, 0, .3);
    outline: 0;
}

.spg-video-widget__teaser-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.spg-video-widget__teaser-play {
    position: absolute;
    z-index: 3;
    right: 12px;
    bottom: 12px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .64);
    box-shadow: 0 3px 12px rgba(0, 0, 0, .3);
}

.spg-video-widget__teaser-play::after {
    content: "";
    position: absolute;
    top: 10px;
    left: 13px;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 11px solid #fff;
}

.spg-video-widget__panel {
    position: absolute;
    left: 0;
    bottom: 0;
    width: min(370px, calc(100vw - 32px));
    height: min(660px, calc(100vh - 32px));
    height: min(660px, calc(100dvh - 32px));
    overflow: hidden;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .34);
    opacity: 0;
    visibility: hidden;
    transform: translateY(22px) scale(.88);
    transform-origin: left bottom;
    transition: opacity .25s ease, transform .32s cubic-bezier(.2, .8, .2, 1), visibility .25s;
}

.spg-video-widget__panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.spg-video-widget__close,
.spg-video-widget__sound {
    position: absolute;
    z-index: 8;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(14, 18, 20, .66);
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: transform .2s ease, background .2s ease;
}

.spg-video-widget__close {
    top: 12px;
    right: 12px;
    font: 300 28px/1 Arial, sans-serif;
}

.spg-video-widget__sound {
    top: 58px;
    right: 12px;
    font-size: 17px;
}

.spg-video-widget__close:hover,
.spg-video-widget__sound:hover {
    transform: scale(1.08);
    background: rgba(14, 18, 20, .86);
}

.spg-video-widget__stage,
.spg-video-widget__video {
    width: 100%;
    height: 100%;
}

.spg-video-widget__stage {
    position: relative;
    background: #090909;
}

.spg-video-widget__video {
    display: block;
    object-fit: cover;
}

.spg-video-widget__cta,
.spg-video-widget__submit,
.spg-video-widget__replay {
    min-height: 48px;
    border: 0;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.spg-video-widget__cta {
    position: absolute;
    z-index: 5;
    left: 20px;
    right: 20px;
    bottom: 22px;
    padding: 12px 20px;
    color: #fff;
    background: var(--spgvw-accent);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
}

.spg-video-widget__cta:hover,
.spg-video-widget__submit:hover,
.spg-video-widget__replay:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .24);
    filter: brightness(1.05);
}

.spg-video-widget__form-view,
.spg-video-widget__success,
.spg-video-widget__end {
    height: 100%;
    background: #fff;
}

.spg-video-widget__form-view {
    padding: 18px 20px 16px;
    overflow: hidden;
}

.spg-video-widget__back {
    min-height: 28px;
    padding: 0;
    border: 0;
    color: var(--spgvw-accent);
    background: transparent;
    font-size: 13px;
    cursor: pointer;
}

.spg-video-widget__form-view h3 {
    margin: 7px 42px 10px 0;
    font-size: 19px;
    line-height: 1.25;
}

.spg-video-widget__form {
    display: grid;
    gap: 8px;
}

.spg-video-widget__form label {
    display: grid;
    gap: 4px;
    margin: 0;
}

.spg-video-widget__form label > span {
    color: #4d5255;
    font-size: 12px;
    font-weight: 600;
}

.spg-video-widget__form input,
.spg-video-widget__form select {
    width: 100%;
    height: 43px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid #d8dcde;
    border-radius: 12px;
    background: #fff;
    font: inherit;
    box-shadow: none;
}

.spg-video-widget__form input:focus,
.spg-video-widget__form select:focus {
    border-color: var(--spgvw-accent);
    outline: 2px solid color-mix(in srgb, var(--spgvw-accent) 20%, transparent);
}

.spg-video-widget__form input.mage-error,
.spg-video-widget__form select.mage-error {
    border-color: #cc3b36;
}

.spg-video-widget__form-error {
    color: #a32622;
    font-size: 12px;
    line-height: 1.25;
}

.spg-video-widget__submit {
    width: 100%;
    margin-top: 3px;
    padding: 12px 18px;
    color: #fff;
    background: var(--spgvw-accent);
}

.spg-video-widget__honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
}

.spg-video-widget__success,
.spg-video-widget__end {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 34px 24px;
    text-align: center;
}

.spg-video-widget__success h3 {
    margin: 0;
    font-size: 22px;
}

.spg-video-widget__success p {
    margin: 0;
    color: #63696c;
}

.spg-video-widget__check {
    display: grid;
    place-items: center;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    color: #16864a;
    background: #e4f7ec;
    font-size: 35px;
}

.spg-video-widget__replay {
    padding: 12px 24px;
    color: var(--spgvw-accent);
    background: #fff;
    border: 1px solid var(--spgvw-accent);
}

.spg-video-widget__end {
    position: relative;
    color: #fff;
    background:
        linear-gradient(rgba(0, 0, 0, .42), rgba(0, 0, 0, .68)),
        #111;
}

.spg-video-widget__end .spg-video-widget__cta {
    position: static;
    width: 100%;
}

.spg-video-widget__end .spg-video-widget__replay {
    width: 100%;
    color: #fff;
    border-color: rgba(255, 255, 255, .7);
    background: rgba(0, 0, 0, .28);
}

@keyframes spgvw-pulse {
    0%, 66% {
        opacity: 0;
        transform: scale(.96);
    }
    72% {
        opacity: .75;
    }
    100% {
        opacity: 0;
        transform: scale(1.18);
    }
}

@media (max-width: 767px) {
    .spg-video-widget {
        left: max(12px, env(safe-area-inset-left));
        bottom: max(var(--spgvw-bottom), calc(env(safe-area-inset-bottom) + 12px));
    }

    .spg-video-widget__teaser {
        width: var(--spgvw-circle-mobile);
        height: var(--spgvw-circle-mobile);
        border-width: 3px;
    }

    .spg-video-widget__teaser-play {
        right: 7px;
        bottom: 7px;
        width: 28px;
        height: 28px;
    }

    .spg-video-widget__teaser-play::after {
        top: 8px;
        left: 11px;
        border-top-width: 6px;
        border-bottom-width: 6px;
        border-left-width: 9px;
    }

    .spg-video-widget__panel {
        left: 0;
        bottom: 0;
        width: min(360px, calc(100vw - 24px));
        height: min(620px, calc(100vh - 24px));
        height: min(620px, calc(100dvh - 24px));
        border-radius: 20px;
    }

    .spg-video-widget__form-view {
        padding: 13px 16px 12px;
    }

    .spg-video-widget__form-view h3 {
        margin-top: 4px;
        margin-bottom: 7px;
        font-size: 17px;
    }

    .spg-video-widget__form {
        gap: 6px;
    }

    .spg-video-widget__form input,
    .spg-video-widget__form select {
        height: 40px;
    }

    .spg-video-widget__submit {
        min-height: 44px;
    }
}

@media (max-height: 620px) {
    .spg-video-widget__panel {
        height: calc(100vh - 16px);
        height: calc(100dvh - 16px);
    }

    .spg-video-widget__form-view {
        overflow-y: auto;
        overscroll-behavior: contain;
    }
}

@media (prefers-reduced-motion: reduce) {
    .spg-video-widget__teaser::before {
        animation: none;
    }

    .spg-video-widget__teaser,
    .spg-video-widget__panel,
    .spg-video-widget__cta,
    .spg-video-widget__submit,
    .spg-video-widget__replay {
        transition: none;
    }
}
