body.ui-confirm-open,
body.upload-processing-open {
    overflow: hidden;
}


/* =========================================================
   TOAST REGION
========================================================= */

.toast-region {
    position: fixed;
    z-index: 3000;

    top: 88px;
    right: 24px;

    display: grid;

    width:
        min(
            390px,
            calc(100vw - 32px)
        );

    gap: 10px;

    pointer-events: none;
}


/* =========================================================
   TOAST CARD
========================================================= */

.app-toast {
    display: grid;

    grid-template-columns:
        auto
        minmax(0, 1fr)
        auto;

    align-items: flex-start;

    gap: 11px;

    padding: 14px;

    border:
        1px solid
        #dbe4ef;

    border-left:
        4px solid
        #2563eb;

    border-radius: 12px;

    background:
        #ffffff;

    box-shadow:
        0
        18px
        45px
        rgba(
            15,
            23,
            42,
            0.18
        );

    pointer-events: auto;

    animation:
        toast-in
        0.24s
        ease-out;
}


.app-toast.success {
    border-left-color:
        #059669;
}


.app-toast.error {
    border-left-color:
        #dc2626;
}


.app-toast.warning {
    border-left-color:
        #ea580c;
}


/* =========================================================
   TOAST ICON
========================================================= */

.app-toast-icon {
    display:
        inline-flex;

    align-items:
        center;

    justify-content:
        center;

    width: 31px;
    height: 31px;

    border-radius: 9px;

    background:
        #dbeafe;

    color:
        #1d4ed8;

    font-size: 18px;
}


.app-toast.success
.app-toast-icon {
    background:
        #dcfce7;

    color:
        #047857;
}


.app-toast.error
.app-toast-icon {
    background:
        #fee2e2;

    color:
        #b91c1c;
}


.app-toast.warning
.app-toast-icon {
    background:
        #ffedd5;

    color:
        #c2410c;
}


/* =========================================================
   TOAST CONTENT
========================================================= */

.app-toast-content strong,
.app-toast-content span {
    display: block;
}


.app-toast-content strong {
    margin:
        1px
        0
        3px;

    color:
        #0f172a;

    font-size: 12px;

    font-weight: 700;
}


.app-toast-content span {
    color:
        #64748b;

    font-size: 11px;

    line-height: 1.5;
}


/* =========================================================
   TOAST CLOSE
========================================================= */

.app-toast-close {
    display:
        inline-flex;

    align-items:
        center;

    justify-content:
        center;

    padding: 3px;

    border: 0;

    background:
        transparent;

    color:
        #94a3b8;

    cursor: pointer;

    transition:
        color 0.18s,
        transform 0.18s;
}


.app-toast-close:hover {
    color:
        #475569;

    transform:
        scale(1.05);
}


.app-toast-close
.material-symbols-rounded {
    font-size: 17px;
}


/* =========================================================
   HIDDEN STATES
========================================================= */

.ui-confirm[hidden],
.upload-processing-overlay[hidden] {
    display: none;
}


/* =========================================================
   GLOBAL OVERLAY
========================================================= */

.ui-confirm,
.upload-processing-overlay {
    position: fixed;

    z-index: 2800;

    inset: 0;

    display: grid;

    place-items: center;

    padding: 24px;
}


.ui-confirm-backdrop,
.upload-processing-backdrop {
    position: absolute;

    inset: 0;

    background:
        rgba(
            2,
            6,
            23,
            0.72
        );

    backdrop-filter:
        blur(7px);
}


/* =========================================================
   CONFIRM / PROCESSING CARD
========================================================= */

.ui-confirm-card,
.upload-processing-card {
    position: relative;

    z-index: 1;

    width:
        min(
            100%,
            430px
        );

    padding: 30px;

    border:
        1px solid
        rgba(
            226,
            232,
            240,
            0.9
        );

    border-radius: 18px;

    background:
        #ffffff;

    box-shadow:
        0
        30px
        80px
        rgba(
            2,
            6,
            23,
            0.32
        );
}


/* =========================================================
   CONFIRM ICON
========================================================= */

.ui-confirm-icon {
    display:
        inline-flex;

    align-items:
        center;

    justify-content:
        center;

    width: 48px;
    height: 48px;

    margin-bottom: 17px;

    border-radius: 14px;

    background:
        #dbeafe;

    color:
        #1d4ed8;

    font-size: 25px;
}


/* =========================================================
   CONFIRM TEXT
========================================================= */

.ui-confirm-card h2,
.upload-processing-card h2 {
    margin: 0;

    color:
        #0f172a;

    font-size: 22px;

    line-height: 1.3;
}


