/* === Overlay === */
.ff-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

/* === Modal card base === */
.ff-modal {
    width: 92%;
    max-width: 480px;
    padding: 28px 24px 32px;
    border-radius: 22px;
    box-shadow: 0 12px 38px rgba(0, 0, 0, 0.20);
    position: relative;
    text-align: left;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    box-sizing: border-box;
}

/* Light theme */
.ff-modal--light {
    background: #ffffff;
    color: #222222;
}

/* Dark theme */
.ff-modal--dark {
    background: #1f1f1f;
    color: #f5f5f5;
}

/* === Close button (X) === */
.ff-modal .ff-close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    width: auto;
    height: auto;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Optional subtle hover state */
.ff-modal .ff-close:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* === Title === */
.ff-modal .ff-title {
    margin: 0 0 10px;
    font-size: 22px;
    font-weight: 600;
}

/* === Message === */
.ff-modal .ff-message {
    margin: 0 0 24px;
    font-size: 15px;
    line-height: 1.5;
}

/* === Dismiss button === */
/* Stronger selector so theme button styles don’t override */
.ff-modal .ff-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 0;
    background: #222222;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    box-shadow: none;
    outline: none;
    appearance: none;
    transition: opacity 0.15s ease, transform 0.08s ease;
}

.ff-modal .ff-btn:active {
    transform: scale(0.98);
}

/* Dark theme button – slightly lighter card, solid button */
.ff-modal--dark .ff-btn {
    background: #f5f5f5;
    color: #222222;
}

/* === Responsive tweaks === */
@media (max-width: 480px) {
    .ff-modal {
        padding: 24px 20px 28px;
        max-width: 90%;
    }

    .ff-modal .ff-title {
        font-size: 20px;
    }

    .ff-modal .ff-message {
        font-size: 14px;
    }
}

/* Force popup button to ignore theme hover styles */
.ff-modal button.ff-btn,
.ff-modal button.ff-btn:hover,
.ff-modal button.ff-btn:focus {
    background-color: #222222 !important;  /* light theme base */
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Dark theme variant */
.ff-modal--dark button.ff-btn,
.ff-modal--dark button.ff-btn:hover,
.ff-modal--dark button.ff-btn:focus {
    background-color: #f5f5f5 !important;
    color: #222222 !important;
    text-decoration: none !important;
}