@keyframes popupFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popupScaleIn {
    from { transform: translateY(12px) scale(0.97); opacity: 0; filter: blur(2px); }
    to { transform: translateY(0) scale(1); opacity: 1; filter: blur(0); }
}
.modern-blur-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: popupFadeIn 0.18s ease-out;
    padding: 22px;
    box-sizing: border-box;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.modern-popup-card {
    position: relative;
    overflow: hidden;
    width: min(370px, 100%);
    padding: 28px;
    border-radius: 24px;
    box-sizing: border-box;
    text-align: center;
    color: #f5f5f7;
    font-family: Poppins, system-ui, -apple-system, sans-serif;
    background: linear-gradient(145deg, rgba(28, 28, 33, 0.98), rgba(12, 12, 15, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(255, 62, 62, 0.08);
    animation: popupScaleIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.modern-popup-card::before {
    content: "";
    position: absolute;
    inset: -1px -1px auto -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 62, 62, 0.55), transparent);
}
.modern-popup-title {
    margin: 0 0 10px;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.modern-popup-message {
    margin: 0 0 22px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.95rem;
    line-height: 1.55;
}
.modern-popup-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin: 0 auto 14px;
    border-radius: 50%;
    color: #fff;
    font-weight: 900;
    background: linear-gradient(135deg, #ff343d, #c91822);
    box-shadow: 0 14px 34px rgba(255, 52, 61, 0.24);
}
.modern-popup-actions {
    display: flex;
    gap: 10px;
}
.modern-popup-card--logout {
    width: min(420px, 100%);
    padding: 32px;
}
.modern-popup-icon--logout {
    width: 48px;
    height: 48px;
    margin-bottom: 18px;
    border: 1px solid rgba(255, 89, 96, 0.28);
    background: rgba(255, 52, 61, 0.11);
    box-shadow: 0 15px 38px rgba(255, 52, 61, 0.18);
}
.modern-popup-icon--logout svg {
    width: 23px;
    height: 23px;
}
.modern-popup-card--logout .modern-popup-title {
    font-size: 1.32rem;
}
.modern-popup-card--logout .modern-popup-message {
    max-width: 310px;
    margin: 0 auto 26px;
}
.modern-popup-actions--logout {
    gap: 12px;
}
.modern-popup-actions--logout .modern-btn-pop {
    min-height: 54px;
    padding: 13px 18px;
}
.modern-popup-actions--logout .modern-btn-secondary {
    flex: 0.85;
}
.modern-popup-actions--logout .modern-btn-logout {
    flex: 1.15;
    white-space: nowrap;
}
@media (max-width: 420px) {
    .modern-popup-card--logout {
        padding: 26px 22px;
    }
    .modern-popup-actions--logout {
        flex-direction: column-reverse;
    }
}
.modern-btn-pop {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: none;
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.14s ease, filter 0.14s ease, background-color 0.14s ease;
}
.modern-btn-pop:active { transform: scale(0.98); }
.modern-btn-pop:focus-visible,
.modern-popup-input:focus-visible {
    outline: 2px solid rgba(255, 62, 62, 0.55);
    outline-offset: 2px;
}
.modern-btn-primary {
    background: linear-gradient(135deg, #ff343d, #c91822);
    box-shadow: 0 12px 28px rgba(255, 52, 61, 0.22);
}
.modern-btn-primary:hover { filter: brightness(1.08); }
.modern-btn-secondary {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f1f1f3;
}
.modern-btn-secondary:hover { background: rgba(255, 255, 255, 0.11); }
.modern-btn-ok {
    background: rgba(58, 199, 120, 0.12);
    border: 1px solid rgba(58, 199, 120, 0.35);
    font-size: 1.15rem;
    line-height: 1;
}
.modern-btn-ok:hover { background: rgba(58, 199, 120, 0.2); }
.modern-popup-input {
    width: 100%;
    padding: 13px;
    margin-bottom: 20px;
    box-sizing: border-box;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    background: rgba(255, 255, 255, 0.055);
    color: #fff;
    font-size: 1rem;
    text-align: center;
    outline: none;
}
.modern-popup-input:focus { border-color: rgba(255, 62, 62, 0.55); }
.modern-popup-input.has-error { border-color: #ff343d; }

.modern-popup-card--external-link {
    width: min(460px, 100%);
}

.external-link-destination {
    max-width: 100%;
    margin: -6px 0 18px;
    padding: 11px 13px;
    overflow-wrap: anywhere;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.72);
    background: rgba(0, 0, 0, 0.24);
    font-size: 0.78rem;
    line-height: 1.45;
    text-align: left;
}

.modern-popup-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 20px;
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    font-size: 0.84rem;
    line-height: 1.4;
    text-align: left;
}

.modern-popup-checkbox input {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    margin: 1px 0 0;
    accent-color: #ff343d;
}

.message-safe-link {
    color: #ff9297;
    font-weight: 650;
    text-decoration: underline;
    text-decoration-color: rgba(255, 146, 151, 0.5);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.message-safe-link:hover {
    color: #ffc1c4;
    text-decoration-color: currentColor;
}

.message-wrapper.me .message-safe-link,
.own-message .message-safe-link {
    color: #fff;
    text-decoration-color: rgba(255, 255, 255, 0.62);
}

.modern-popup-card--narrow {
    max-width: 340px;
}
.notif-popup-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.notif-btn-accept {
    padding: 12px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    background: linear-gradient(135deg, #ff343d, #c91822);
    color: #fff;
    box-shadow: 0 8px 24px rgba(255, 52, 61, 0.3);
}
.notif-btn-decline {
    padding: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    font-size: 0.9rem;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
}
