:root {
    --uc-alert-ink: #edf6ff;
    --uc-alert-muted: #91a2ba;
    --uc-alert-line: rgba(255, 255, 255, .14);
    --uc-alert-panel: rgba(8, 18, 33, .9);
    --uc-alert-panel-soft: rgba(15, 29, 49, .72);
    --uc-alert-accent: #38bdf8;
}

html.uc-alert-visible,
body.uc-alert-visible { overflow: hidden; }

.uc-alert-layer {
    position: fixed;
    z-index: 2147483000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: clamp(12px, 4vw, 34px);
    overflow: auto;
    opacity: 0;
    background:
        linear-gradient(rgba(2, 7, 16, .62), rgba(2, 7, 16, .76)),
        repeating-linear-gradient(90deg, transparent 0 48px, rgba(125, 211, 252, .025) 49px 50px);
    backdrop-filter: blur(18px) saturate(115%);
    -webkit-backdrop-filter: blur(18px) saturate(115%);
    transition: opacity .18s ease;
}
.uc-alert-layer::before { content: ''; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 45%, rgba(56, 189, 248, .075), transparent 46%); }
.uc-alert-layer.is-visible { opacity: 1; }
.uc-alert-layer.is-leaving { opacity: 0; }
.uc-alert-layer[data-position^="top"] { place-items: start center; }
.uc-alert-layer[data-position^="bottom"] { place-items: end center; }

