/* ===========================================
   POPUP - CALLBACK WIDGET (bottom-right)
   =========================================== */

.popup-widget {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 900;
    width: 420px;
    max-width: calc(100vw - 32px);
    background: var(--color-section-bg);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    padding: 32px 28px;
    animation: popupSlideIn 0.4s ease;
}

.popup-widget--visible {
    display: flex;
    flex-direction: column;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Close button */
.popup-widget__close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 28px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.popup-widget__close:hover {
    color: #fff;
}

/* Content layout */
.popup-widget__body {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.popup-widget__info {
    flex: 1;
    min-width: 0;
}

/* Operator image */
.popup-widget__operator {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

.popup-widget__operator img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Typography */
.popup-widget__title {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    line-height: 1.2;
}

.popup-widget__subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 16px;
    line-height: 1.4;
}

/* Form */
.popup-widget__form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.popup-widget__field {
    display: flex;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--border-radius);
    padding: 0 14px;
    height: 50px;
    background: #fff;
    transition: border-color 0.2s;
}

.popup-widget__field:focus-within {
    border-color: var(--color-main-button);
}

.popup-widget__field--error {
    border-color: var(--color-header-button);
}

.popup-widget__flag {
    font-size: 20px;
    margin-right: 10px;
    flex-shrink: 0;
}

.popup-widget__input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 17px;
    font-family: inherit;
    color: var(--color-text-primary);
    background: transparent;
    height: 100%;
}

.popup-widget__input::placeholder {
    color: #bbb;
}

.popup-widget__submit {
    width: 100%;
    height: 50px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.3px;
    border: none;
    border-radius: var(--border-radius);
    background: var(--color-header-button);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
}

.popup-widget__submit:hover {
    background: var(--color-header-button-hover);
}

.popup-widget__submit:active {
    transform: scale(0.98);
}

.popup-widget__submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.popup-widget__error {
    color: #ffcdd2;
    font-size: 13px;
    text-align: left;
    margin-top: -4px;
}

/* Success state */
.popup-widget__success {
    text-align: center;
    padding: 12px 0;
}

.popup-widget__success-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.popup-widget__success-text {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.85);
}

/* Privacy */
.popup-widget__privacy {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 2px;
}

.popup-widget__privacy a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: underline;
}

/* ===========================================
   RESPONSIVE
   =========================================== */

@media (max-width: 480px) {
    .popup-widget {
        bottom: 16px;
        right: 16px;
        left: 16px;
        width: auto;
        padding: 24px 20px;
        border-radius: 12px;
    }

    .popup-widget__operator {
        width: 80px;
        height: 80px;
    }

    .popup-widget__title {
        font-size: 20px;
    }

    .popup-widget__subtitle {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .popup-widget__field {
        height: 48px;
    }

    .popup-widget__submit {
        height: 48px;
        font-size: 16px;
    }
}

@media (max-width: 360px) {
    .popup-widget__body {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .popup-widget__operator {
        order: -1;
    }
}
