.avesta-popup-message {
    position: fixed;
    z-index: 2147482500;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .52);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .22s ease, visibility .22s ease;
    backdrop-filter: blur(8px) saturate(.72);
    -webkit-backdrop-filter: blur(8px) saturate(.72);
}

.avesta-popup-message.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.avesta-popup-dialog {
    position: relative;
    display: flex;
    width: min(432px, 100%);
    max-height: min(760px, calc(100dvh - 40px));
    overflow: hidden;
    flex-direction: column;
    border: 0;
    border-radius: 20px;
    background: #fff;
    color: #172033;
    box-shadow: 0 26px 80px rgba(15, 23, 42, .32);
    transform: translateY(10px) scale(.98);
    transition: transform .24s cubic-bezier(.2, .8, .2, 1);
}

.avesta-popup-dialog::before {
    position: absolute;
    z-index: 2;
    top: 0;
    right: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #f59e0b 0%, #f97316 48%, #ef4444 100%);
    content: '';
}

.avesta-popup-message.is-visible .avesta-popup-dialog {
    transform: translateY(0) scale(1);
}

.avesta-popup-content {
    overflow: auto;
    padding: 27px 28px 25px;
}

.avesta-popup-close {
    position: absolute;
    z-index: 3;
    top: 14px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 31px;
    height: 31px;
    border: 0;
    border-radius: 50%;
    background: #f1f3f6;
    color: #7b8493;
    font: inherit;
    font-size: 18px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: color .18s ease, background-color .18s ease, transform .18s ease;
}

.avesta-popup-close:hover {
    background: #e7ebf0;
    color: #172033;
    transform: rotate(4deg);
}

.avesta-popup-title {
    max-width: calc(100% - 42px);
    margin: 0 42px 16px 0;
    padding-bottom: 16px;
    border-bottom: 1px solid #e4e7ec;
    color: #172033;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -.015em;
}

.avesta-popup-image-frame {
    overflow: hidden;
    border-radius: 12px;
    background: #f4f6f8;
}

.avesta-popup-image-frame img {
    display: block;
    width: 100%;
    max-height: min(520px, 64dvh);
    object-fit: contain;
}

.avesta-popup-image-link {
    display: block;
}

.avesta-popup-description {
    margin: 0;
    color: #596476;
    font-size: 14px;
    line-height: 1.65;
    white-space: pre-wrap;
}

.avesta-popup-footer {
    display: flex;
    justify-content: center;
    padding: 14px 22px 18px;
    border-top: 1px solid #f0f1f3;
    background: #fafafa;
}

.avesta-popup-action {
    display: inline-flex;
    min-width: 180px;
    min-height: 37px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 11px;
    background: #172033;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 7px 16px rgba(23, 32, 51, .18);
    transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.avesta-popup-action span {
    font-size: 14px;
    line-height: 1;
}

.avesta-popup-action:hover {
    background: #0f172a;
    box-shadow: 0 9px 20px rgba(23, 32, 51, .24);
    transform: translateY(-1px);
}

@media (max-width: 560px) {
    .avesta-popup-message {
        align-items: flex-end;
        padding: 12px;
    }

    .avesta-popup-dialog {
        max-height: calc(100dvh - 24px);
        border-radius: 17px;
    }

    .avesta-popup-content {
        padding: 25px 21px 22px;
    }

    .avesta-popup-footer {
        padding-right: 16px;
        padding-left: 16px;
    }

    .avesta-popup-action {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .avesta-popup-message,
    .avesta-popup-dialog,
    .avesta-popup-close,
    .avesta-popup-action {
        transition: none;
    }
}
