:root {
    --cb-modal-navy: #08254a;
    --cb-modal-muted: #66758f;
    --cb-modal-line: #dce4ee;
    --cb-modal-teal: #0b9098;
    --cb-modal-teal-dark: #087c89;
    --cb-modal-danger: #ff4b47;
    --cb-modal-info: #2563eb;
}

.cb-modal-root[hidden] {
    display: none;
}

.cb-modal-root {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
}

.cb-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 25, 49, .68);
    backdrop-filter: blur(4px);
    animation: cb-modal-fade-in .18s ease-out;
}

.cb-modal-dialog {
    position: relative;
    width: min(100%, 420px);
    max-height: min(86vh, 620px);
    display: flex;
    flex-direction: column;
    padding: 34px 28px 26px;
    overflow: hidden;
    border: 1px solid rgba(220, 228, 238, .95);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(0, 27, 61, .3);
    animation: cb-modal-enter .22s cubic-bezier(.2, .8, .2, 1);
}

.cb-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.cb-modal-close:hover,
.cb-modal-close:focus-visible {
    background: #f1f5f8;
}

.cb-modal-close img {
    width: 24px;
    height: 24px;
}

.cb-modal-icon {
    width: 82px;
    height: 82px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    align-self: center;
    margin-bottom: 18px;
    border-radius: 50%;
}

.cb-modal-icon img {
    width: 82px;
    height: 82px;
}

.cb-modal-title {
    margin: 0;
    color: var(--cb-modal-navy);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 25px;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    letter-spacing: -.025em;
}

.cb-modal-message {
    margin: 13px 0 0;
    overflow: auto;
    color: var(--cb-modal-muted);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.6;
    text-align: center;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.cb-modal-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 24px;
}

.cb-modal-actions.is-single {
    grid-template-columns: 1fr;
}

.cb-modal-button {
    min-height: 52px;
    padding: 11px 18px;
    border-radius: 999px;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.cb-modal-button:hover {
    transform: translateY(-1px);
}

.cb-modal-button:focus-visible,
.cb-modal-close:focus-visible {
    outline: 3px solid rgba(11, 144, 152, .22);
    outline-offset: 2px;
}

.cb-modal-button-secondary {
    border: 1.5px solid var(--cb-modal-navy);
    background: #fff;
    color: var(--cb-modal-navy);
}

.cb-modal-button-primary {
    border: 0;
    background: linear-gradient(135deg, var(--cb-modal-teal), var(--cb-modal-teal-dark));
    color: #fff;
    box-shadow: 0 10px 24px rgba(11, 144, 152, .22);
}

.cb-modal-dialog[data-variant="warning"] .cb-modal-button-primary {
    background: linear-gradient(135deg, #ff5753, #f53845);
    box-shadow: 0 10px 24px rgba(245, 56, 69, .24);
}

.cb-modal-dialog[data-variant="info"] .cb-modal-button-primary {
    background: linear-gradient(135deg, #2f75ec, #1658d4);
    box-shadow: 0 10px 24px rgba(37, 99, 235, .22);
}

.cb-modal-button:disabled {
    cursor: wait;
    filter: grayscale(.2);
    opacity: .7;
}

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

@keyframes cb-modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes cb-modal-enter {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
    .cb-modal-root {
        padding: 16px;
    }

    .cb-modal-dialog {
        padding: 30px 20px 22px;
        border-radius: 22px;
    }

    .cb-modal-icon,
    .cb-modal-icon img {
        width: 72px;
        height: 72px;
    }

    .cb-modal-title {
        font-size: 22px;
    }

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

    .cb-modal-actions {
        gap: 10px;
    }

    .cb-modal-button {
        min-height: 50px;
        padding-right: 12px;
        padding-left: 12px;
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cb-modal-overlay,
    .cb-modal-dialog {
        animation: none;
    }
}
