:root {
    --ka-pink: #e6007e;
    --ka-pink-dark: #c9006e;
    --ka-success: #14845c;
    --ka-danger: #c2394d;
    --ka-warning: #a66a00;
}

.ka-ui-lock { overflow: hidden !important; }

.ka-modal-layer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(18, 16, 22, .42);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.ka-modal-layer.show {
    opacity: 1;
    pointer-events: auto;
}

.ka-modal-card {
    position: relative;
    width: min(100%, 420px);
    overflow: hidden;
    padding: 30px 28px 24px;
    border: 1px solid rgba(255,255,255,.75);
    border-radius: 26px;
    background: rgba(255,255,255,.98);
    box-shadow: 0 30px 90px rgba(29, 17, 25, .24);
    text-align: center;
    transform: translateY(24px) scale(.86);
    opacity: 0;
}

.ka-modal-layer.show .ka-modal-card {
    animation: kaPopBounce .64s cubic-bezier(.2,.9,.25,1.24) forwards;
}

.ka-modal-glow {
    position: absolute;
    width: 180px;
    height: 180px;
    top: -105px;
    right: -55px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(230,0,126,.20), rgba(230,0,126,0) 70%);
    pointer-events: none;
}

.ka-modal-icon {
    width: 74px;
    height: 74px;
    margin: 0 auto 17px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-size: 32px;
    font-weight: 900;
    transform: scale(.4) rotate(-14deg);
}

.ka-modal-layer.show .ka-modal-icon {
    animation: kaIconBounce .65s .12s cubic-bezier(.2,.85,.3,1.35) both;
}

.ka-modal-icon.success { background: #eaf8f2; color: var(--ka-success); box-shadow: 0 10px 30px rgba(20,132,92,.14); }
.ka-modal-icon.error { background: #fff0f2; color: var(--ka-danger); box-shadow: 0 10px 30px rgba(194,57,77,.12); }
.ka-modal-icon.warning { background: #fff7e7; color: var(--ka-warning); box-shadow: 0 10px 30px rgba(166,106,0,.12); }
.ka-modal-icon.info { background: #fff0f7; color: var(--ka-pink); box-shadow: 0 10px 30px rgba(230,0,126,.12); }

.ka-modal-title {
    margin: 0 0 8px;
    color: #25232a;
    font-size: 24px;
    line-height: 1.25;
}

.ka-modal-message {
    margin: 0;
    color: #76747d;
    font-size: 15px;
    line-height: 1.7;
    white-space: pre-line;
}

.ka-modal-name {
    display: block;
    margin-top: 8px;
    color: var(--ka-pink);
    font-size: 19px;
    font-weight: 800;
}

.ka-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 22px;
}

.ka-modal-button {
    min-width: 130px;
    border: 0;
    border-radius: 13px;
    padding: 12px 18px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.ka-modal-button:hover { transform: translateY(-2px); }
.ka-modal-button.primary { color: #fff; background: linear-gradient(135deg, #ee1688, #c90670); box-shadow: 0 10px 24px rgba(207,6,112,.2); }
.ka-modal-button.secondary { color: #4a4850; background: #f4f4f7; }

.ka-modal-progress {
    height: 4px;
    margin: 23px -28px -24px;
    overflow: hidden;
    background: #f3e8ee;
}

.ka-modal-progress::after {
    content: "";
    display: block;
    width: 100%;
    height: 100%;
    transform-origin: left;
    background: linear-gradient(90deg, #f2178c, #b90866);
    animation: kaProgress var(--ka-progress, 1100ms) linear forwards;
}

.ka-toast-stack {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 10050;
    width: min(390px, calc(100vw - 36px));
    display: grid;
    gap: 10px;
    pointer-events: none;
}

.ka-toast-item {
    display: grid;
    grid-template-columns: 38px 1fr;
    align-items: center;
    gap: 11px;
    padding: 13px 15px;
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 15px;
    background: rgba(255,255,255,.97);
    box-shadow: 0 16px 45px rgba(26,20,25,.14);
    color: #343139;
    transform: translateX(35px) scale(.96);
    opacity: 0;
    animation: kaToastIn .4s cubic-bezier(.2,.9,.3,1.18) forwards;
}

.ka-toast-item.out { animation: kaToastOut .25s ease forwards; }
.ka-toast-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #fff0f7; color: var(--ka-pink); font-weight: 900; }
.ka-toast-item.success .ka-toast-icon { background: #eaf8f2; color: var(--ka-success); }
.ka-toast-item.error .ka-toast-icon { background: #fff0f2; color: var(--ka-danger); }
.ka-toast-text strong { display: block; font-size: 14px; margin-bottom: 2px; }
.ka-toast-text span { color: #77747d; font-size: 13px; line-height: 1.45; }

.ka-confetti {
    position: fixed;
    z-index: 10020;
    width: 8px;
    height: 14px;
    border-radius: 2px;
    pointer-events: none;
    animation: kaConfetti 950ms cubic-bezier(.2,.7,.25,1) forwards;
}

.ka-shake { animation: kaShake .46s ease !important; }

@keyframes kaPopBounce {
    0% { opacity: 0; transform: translateY(26px) scale(.84); }
    58% { opacity: 1; transform: translateY(-7px) scale(1.035); }
    78% { transform: translateY(3px) scale(.99); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes kaIconBounce {
    0% { opacity: 0; transform: scale(.35) rotate(-18deg); }
    65% { opacity: 1; transform: scale(1.15) rotate(4deg); }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes kaProgress { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes kaToastIn { to { transform: translateX(0) scale(1); opacity: 1; } }
@keyframes kaToastOut { to { transform: translateX(32px) scale(.96); opacity: 0; } }
@keyframes kaShake {
    0%,100% { transform: translateX(0); }
    18% { transform: translateX(-9px); }
    36% { transform: translateX(8px); }
    54% { transform: translateX(-6px); }
    72% { transform: translateX(4px); }
}

@keyframes kaConfetti {
    0% { opacity: 1; transform: translate3d(0,0,0) rotate(0); }
    100% { opacity: 0; transform: translate3d(var(--ka-x), var(--ka-y), 0) rotate(var(--ka-r)); }
}

@media (prefers-reduced-motion: reduce) {
    .ka-modal-layer, .ka-modal-card, .ka-modal-icon, .ka-toast-item, .ka-confetti, .ka-shake { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