.uc-alert-dialog {
    --uc-tone: var(--uc-alert-accent);
    --uc-tone-rgb: 56, 189, 248;
    --uc-alert-dialog-width: 520px;
    position: relative;
    width: min(var(--uc-alert-dialog-width), 100%);
    max-height: calc(100dvh - 40px);
    overflow: hidden auto;
    color: var(--uc-alert-ink);
    border: 1px solid var(--uc-alert-line);
    border-radius: 26px 11px 26px 26px;
    background:
        radial-gradient(circle at 8% 0, rgba(var(--uc-tone-rgb), .13), transparent 38%),
        linear-gradient(145deg, rgba(255,255,255,.065), rgba(255,255,255,.012) 40%),
        var(--uc-alert-panel);
    box-shadow: 0 42px 120px rgba(0,0,0,.62), inset 0 1px rgba(255,255,255,.11), inset 1px 0 rgba(255,255,255,.025);
    backdrop-filter: blur(34px) saturate(150%);
    -webkit-backdrop-filter: blur(34px) saturate(150%);
    transform: perspective(900px) translateY(24px) scale(.955) rotateX(3deg);
    transform-origin: 50% 20%;
    opacity: 0;
    transition: transform .42s cubic-bezier(.16, 1, .3, 1), opacity .24s ease;
}
.uc-alert-layer.is-visible .uc-alert-dialog { transform: perspective(900px) translateY(0) scale(1) rotateX(0); opacity: 1; }
.uc-alert-layer.is-leaving .uc-alert-dialog { transform: translateY(9px) scale(.975); opacity: 0; transition-duration: .18s; }
.uc-alert-dialog[data-tone="success"] { --uc-tone: #34d399; --uc-tone-rgb: 52, 211, 153; }
.uc-alert-dialog[data-tone="error"] { --uc-tone: #fb7185; --uc-tone-rgb: 251, 113, 133; }
.uc-alert-dialog[data-tone="warning"] { --uc-tone: #fbbf24; --uc-tone-rgb: 251, 191, 36; }
.uc-alert-dialog[data-tone="question"] { --uc-tone: #c084fc; --uc-tone-rgb: 192, 132, 252; }
.uc-alert-dialog[data-tone="info"] { --uc-tone: #38bdf8; --uc-tone-rgb: 56, 189, 248; }
.uc-alert-dialog::after { content: ''; position: absolute; z-index: 3; top: 0; bottom: 0; width: 34%; left: -45%; pointer-events: none; background: linear-gradient(90deg, transparent, rgba(var(--uc-tone-rgb), .075), transparent); transform: skewX(-14deg); animation: ucAlertSweep 1.05s .12s cubic-bezier(.2,.8,.2,1) both; }

.uc-alert-signal { position: sticky; z-index: 4; top: 0; height: 5px; display: flex; align-items: center; gap: 4px; padding: 0 7px; overflow: hidden; background: rgba(2,7,16,.45); }
.uc-alert-signal span { width: 4px; height: 4px; border-radius: 50%; background: var(--uc-tone); box-shadow: 0 0 10px var(--uc-tone); opacity: .42; }
.uc-alert-signal span:nth-child(2) { opacity: .7; }
.uc-alert-signal span:nth-child(3) { opacity: 1; }
.uc-alert-signal i { height: 1px; flex: 1; margin-left: 3px; background: linear-gradient(90deg, var(--uc-tone), transparent 78%); opacity: .6; }

.uc-alert-head { position: relative; z-index: 2; display: flex; align-items: center; gap: 15px; padding: 24px 25px 15px; }
.uc-alert-glyph { position: relative; width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; clip-path: polygon(16% 0, 100% 0, 100% 84%, 84% 100%, 0 100%, 0 16%); color: var(--uc-tone); border: 1px solid rgba(var(--uc-tone-rgb), .28); background: linear-gradient(145deg, rgba(var(--uc-tone-rgb), .18), rgba(var(--uc-tone-rgb), .055)); box-shadow: inset 0 1px rgba(255,255,255,.13), 0 12px 32px rgba(var(--uc-tone-rgb), .13); font-size: 17px; }
.uc-alert-glyph::before,
.uc-alert-glyph::after { content: ''; position: absolute; width: 5px; height: 5px; border-color: var(--uc-tone); opacity: .8; }
.uc-alert-glyph::before { top: 5px; left: 5px; border-top: 1px solid; border-left: 1px solid; }
.uc-alert-glyph::after { right: 5px; bottom: 5px; border-right: 1px solid; border-bottom: 1px solid; }
.uc-alert-heading { min-width: 0; display: grid; flex: 1; }
.uc-alert-kicker { margin-bottom: 5px; color: var(--uc-tone); font: 800 8px/1.3 'JetBrains Mono', monospace; letter-spacing: .14em; text-transform: uppercase; }
.uc-alert-title { margin: 0; overflow-wrap: anywhere; color: var(--uc-alert-ink); font: 800 clamp(19px, 4vw, 25px)/1.18 'Plus Jakarta Sans', sans-serif; letter-spacing: -.035em; }
.uc-alert-title i { margin-right: 7px; color: var(--uc-tone) !important; }
.uc-alert-close { width: 35px; height: 35px; flex: 0 0 35px; align-self: flex-start; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.1); border-radius: 10px 5px 10px 10px; color: var(--uc-alert-muted); background: rgba(255,255,255,.035); cursor: pointer; transition: .18s ease; }
.uc-alert-close:hover { color: #fff; border-color: rgba(var(--uc-tone-rgb), .3); background: rgba(var(--uc-tone-rgb), .09); }

.uc-alert-content { position: relative; z-index: 2; padding: 3px 25px 22px; }
.uc-alert-body { color: var(--uc-alert-muted); font: 500 12px/1.7 'Inter', sans-serif; overflow-wrap: anywhere; }
.uc-alert-body:empty { display: none; }
.uc-alert-html { color: var(--uc-alert-muted); }
.uc-alert-html :is(p, ul, ol) { font-size: inherit; line-height: inherit; }
.uc-alert-html code { display: inline-block; max-width: 100%; padding: 3px 7px; overflow-wrap: anywhere; color: #bae6fd; border: 1px solid rgba(56,189,248,.13); border-radius: 6px; background: rgba(2,8,23,.4); font: 10px/1.5 'JetBrains Mono', monospace; }
.uc-alert-html a { color: #7dd3fc; }
.uc-alert-image { display: block; max-width: 100%; max-height: 340px; margin: 15px auto 0; object-fit: contain; border-radius: 14px; }

.uc-alert-field { display: grid; gap: 7px; margin-top: 17px; }
.uc-alert-input-label { color: #cbd5e1; font-size: 10px; font-weight: 800; }
.uc-alert-input,
.uc-alert-html :is(.swal2-input, .swal2-textarea, .swal2-select) { width: 100%; min-height: 46px; margin: 8px 0 0; padding: 10px 13px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px 6px 12px 12px; outline: none; color: var(--uc-alert-ink); background: rgba(2,8,18,.48); box-shadow: inset 0 1px rgba(255,255,255,.025); font: 500 12px/1.45 'Inter', sans-serif; transition: .18s ease; }
.uc-alert-field > .uc-alert-input { margin: 0; }
.uc-alert-textarea,
.uc-alert-html textarea.swal2-textarea { min-height: 100px; resize: vertical; }
.uc-alert-input:focus,
.uc-alert-html :is(.swal2-input, .swal2-textarea, .swal2-select):focus { border-color: rgba(var(--uc-tone-rgb), .55); background: rgba(2,8,18,.66); box-shadow: 0 0 0 3px rgba(var(--uc-tone-rgb), .08); }
.uc-alert-checkbox,
.uc-alert-radio { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 9px 11px; border: 1px solid rgba(255,255,255,.1); border-radius: 11px; color: #cbd5e1; background: rgba(255,255,255,.025); font-size: 11px; }
.uc-alert-checkbox input,
.uc-alert-radio input { accent-color: var(--uc-tone); }
.uc-alert-radio-group { display: grid; gap: 6px; }
.uc-alert-validation { margin-top: 12px; padding: 10px 12px; border: 1px solid rgba(251,113,133,.24); border-radius: 10px 5px 10px 10px; color: #fecdd3; background: rgba(251,113,133,.075); font: 650 10px/1.5 'Inter', sans-serif; animation: ucAlertValidation .26s ease both; }
.uc-alert-validation::before { content: '\f071'; margin-right: 7px; color: #fb7185; font-family: 'Font Awesome 6 Free'; font-weight: 900; }

.uc-alert-loader { margin-top: 15px; padding: 13px; border: 1px solid rgba(var(--uc-tone-rgb), .14); border-radius: 12px; background: rgba(var(--uc-tone-rgb), .045); }
.uc-alert-loader > div { height: 18px; display: flex; align-items: end; justify-content: center; gap: 4px; }
.uc-alert-loader i { width: 3px; height: 7px; border-radius: 4px; background: var(--uc-tone); box-shadow: 0 0 8px rgba(var(--uc-tone-rgb), .5); animation: ucAlertSignal .8s ease-in-out infinite alternate; }
.uc-alert-loader i:nth-child(2) { animation-delay: -.6s; }
.uc-alert-loader i:nth-child(3) { animation-delay: -.35s; }
.uc-alert-loader i:nth-child(4) { animation-delay: -.12s; }
.uc-alert-loader > span { display: block; margin-top: 7px; color: var(--uc-alert-muted); text-align: center; font: 700 8px 'JetBrains Mono', monospace; letter-spacing: .1em; text-transform: uppercase; }
.uc-alert-dialog.is-loading .uc-alert-glyph i { animation: ucAlertRotate 1.3s linear infinite; }
.uc-alert-footer { margin-top: 16px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.075); color: var(--uc-alert-muted); font-size: 10px; }

.uc-alert-actions { position: relative; z-index: 2; display: flex; justify-content: flex-end; gap: 8px; padding: 16px 25px 22px; border-top: 1px solid rgba(255,255,255,.075); background: rgba(2,8,18,.18); }
.uc-alert-button { min-height: 41px; min-width: 94px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 15px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px 6px 12px 12px; color: #dbe8f7; background: rgba(255,255,255,.045); box-shadow: inset 0 1px rgba(255,255,255,.05); font: 800 10px/1.3 'Plus Jakarta Sans', sans-serif; cursor: pointer; transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.uc-alert-button:hover:not(:disabled) { transform: translateY(-2px); color: #fff; border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.075); }
.uc-alert-button:active:not(:disabled) { transform: translateY(0) scale(.98); }
.uc-alert-button:disabled { opacity: .45; cursor: wait; }
.uc-alert-confirm { border-color: rgba(var(--uc-tone-rgb), .38); color: #fff; background: linear-gradient(135deg, rgba(var(--uc-tone-rgb), .92), rgba(var(--uc-tone-rgb), .6)); box-shadow: 0 10px 28px rgba(var(--uc-tone-rgb), .17), inset 0 1px rgba(255,255,255,.22); }
.uc-alert-confirm:hover:not(:disabled) { border-color: rgba(var(--uc-tone-rgb), .7); background: linear-gradient(135deg, rgba(var(--uc-tone-rgb), 1), rgba(var(--uc-tone-rgb), .72)); box-shadow: 0 13px 32px rgba(var(--uc-tone-rgb), .24); }
.uc-alert-dialog[data-tone="warning"] .uc-alert-confirm { color: #211600; }
.uc-alert-deny { color: #fecdd3; border-color: rgba(251,113,133,.25); background: rgba(251,113,133,.07); }
.uc-alert-progress { position: sticky; z-index: 5; bottom: 0; display: block; height: 2px; transform-origin: left center; background: linear-gradient(90deg, var(--uc-tone), transparent); animation: ucAlertProgress var(--uc-alert-timer) linear forwards; }

.uc-alert-toast-stack { position: fixed; z-index: 2147483001; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 28px)); pointer-events: none; }
.uc-alert-toast-stack[data-position="top-end"] { top: max(76px, env(safe-area-inset-top)); right: 14px; }
.uc-alert-toast-stack[data-position="top-start"] { top: max(76px, env(safe-area-inset-top)); left: 14px; }
.uc-alert-toast-stack[data-position="top"] { top: max(76px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); }
.uc-alert-toast-stack[data-position="bottom-end"] { right: 14px; bottom: max(18px, env(safe-area-inset-bottom)); }
.uc-alert-toast-stack[data-position="bottom-start"] { left: 14px; bottom: max(18px, env(safe-area-inset-bottom)); }
.uc-alert-toast-stack[data-position="bottom"] { left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); }
.uc-alert-toast {
    --uc-tone: #38bdf8;
    --uc-tone-rgb: 56, 189, 248;
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 62px;
    padding: 11px 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 17px 7px 17px 17px;
    color: var(--uc-alert-ink);
    background: linear-gradient(145deg, rgba(255,255,255,.06), rgba(255,255,255,.015)), rgba(8,18,33,.91);
    box-shadow: 0 20px 55px rgba(0,0,0,.36), inset 0 1px rgba(255,255,255,.09);
    backdrop-filter: blur(28px) saturate(145%);
    -webkit-backdrop-filter: blur(28px) saturate(145%);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(28px) scale(.96);
    transition: transform .36s cubic-bezier(.16,1,.3,1), opacity .2s ease;
}
.uc-alert-toast[data-tone="success"] { --uc-tone: #34d399; --uc-tone-rgb: 52,211,153; }
.uc-alert-toast[data-tone="error"] { --uc-tone: #fb7185; --uc-tone-rgb: 251,113,133; }
.uc-alert-toast[data-tone="warning"] { --uc-tone: #fbbf24; --uc-tone-rgb: 251,191,36; }
.uc-alert-toast[data-tone="question"] { --uc-tone: #c084fc; --uc-tone-rgb: 192,132,252; }
.uc-alert-toast.is-visible { opacity: 1; transform: translateX(0) scale(1); }
.uc-alert-toast.is-leaving { opacity: 0; transform: translateX(22px) scale(.97); transition-duration: .18s; }
.uc-alert-toast .uc-alert-glyph { width: 37px; height: 37px; flex-basis: 37px; font-size: 13px; }
.uc-alert-toast-copy { min-width: 0; display: grid; flex: 1; }
.uc-alert-toast-copy strong { overflow-wrap: anywhere; font: 750 11px/1.4 'Plus Jakarta Sans', sans-serif; }
.uc-alert-toast-copy span { margin-top: 2px; color: var(--uc-alert-muted); font-size: 9px; line-height: 1.4; }
.uc-alert-toast-close { width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 8px; color: var(--uc-alert-muted); background: transparent; cursor: pointer; }
.uc-alert-toast-close:hover { color: #fff; background: rgba(255,255,255,.06); }
.uc-alert-toast-progress { position: absolute; right: 0; bottom: 0; left: 0; height: 2px; transform-origin: left; background: linear-gradient(90deg, var(--uc-tone), transparent); animation: ucAlertProgress var(--uc-alert-timer) linear forwards; }

:root[data-theme="light"] {
    --uc-alert-ink: #142033;
    --uc-alert-muted: #53647a;
    --uc-alert-line: rgba(15,23,42,.14);
    --uc-alert-panel: rgba(245,249,255,.92);
}
:root[data-theme="light"] .uc-alert-layer { background: rgba(225,233,244,.66); }
:root[data-theme="light"] .uc-alert-input,
:root[data-theme="light"] .uc-alert-html :is(.swal2-input,.swal2-textarea,.swal2-select) { color: #142033; background: rgba(255,255,255,.67); }

@keyframes ucAlertSweep { 0% { left: -45%; } 100% { left: 125%; } }
@keyframes ucAlertSignal { from { height: 5px; opacity: .4; } to { height: 18px; opacity: 1; } }
@keyframes ucAlertRotate { to { transform: rotate(360deg); } }
@keyframes ucAlertValidation { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ucAlertProgress { from { transform: scaleX(1); } to { transform: scaleX(0); } }

@media (max-width: 560px) {
    .uc-alert-layer { padding: 9px; align-items: end; }
    .uc-alert-dialog { width: 100%; max-height: calc(100dvh - 18px); border-radius: 22px 9px 22px 22px; transform-origin: 50% 100%; }
    .uc-alert-head { padding: 20px 17px 13px; }
    .uc-alert-glyph { width: 43px; height: 43px; flex-basis: 43px; }
    .uc-alert-content { padding: 2px 17px 18px; }
    .uc-alert-actions { padding: 13px 17px 18px; }
    .uc-alert-button { flex: 1; min-width: 0; }
    .uc-alert-toast-stack { top: max(67px, env(safe-area-inset-top)) !important; right: 9px !important; left: 9px !important; width: auto; transform: none !important; }
    .uc-alert-toast { transform: translateY(-16px) scale(.97); }
    .uc-alert-toast.is-visible { transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .uc-alert-dialog, .uc-alert-layer, .uc-alert-toast { transition-duration: .01ms !important; animation: none !important; }
    .uc-alert-dialog::after, .uc-alert-progress, .uc-alert-toast-progress, .uc-alert-loader i { animation: none !important; }
}

:root[data-bg-theme="off"] .uc-alert-dialog,
:root[data-bg-theme="off"] .uc-alert-toast { backdrop-filter: none; -webkit-backdrop-filter: none; background-color: #0c1728; }
