.cfwv,
.cfwv * {
    box-sizing: border-box;
}

.cfwv {
    --cfwv-accent: #4A81FF;
    --cfwv-secondary: #1FA67B;
    position: fixed;
    z-index: 99990;
    bottom: 24px;
    max-width: min(370px, calc(100vw - 32px));
    font-family: inherit;
}

.cfwv--right { right: 24px; }
.cfwv--left { left: 24px; }

.cfwv__launcher {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 17px 10px 10px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--cfwv-accent) 24%, white);
    border-radius: 999px;
    background: linear-gradient(135deg, #ffffff 0%, #f6f9ff 100%);
    color: #17213b;
    box-shadow: 0 15px 42px rgba(20, 43, 86, .20);
    cursor: pointer;
    text-align: left;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    -webkit-tap-highlight-color: transparent;
}

.cfwv__launcher::after {
    content: "";
    position: absolute;
    right: 20px;
    bottom: 0;
    left: 88px;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: linear-gradient(90deg, var(--cfwv-accent), var(--cfwv-secondary));
    opacity: .92;
}

.cfwv__launcher:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--cfwv-secondary) 55%, white);
    box-shadow: 0 19px 50px rgba(20, 43, 86, .25);
}

.cfwv__launcher:focus-visible,
.cfwv-modal__close:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--cfwv-accent) 65%, white);
    outline-offset: 3px;
}

.cfwv__visual {
    position: relative;
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    overflow: visible;
    border-radius: 50%;
    background: color-mix(in srgb, var(--cfwv-accent) 12%, white);
    color: var(--cfwv-accent);
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px var(--cfwv-secondary), 0 8px 22px rgba(31, 166, 123, .20);
}

.cfwv__visual--image {
    overflow: visible;
}

.cfwv__visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.cfwv__placeholder,
.cfwv__placeholder svg {
    display: block;
    width: 100%;
    height: 100%;
}

.cfwv__placeholder {
    overflow: hidden;
    border-radius: 50%;
}

.cfwv__play {
    position: absolute;
    right: -4px;
    bottom: -3px;
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: var(--cfwv-accent);
    color: #fff;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--cfwv-secondary);
}

.cfwv__play svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.cfwv__copy {
    display: grid;
    gap: 3px;
    min-width: 0;
    line-height: 1.25;
}

.cfwv__copy strong {
    display: block;
    color: var(--cfwv-accent);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .01em;
}

.cfwv__copy small {
    display: block;
    max-width: 235px;
    color: #566176;
    font-size: 12px;
    line-height: 1.38;
}

.cfwv-modal[hidden] { display: none !important; }

.cfwv-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    padding: 24px;
}

.cfwv-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 17, 39, .82);
    backdrop-filter: blur(6px);
}

.cfwv-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    max-height: calc(100vh - 48px);
    overflow: auto;
    border: 1px solid color-mix(in srgb, var(--cfwv-accent) 20%, white);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 30px 95px rgba(0, 0, 0, .42);
}

.cfwv-modal__header {
    position: relative;
    padding: 22px 64px 20px 24px;
    background: linear-gradient(100deg, color-mix(in srgb, var(--cfwv-accent) 8%, white), color-mix(in srgb, var(--cfwv-secondary) 8%, white));
}

.cfwv-modal__header::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--cfwv-accent), var(--cfwv-secondary));
}

.cfwv-modal__header h2 {
    margin: 0;
    color: #14213d;
    font-size: clamp(20px, 3vw, 30px);
    line-height: 1.2;
}

.cfwv-modal__intro {
    max-width: 760px;
    margin: 9px 0 0;
    color: #566176;
    font-size: 14px;
    line-height: 1.55;
}

.cfwv-modal__close {
    position: absolute;
    top: 13px;
    right: 14px;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--cfwv-accent) 22%, white);
    border-radius: 50%;
    background: color-mix(in srgb, var(--cfwv-accent) 10%, white);
    color: var(--cfwv-accent);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, transform .2s ease;
}

.cfwv-modal__close:hover {
    background: var(--cfwv-secondary);
    color: #fff;
    transform: rotate(5deg);
}

.cfwv-modal__media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #0b1631;
}

.cfwv-modal__media iframe,
.cfwv-modal__media video {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
}

.cfwv-modal__placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    isolation: isolate;
    overflow: hidden;
    padding: 32px;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, #101c3b 0%, #164e71 48%, #14755f 100%);
}

.cfwv-modal__placeholder::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .36;
    background:
        radial-gradient(circle at 28% 25%, var(--cfwv-accent) 0, transparent 34%),
        radial-gradient(circle at 78% 75%, var(--cfwv-secondary) 0, transparent 36%);
}

.cfwv-modal__placeholder > img {
    position: absolute;
    inset: 0;
    z-index: -3;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cfwv-modal__placeholder::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background: rgba(7, 17, 39, .60);
}

.cfwv-modal__placeholder-icon {
    display: grid;
    place-items: center;
    width: 86px;
    height: 86px;
    margin: 0 auto 20px;
    padding: 18px;
    border: 5px solid rgba(255, 255, 255, .78);
    border-radius: 50%;
    background: var(--cfwv-accent);
    color: #fff;
    box-shadow: 0 0 0 8px rgba(31, 166, 123, .38), 0 18px 38px rgba(0, 0, 0, .28);
}

.cfwv-modal__placeholder-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.cfwv-modal__placeholder-copy {
    position: relative;
    display: grid;
    gap: 7px;
    max-width: 540px;
}

.cfwv-modal__placeholder-copy strong {
    font-size: clamp(22px, 4vw, 38px);
    line-height: 1.15;
}

.cfwv-modal__placeholder-copy strong::after {
    content: "";
    display: block;
    width: 74px;
    height: 4px;
    margin: 14px auto 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--cfwv-accent), var(--cfwv-secondary));
}

.cfwv-modal__placeholder-copy span {
    color: rgba(255, 255, 255, .86);
    font-size: 15px;
    line-height: 1.5;
}

body.cfwv-modal-open {
    overflow: hidden;
}

@media (max-width: 767px) {
    .cfwv[data-show-mobile="0"] {
        display: none !important;
    }

    .cfwv {
        right: 16px;
        left: 16px;
        bottom: 16px;
        max-width: none;
    }

    .cfwv__launcher {
        width: auto;
        max-width: 100%;
        margin-left: auto;
        padding-right: 14px;
    }

    .cfwv--left .cfwv__launcher {
        margin-right: auto;
        margin-left: 0;
    }

    .cfwv__visual {
        flex-basis: 54px;
        width: 54px;
        height: 54px;
    }

    .cfwv__copy small {
        max-width: min(220px, calc(100vw - 130px));
    }

    .cfwv-modal {
        padding: 14px;
    }

    .cfwv-modal__dialog {
        border-radius: 15px;
        max-height: calc(100vh - 28px);
    }

    .cfwv-modal__header {
        padding: 18px 55px 17px 18px;
    }
}

@media (max-width: 420px) {
    .cfwv__copy small { display: none; }
    .cfwv__launcher { padding: 8px 14px 8px 8px; }
    .cfwv__launcher::after { left: 69px; }
    .cfwv__visual { flex-basis: 48px; width: 48px; height: 48px; }
    .cfwv-modal__placeholder { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .cfwv__launcher,
    .cfwv-modal__close {
        transition: none;
    }
}