.ui-confirm-card p {
    margin:
        9px
        0
        24px;

    color:
        #64748b;

    font-size: 13px;

    line-height: 1.65;
}


/* =========================================================
   CONFIRM ACTIONS
========================================================= */

.ui-confirm-actions {
    display: flex;

    justify-content:
        flex-end;

    gap: 10px;
}


/* =========================================================
   UPLOAD PROCESSING CARD
========================================================= */

.upload-processing-card {
    width:
        min(
            100%,
            500px
        );

    text-align: center;
}


/* =========================================================
   UPLOAD SPINNER
========================================================= */

.upload-spinner {
    position: relative;

    display:
        inline-flex;

    align-items:
        center;

    justify-content:
        center;

    width: 66px;
    height: 66px;

    margin-bottom: 17px;

    border-radius: 18px;

    background:
        linear-gradient(
            135deg,
            #2563eb,
            #0891b2
        );

    color:
        #ffffff;
}


.upload-spinner::after {
    position: absolute;

    inset: -7px;

    border:
        3px solid
        transparent;

    border-top-color:
        #2563eb;

    border-right-color:
        #38bdf8;

    border-radius: 50%;

    content: "";

    animation:
        upload-spin
        1s
        linear
        infinite;
}


.upload-spinner
.material-symbols-rounded {
    font-size: 30px;
}


/* =========================================================
   PROCESSING LABELS
========================================================= */

.upload-processing-eyebrow {
    margin:
        0
        0
        5px;

    color:
        #2563eb;

    font-size: 10px;

    font-weight: 800;

    letter-spacing: 1.1px;

    text-transform:
        uppercase;
}


.upload-processing-file {
    overflow: hidden;

    margin:
        8px
        0
        0;

    color:
        #334155;

    font-size: 12px;

    font-weight: 700;

    text-overflow:
        ellipsis;

    white-space:
        nowrap;
}


.upload-processing-copy {
    margin:
        8px
        auto
        20px;

    color:
        #64748b;

    font-size: 12px;

    line-height: 1.65;
}


/* =========================================================
   PROCESSING BAR
========================================================= */

.upload-processing-bar {
    overflow: hidden;

    height: 6px;

    margin-bottom: 22px;

    border-radius:
        999px;

    background:
        #e2e8f0;
}


.upload-processing-bar span {
    display: block;

    width: 38%;
    height: 100%;

    border-radius:
        inherit;

    background:
        linear-gradient(
            90deg,
            #2563eb,
            #06b6d4
        );

    animation:
        upload-progress
        1.4s
        ease-in-out
        infinite;
}


/* =========================================================
   PROCESSING STEPS
========================================================= */

.upload-processing-steps {
    display: grid;

    gap: 9px;

    margin: 0;

    padding: 0;

    list-style: none;

    text-align: left;
}


.upload-processing-steps li {
    display: flex;

    align-items:
        center;

    gap: 10px;

    padding:
        10px
        12px;

    border-radius: 9px;

    color:
        #94a3b8;

    font-size: 11px;

    font-weight: 650;

    transition:
        background 0.18s,
        color 0.18s;
}


.upload-processing-steps li.active {
    background:
        #eff6ff;

    color:
        #1d4ed8;
}


.upload-processing-steps li.complete {
    background:
        #f0fdf4;

    color:
        #047857;
}


.upload-processing-steps
.material-symbols-rounded {
    flex:
        0
        0
        auto;

    font-size: 18px;
}


/* =========================================================
   ANIMATIONS
========================================================= */

@keyframes toast-in {

    from {
        opacity: 0;

        transform:
            translateY(-8px);
    }

    to {
        opacity: 1;

        transform:
            translateY(0);
    }

}


@keyframes upload-spin {

    to {
        transform:
            rotate(360deg);
    }

}


@keyframes upload-progress {

    0% {
        transform:
            translateX(-110%);
    }

    100% {
        transform:
            translateX(365%);
    }

}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (
    max-width: 650px
) {

    .toast-region {
        top: 16px;
        right: 16px;

        width:
            calc(
                100vw
                - 32px
            );
    }


    .ui-confirm,
    .upload-processing-overlay {
        padding: 16px;
    }


    .ui-confirm-card,
    .upload-processing-card {
        padding:
            25px
            21px;
    }


    .ui-confirm-actions {
        flex-direction:
            column-reverse;
    }


    .ui-confirm-actions
    .btn {
        width: 100%;
    }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (
    prefers-reduced-motion:
    reduce
) {

    .app-toast,
    .upload-spinner::after,
    .upload-processing-bar span {
        animation: none;
    }

}