#realtime-message-popup {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(3, 22, 41, .68);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    animation: ncmPopupFadeIn .22s ease-out both;
}

#realtime-message-popup > div {
    position: relative;
    width: min(480px, 100%);
    max-height: min(720px, calc(100vh - 48px));
    overflow: auto;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(1, 24, 48, .35), 0 5px 18px rgba(1, 24, 48, .16);
    color: #243746;
    font-family: Arial, sans-serif;
    animation: ncmPopupRiseIn .3s cubic-bezier(.2, .75, .25, 1) both;
}

#realtime-message-popup > div::before {
    position: absolute;
    top: 0;
    right: 0;
    width: 180px;
    height: 180px;
    border: 1px solid rgba(241, 184, 52, .58);
    border-radius: 50%;
    box-shadow: 0 0 0 18px rgba(241, 184, 52, .08), 0 0 0 38px rgba(255, 255, 255, .04);
    content: "";
    pointer-events: none;
    transform: translate(52px, -108px);
}

#realtime-message-popup h2 {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 25px 24px 24px;
    background: linear-gradient(135deg, #073861 0%, #125b8f 72%, #1b6d9b 100%);
    color: #fff;
    font-size: 21px;
    line-height: 1.25;
}

#realtime-message-popup h2::before {
    display: block;
    width: fit-content;
    margin-bottom: 15px;
    padding: 6px 10px;
    border: 1px solid rgba(241, 184, 52, .55);
    border-radius: 11px;
    background: rgba(241, 184, 52, .14);
    color: #f5c756;
    content: "✦  PEMBERITAHUAN SISTEM";
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
}

#realtime-message-popup h2::after {
    position: absolute;
    top: 27px;
    right: 24px;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, .1);
    color: #f5c756;
    content: "N";
    font-size: 20px;
    font-weight: 700;
}

#realtime-message-popup img {
    display: block;
    width: calc(100% - 48px);
    max-height: 260px;
    margin: 22px 24px 0;
    border: 1px solid #dbe5ec;
    border-radius: 11px;
    background: #f4f7f9;
    object-fit: contain;
}

#realtime-message-popup p {
    margin: 0;
    padding: 22px 24px 0;
    color: #3c4d59;
    font-size: 15px;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

#realtime-message-popup label {
    display: block;
    margin: 22px 24px 8px;
    padding-top: 18px;
    border-top: 1px solid #e7edf1;
    color: #29495f;
    font-size: 13px;
    font-weight: 700;
}

#realtime-message-popup input {
    box-sizing: border-box;
    display: block;
    width: calc(100% - 48px);
    height: 48px;
    margin: 0 24px;
    padding: 11px 14px;
    border: 1px solid #c7d7e1;
    border-radius: 9px;
    outline: none;
    background: #fbfdfe;
    color: #243746;
    font-size: 16px;
    letter-spacing: .08em;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

#realtime-message-popup input::placeholder {
    color: #a2afb8;
    letter-spacing: 0;
}

#realtime-message-popup input:focus {
    border-color: #2683b9;
    box-shadow: 0 0 0 3px rgba(38, 131, 185, .14);
    background: #fff;
}

#realtime-message-popup input.invalid {
    border-color: #cf5b5b !important;
    box-shadow: 0 0 0 3px rgba(207, 91, 91, .12);
}

#realtime-message-popup .ncm-popup-error {
    display: flex;
    min-height: 20px;
    align-items: center;
    gap: 8px;
    margin: 10px 24px 0;
    color: #cf3434;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: .04em;
}

#realtime-message-popup .ncm-popup-error[hidden] {
    display: none !important;
}

#realtime-message-popup .ncm-popup-error::before {
    display: inline-grid;
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    content: "!";
    font-size: 12px;
    line-height: 1;
}

#realtime-message-popup .ncm-popup-error--active {
    animation: ncmPopupInvalid .38s ease-out both;
}

#realtime-message-popup button {
    display: flex;
    width: calc(100% - 48px);
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin: 18px 24px 24px;
    border: 0;
    border-radius: 9px;
    background: linear-gradient(135deg, #1f77b4, #145c8d);
    box-shadow: 0 7px 15px rgba(31, 119, 180, .2);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

#realtime-message-popup button::before {
    color: #f5c756;
    content: "✓";
    font-size: 16px;
}

#realtime-message-popup .ncm-popup-card:not(.ncm-popup-card--return-home) button::before {
    content: none;
}

#realtime-message-popup .ncm-popup-card--return-home button::before {
    content: "↩";
}

#realtime-message-popup .ncm-popup-card--return-home .ncm-popup-message {
    padding-bottom: 2px;
}

#realtime-message-popup button:hover {
    background: linear-gradient(135deg, #2687c4, #17699d);
    box-shadow: 0 10px 19px rgba(31, 119, 180, .28);
    transform: translateY(-1px);
}

#realtime-message-popup button:focus-visible {
    outline: 3px solid rgba(241, 184, 52, .75);
    outline-offset: 2px;
}

#realtime-message-popup .ncm-popup-image-warning {
    margin: 22px 24px 0 !important;
    padding: 11px 12px !important;
    border: 1px solid #f1dda3;
    border-radius: 9px !important;
    background: #fff9e8 !important;
    color: #876b1e !important;
    font-size: 12px;
    line-height: 1.45;
}

@keyframes ncmPopupFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes ncmPopupRiseIn {
    from { opacity: 0; transform: translateY(12px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ncmPopupInvalid {
    0% { opacity: .35; transform: translateX(-7px); }
    45% { opacity: 1; transform: translateX(5px); }
    70% { transform: translateX(-2px); }
    100% { opacity: 1; transform: translateX(0); }
}

@media (max-width: 520px) {
    #realtime-message-popup {
        padding: 14px;
    }

    #realtime-message-popup > div {
        max-height: calc(100vh - 28px);
        border-radius: 15px;
    }

    #realtime-message-popup h2 {
        padding: 20px 18px 19px;
        font-size: 19px;
    }

    #realtime-message-popup h2::after {
        top: 22px;
        right: 18px;
    }

    #realtime-message-popup img {
        width: calc(100% - 36px);
        margin-right: 18px;
        margin-left: 18px;
    }

    #realtime-message-popup p {
        padding-right: 18px;
        padding-left: 18px;
    }

    #realtime-message-popup label {
        margin-right: 18px;
        margin-left: 18px;
    }

    #realtime-message-popup input,
    #realtime-message-popup button {
        width: calc(100% - 36px);
        margin-right: 18px;
        margin-left: 18px;
    }

    #realtime-message-popup .ncm-popup-error {
        margin-right: 18px;
        margin-left: 18px;
        align-items: flex-start;
        flex-wrap: wrap;
    }

    #realtime-message-popup .ncm-popup-image-warning {
        margin-right: 18px !important;
        margin-left: 18px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    #realtime-message-popup,
    #realtime-message-popup > div {
        animation: none;
    }

    #realtime-message-popup button {
        transition: none;
    }

    #realtime-message-popup .ncm-popup-error--active {
        animation: none;
    }
}