/* =============================================================================
   GLOBAL FLASH MESSAGE MODAL
   Converts success / error / warning / info alerts into a centered popup.
   ============================================================================= */

body.flash-modal-open {
    overflow: hidden;
}

.flash-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(10, 18, 35, 0.58);
    backdrop-filter: blur(8px) saturate(130%);
    -webkit-backdrop-filter: blur(8px) saturate(130%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.flash-modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.flash-modal-card {
    position: relative;
    width: min(440px, 100%);
    padding: 38px 30px 28px;
    overflow: hidden;
    text-align: center;
    color: #172033;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 26px;
    box-shadow:
        0 30px 80px rgba(8, 18, 38, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    transform: translateY(18px) scale(0.96);
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.flash-modal-overlay.is-visible .flash-modal-card {
    transform: translateY(0) scale(1);
}

/* Accent strip */
.flash-modal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--flash-accent, #2563eb);
}

.flash-modal-card.type-success {
    --flash-accent: #16a34a;
    --flash-soft: rgba(22, 163, 74, 0.12);
}

.flash-modal-card.type-danger {
    --flash-accent: #dc2626;
    --flash-soft: rgba(220, 38, 38, 0.11);
}

.flash-modal-card.type-warning {
    --flash-accent: #d97706;
    --flash-soft: rgba(217, 119, 6, 0.12);
}

.flash-modal-card.type-info {
    --flash-accent: #2563eb;
    --flash-soft: rgba(37, 99, 235, 0.11);
}

.flash-modal-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--flash-accent, #2563eb);
    background: var(--flash-soft, rgba(37, 99, 235, 0.11));
    font-size: 34px;
    line-height: 1;
}

.flash-modal-title {
    margin-bottom: 8px;
    color: var(--flash-accent, #2563eb);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
}

.flash-modal-message {
    margin-bottom: 24px;
    color: #334155;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.6;
    word-break: break-word;
}

.flash-modal-message br {
    line-height: 1.9;
}

.flash-modal-message p {
    margin: 0 0 8px;
}

.flash-modal-message p:last-child {
    margin-bottom: 0;
}

.flash-modal-message h1,
.flash-modal-message h2,
.flash-modal-message h3,
.flash-modal-message h4,
.flash-modal-message h5 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
}

.flash-modal-message a {
    color: #6e00ff;
    font-weight: 600;
    text-decoration: underline;
}

.flash-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: #64748b;
    background: rgba(15, 23, 42, 0.06);
    border: none;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.flash-modal-close:hover {
    color: #0f172a;
    background: rgba(15, 23, 42, 0.12);
    transform: rotate(90deg);
}

.flash-modal-ok {
    min-width: 130px;
    padding: 12px 30px;
    color: #ffffff;
    background: var(--flash-accent, #2563eb);
    border: none;
    border-radius: 14px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 20px var(--flash-soft, rgba(37, 99, 235, 0.2));
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.flash-modal-ok:hover {
    filter: brightness(0.95);
    transform: translateY(-2px);
    box-shadow: 0 12px 26px var(--flash-soft, rgba(37, 99, 235, 0.24));
}

.flash-modal-ok:active {
    transform: translateY(0);
}

@media (max-width: 500px) {
    .flash-modal-overlay {
        padding: 14px;
    }

    .flash-modal-card {
        padding: 32px 20px 24px;
        border-radius: 22px;
    }

    .flash-modal-icon {
        width: 64px;
        height: 64px;
        margin-bottom: 14px;
        font-size: 28px;
    }

    .flash-modal-message {
        font-size: 15px;
        margin-bottom: 20px;
    }

    .flash-modal-ok {
        width: 100%;
    }
}
