:root {
    --callback-blue: #8a000b;
    --callback-blue-dark: #bb2b36;
    --callback-blue-light: #ad1918;
    --callback-white: #efe8d4;
    --callback-close: #292929;
}
.callback-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;

    font-family: Arial, Helvetica, sans-serif;
}

/* Круглая кнопка */

.callback-widget__phone {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 58px;
    height: 58px;
    padding: 0;

    border: 5px solid rgba(138, 0, 11, 0.45);
    border-radius: 50%;

    color: var(--callback-white);
    background: var(--callback-blue);

    box-shadow:
            0 7px 15px rgba(138, 0, 11, 0.3),
            0 0 0 5px rgba(138, 0, 11, 0.18);

    cursor: pointer;

    animation: callbackPulse 1.8s infinite;

    transition:
            transform 0.2s ease,
            opacity 0.25s ease;
}

.callback-widget__phone:hover {
    transform: scale(1.08);
}

.callback-widget__phone::before,
.callback-widget__phone::after {
    content: "";

    position: absolute;
    inset: -8px;

    border: 1px solid rgba(138, 0, 11, 0.5);
    border-radius: 50%;

    pointer-events: none;

    animation: callbackWave 2s infinite;
}

.callback-widget__phone::after {
    animation-delay: 1s;
}

.callback-widget__phone svg {
    width: 28px;
    height: 28px;

    fill: currentColor;

    animation: callbackShake 2.6s infinite;
}

/* Раскрытая форма */

.callback-widget__panel {
    position: absolute;
    right: 0;
    bottom: 0;

    display: flex;
    align-items: center;
    gap: 14px;

    width: min(620px, calc(100vw - 30px));
    min-height: 78px;
    padding: 10px 14px 10px 24px;

    border-radius: 40px;

    color: var(--callback-white);
    background: var(--callback-blue);

    box-shadow: 0 10px 20px rgba(138, 0, 11, 0.3);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transform: translateY(15px) scale(0.95);
    transform-origin: right bottom;

    transition:
            opacity 0.3s ease,
            visibility 0.3s ease,
            transform 0.3s ease;
}

.callback-widget.is-open .callback-widget__panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    transform: translateY(0) scale(1);
}

.callback-widget.is-open .callback-widget__phone {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.callback-widget__title {
    flex: 0 0 145px;

    margin: 0;

    color: var(--callback-white);

    font-size: 17px;
    font-weight: 500;
    line-height: 1.2;
}

.callback-widget__form {
    display: flex;
    align-items: center;
    gap: 12px;

    flex: 1;
    min-width: 0;
}

.callback-widget__field {
    display: flex;
    align-items: center;

    flex: 1;
    min-width: 210px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.45);
}

.callback-widget__flag {
    flex: 0 0 auto;

    margin-right: 8px;

    font-size: 20px;
    line-height: 1;
}

.callback-widget__input {
    width: 100%;
    min-width: 0;
    padding: 8px 0;

    border: 0;
    outline: 0;

    color: var(--callback-white);
    background: transparent;

    font-size: 20px;
    font-weight: 700;
    background-image: unset!important
}

.callback-widget__input::placeholder {
    color: rgba(255, 255, 255, 0.9);
}

.callback-widget__submit {
    flex: 0 0 auto;

    min-width: 155px;
    min-height: 54px;
    padding: 10px 20px;

    border: 0;
    border-radius: 30px;

    color: var(--callback-white);
    background: var(--callback-blue-light);

    font-size: 17px;
    font-weight: 700;

    cursor: pointer;

    transition:
            background-color 0.2s ease,
            transform 0.2s ease;
}

.callback-widget__submit:hover {
    background: var(--callback-blue-dark);
    transform: translateY(-1px);
}

.callback-widget__close {
    position: absolute;
    top: -23px;
    right: -7px;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 24px;
    height: 24px;
    padding: 0;

    border: 0;
    border-radius: 50%;

    color: var(--callback-white);
    background: var(--callback-close);

    font-size: 20px;
    line-height: 1;

    cursor: pointer;
}

@keyframes callbackPulse {
    0%,
    100% {
        box-shadow:
                0 7px 15px rgba(138, 0, 11, 0.3),
                0 0 0 5px rgba(138, 0, 11, 0.18);
    }

    50% {
        box-shadow:
                0 8px 18px rgba(138, 0, 11, 0.35),
                0 0 0 10px rgba(138, 0, 11, 0.07);
    }
}

@keyframes callbackWave {
    0% {
        opacity: 0.7;
        transform: scale(0.8);
    }

    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

@keyframes callbackShake {
    0%,
    43%,
    100% {
        transform: rotate(0);
    }

    47% {
        transform: rotate(-12deg);
    }

    51% {
        transform: rotate(12deg);
    }

    55% {
        transform: rotate(-8deg);
    }

    59% {
        transform: rotate(8deg);
    }

    63% {
        transform: rotate(0);
    }
}

@media (max-width: 650px) {
    .callback-widget {
        right: 14px;
        bottom: 14px;
    }

    .callback-widget__panel {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;

        width: calc(100vw - 28px);
        padding: 20px;

        border-radius: 22px;
    }

    .callback-widget__title {
        flex-basis: auto;
        font-size: 18px;
    }

    .callback-widget__form {
        align-items: stretch;
        flex-direction: column;
    }

    .callback-widget__field {
        min-width: 0;
    }

    .callback-widget__input {
        font-size: 19px;
    }

    .callback-widget__submit {
        width: 100%;
        min-width: 0;
        min-height: 48px;
    }

    .callback-widget__close {
        top: -10px;
        right: -5px;
    }
}
.callback-success {
    width: 100%;
    padding: 42px 30px 36px;
    text-align: center;
    color: #171717;
    background: radial-gradient(circle at top, rgba(138, 0, 11, 0.15), transparent 45%), #ffffff;
}
.callback-success__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    margin: 0 auto 20px;
    color: #fbfbfb;
    background: #8a000b;
    border-radius: 50%;
    box-shadow: 0 12px 30px rgba(138, 0, 11, 0.15);
}
.callback-success__label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    margin-bottom: 14px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #171717;
    background: rgb(27 118 189 / 15%);
    border-radius: 50px;
}
.callback-success__title {
    margin: 0 0 14px;
    font-size: 30px;
    font-weight: 800;
    line-height: 1.15;
    color: #171717;
}
.callback-success__text {
    margin: 0 auto 24px;
    max-width: 390px;
    font-size: 16px;
    line-height: 1.6;
    color: #6d6d6d;
}
.callback-success__timer {
    position: relative;
    max-width: 390px;
    margin: 0 auto;
    padding: 20px 24px;
    overflow: hidden;
    color: #ffffff;
    background: #171717;
    border-radius: 14px;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.15);
}
.callback-success__timer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 7px;
    height: 100%;
    background: #8a000b;
}
.callback-success__timer-caption {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.65);
}
.callback-success__timer-value {
    display: block;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.2;
    color: white;
}
.callback-success__notice {
    margin: 18px 0 0;
    font-size: 13px;
    color: #8a8a8a;
}
@media (max-width: 576px) {
    .callback-success {
        padding: 34px 20px 30px;
    }
    .callback-success__icon {
        width: 68px;
        height: 68px;
    }
    .callback-success__title {
        font-size: 25px;
    }
    .callback-success__timer-value {
        font-size: 21px;
    }
}
