/* ============================================================================
   CONFIRM MODAL — reusable, theme-matched confirmation dialog that replaces the
   browser's default confirm() popup. Rich graphics: gradient icon, backdrop
   blur, scale/fade animation. Driven by confirm-modal.js.
   ========================================================================== */
:root {
    --cfm-danger-1: #ef4444;
    --cfm-danger-2: #b91c1c;
    --cfm-primary-1: #1565c0;
    --cfm-primary-2: #0f3460;
    --cfm-ink: #1a1a2e;
    --cfm-muted: #6b7280;
}

/* overlay */
.cfm-overlay {
    position: fixed; inset: 0; z-index: 100000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(6px);
    opacity: 0; visibility: hidden;
    transition: opacity .22s ease, visibility .22s ease;
}
.cfm-overlay.is-open { opacity: 1; visibility: visible; }

/* modal card */
.cfm-modal {
    width: 100%; max-width: 420px;
    background: #fff; border-radius: 22px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
    padding: 34px 32px 26px;
    text-align: center;
    position: relative;
    transform: translateY(16px) scale(.96);
    transition: transform .26s cubic-bezier(.2, .9, .3, 1.2);
    overflow: hidden;
}
.cfm-overlay.is-open .cfm-modal { transform: translateY(0) scale(1); }

/* soft decorative glow behind the icon */
.cfm-modal::before {
    content: ""; position: absolute; top: -70px; left: 50%; transform: translateX(-50%);
    width: 220px; height: 220px; border-radius: 50%;
    background: radial-gradient(circle, rgba(239, 68, 68, .18), transparent 70%);
    pointer-events: none;
}
.cfm-modal.is-primary::before { background: radial-gradient(circle, rgba(21, 101, 192, .18), transparent 70%); }

/* close X */
.cfm-close {
    position: absolute; top: 14px; right: 16px;
    width: 30px; height: 30px; border: 0; border-radius: 50%;
    background: #f3f4f6; color: #9ca3af; cursor: pointer;
    display: grid; place-items: center; transition: all .15s;
}
.cfm-close:hover { background: #e5e7eb; color: #4b5563; }

/* gradient icon badge */
.cfm-icon {
    width: 78px; height: 78px; border-radius: 50%;
    margin: 4px auto 20px; display: grid; place-items: center;
    font-size: 32px; color: #fff; position: relative;
    background: linear-gradient(135deg, var(--cfm-danger-1), var(--cfm-danger-2));
    box-shadow: 0 12px 26px rgba(239, 68, 68, .4);
    animation: cfmPulse 2s ease-in-out infinite;
}
.cfm-modal.is-primary .cfm-icon {
    background: linear-gradient(135deg, var(--cfm-primary-1), var(--cfm-primary-2));
    box-shadow: 0 12px 26px rgba(21, 101, 192, .4);
}
@keyframes cfmPulse {
    0%, 100% { box-shadow: 0 12px 26px rgba(239, 68, 68, .40); }
    50%      { box-shadow: 0 12px 34px rgba(239, 68, 68, .60); }
}

.cfm-title { font-size: 21px; font-weight: 800; color: var(--cfm-ink); margin: 0 0 8px; }
.cfm-msg   { font-size: 14.5px; color: var(--cfm-muted); line-height: 1.6; margin: 0 auto 24px; max-width: 320px; }

/* actions */
.cfm-actions { display: flex; gap: 12px; }
.cfm-btn {
    flex: 1; padding: 13px 18px; border: 0; border-radius: 13px; cursor: pointer;
    font-size: 14.5px; font-weight: 700; transition: transform .12s, filter .12s, background .15s;
}
.cfm-btn--cancel { background: #f3f4f6; color: #374151; }
.cfm-btn--cancel:hover { background: #e5e7eb; }
.cfm-btn--confirm {
    color: #fff;
    background: linear-gradient(135deg, var(--cfm-danger-1), var(--cfm-danger-2));
    box-shadow: 0 10px 22px rgba(239, 68, 68, .35);
}
.cfm-modal.is-primary .cfm-btn--confirm {
    background: linear-gradient(135deg, var(--cfm-primary-1), var(--cfm-primary-2));
    box-shadow: 0 10px 22px rgba(21, 101, 192, .35);
}
.cfm-btn--confirm:hover { transform: translateY(-1px); filter: brightness(1.06); }
.cfm-btn:active { transform: translateY(0); }

@media (max-width: 420px) {
    .cfm-modal { padding: 28px 22px 20px; }
    .cfm-actions { flex-direction: column-reverse; }
}
