.magi-dialog-shell[hidden] {
    display: none !important;
}

.magi-dialog-shell {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.magi-dialog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    opacity: 0;
    transition: opacity 180ms ease;
}

.magi-dialog-card {
    position: relative;
    width: min(460px, 100%);
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 24px;
    box-shadow:
        0 28px 70px rgba(15, 23, 42, 0.26),
        0 3px 12px rgba(15, 23, 42, 0.08);
    padding: 30px 30px 26px;
    text-align: center;
    transform: translateY(12px) scale(0.96);
    opacity: 0;
    transition:
        transform 190ms cubic-bezier(.2,.8,.2,1),
        opacity 180ms ease;
}

.magi-dialog-shell.is-open .magi-dialog-backdrop {
    opacity: 1;
}

.magi-dialog-shell.is-open .magi-dialog-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.magi-dialog-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 12px;
    background: #f8fafc;
    color: #64748b;
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 16px;
    transition: 150ms ease;
}

.magi-dialog-close:hover {
    background: #f1f5f9;
    color: #0f172a;
    transform: rotate(4deg);
}

.magi-dialog-icon {
    width: 74px;
    height: 74px;
    margin: 2px auto 18px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    font-size: 31px;
}

.magi-dialog-kicker {
    margin-bottom: 7px;
    color: #94a3b8;
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.magi-dialog-title {
    margin: 0;
    color: #0f172a;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 800;
}

.magi-dialog-message {
    margin: 13px auto 0;
    max-width: 390px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.65;
    white-space: pre-line;
}

.magi-dialog-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 26px;
}

.magi-dialog-button {
    min-width: 122px;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: 13px;
    border: 1px solid transparent;
    font: inherit;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
    transition:
        transform 140ms ease,
        box-shadow 140ms ease,
        background 140ms ease;
}

.magi-dialog-button:hover {
    transform: translateY(-1px);
}

.magi-dialog-button.is-cancel {
    background: #ffffff;
    color: #475569;
    border-color: #dbe3ee;
}

.magi-dialog-button.is-cancel:hover {
    background: #f8fafc;
}

.magi-dialog-button.is-primary {
    background: #2563eb;
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
}

.magi-dialog-button.is-primary:hover {
    background: #1d4ed8;
}

.magi-dialog-shell.tone-success .magi-dialog-icon {
    background: #ecfdf5;
    color: #16a34a;
    box-shadow: 0 0 0 9px #f0fdf4;
}

.magi-dialog-shell.tone-info .magi-dialog-icon {
    background: #eff6ff;
    color: #2563eb;
    box-shadow: 0 0 0 9px #f8fbff;
}

.magi-dialog-shell.tone-warning .magi-dialog-icon {
    background: #fffbeb;
    color: #d97706;
    box-shadow: 0 0 0 9px #fffdf5;
}

.magi-dialog-shell.tone-error .magi-dialog-icon,
.magi-dialog-shell.tone-danger .magi-dialog-icon {
    background: #fef2f2;
    color: #dc2626;
    box-shadow: 0 0 0 9px #fff7f7;
}

.magi-dialog-shell.tone-danger .magi-dialog-button.is-primary,
.magi-dialog-shell.tone-error .magi-dialog-button.is-primary {
    background: #dc2626;
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.20);
}

.magi-dialog-shell.tone-danger .magi-dialog-button.is-primary:hover,
.magi-dialog-shell.tone-error .magi-dialog-button.is-primary:hover {
    background: #b91c1c;
}

body.magi-dialog-open {
    overflow: hidden;
}

@media (max-width: 560px) {
    .magi-dialog-shell {
        padding: 16px;
        align-items: flex-end;
    }

    .magi-dialog-card {
        width: 100%;
        border-radius: 24px 24px 18px 18px;
        padding: 29px 20px 21px;
    }

    .magi-dialog-actions {
        flex-direction: column-reverse;
    }

    .magi-dialog-button {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .magi-dialog-backdrop,
    .magi-dialog-card,
    .magi-dialog-close,
    .magi-dialog-button {
        transition: none !important;
    }
}

/* =========================================================
   TOASTS MAGI IM
   ========================================================= */

.magi-toast-stack {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 2147483100;
    width: min(390px, calc(100vw - 32px));
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.magi-toast {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 12px;

    padding: 14px 13px 14px 14px;

    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 16px;

    box-shadow:
        0 18px 45px rgba(15, 23, 42, 0.16),
        0 2px 8px rgba(15, 23, 42, 0.06);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    opacity: 0;
    transform: translateY(-10px) scale(0.98);

    transition:
        opacity 180ms ease,
        transform 200ms cubic-bezier(.2,.8,.2,1);

    pointer-events: auto;
}

.magi-toast.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.magi-toast-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;

    display: grid;
    place-items: center;

    font-size: 18px;
}

.magi-toast.tone-success .magi-toast-icon {
    background: #ecfdf5;
    color: #16a34a;
}

.magi-toast.tone-info .magi-toast-icon {
    background: #eff6ff;
    color: #2563eb;
}

.magi-toast.tone-warning .magi-toast-icon {
    background: #fffbeb;
    color: #d97706;
}

.magi-toast.tone-error .magi-toast-icon,
.magi-toast.tone-danger .magi-toast-icon {
    background: #fef2f2;
    color: #dc2626;
}

.magi-toast-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.magi-toast-title {
    color: #0f172a;
    font-size: 14px;
    line-height: 1.25;
    font-weight: 800;
}

.magi-toast-message {
    color: #64748b;
    font-size: 12.5px;
    line-height: 1.4;
}

.magi-toast-close {
    width: 32px;
    height: 32px;

    display: grid;
    place-items: center;

    border: 0;
    border-radius: 9px;
    background: transparent;

    color: #94a3b8;
    cursor: pointer;
}

.magi-toast-close:hover {
    background: #f1f5f9;
    color: #334155;
}

@media (max-width: 560px) {
    .magi-toast-stack {
        top: 14px;
        left: 14px;
        right: 14px;
        width: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .magi-toast {
        transition: none !important;
    }
}


/* =========================================================
   LOGOUT SPOTLIGHT
   ========================================================= */

.magi-logout-spotlight {
    position: fixed;
    inset: 0;
    z-index: 2147483200;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 200ms ease,
        visibility 200ms ease;
}

.magi-logout-spotlight.is-open {
    opacity: 1;
    visibility: visible;
}

.magi-logout-spotlight__backdrop {
    position: absolute;
    inset: 0;

    background:
        rgba(15, 23, 42, 0.30);

    backdrop-filter: blur(11px);
    -webkit-backdrop-filter: blur(11px);
}

.magi-logout-spotlight__card {
    position: relative;
    z-index: 1;

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

    padding: 42px 42px 38px;

    text-align: center;

    border:
        1px solid rgba(255, 255, 255, 0.72);

    border-radius: 30px;

    background:
        rgba(255, 255, 255, 0.96);

    box-shadow:
        0 35px 90px rgba(15, 23, 42, 0.30),
        0 8px 24px rgba(15, 23, 42, 0.10);

    transform:
        translateY(16px)
        scale(0.95);

    opacity: 0;

    transition:
        transform 220ms cubic-bezier(.2,.85,.25,1),
        opacity 180ms ease;
}

.magi-logout-spotlight.is-open
.magi-logout-spotlight__card {
    transform:
        translateY(0)
        scale(1);

    opacity: 1;
}

.magi-logout-spotlight__close {
    position: absolute;

    top: 17px;
    right: 17px;

    width: 38px;
    height: 38px;

    border: 0;
    border-radius: 12px;

    background: transparent;

    color: #94a3b8;

    display: grid;
    place-items: center;

    cursor: pointer;

    font-size: 17px;

    transition:
        background 150ms ease,
        color 150ms ease,
        transform 150ms ease;
}

.magi-logout-spotlight__close:hover {
    background: #f1f5f9;
    color: #334155;
    transform: rotate(4deg);
}

.magi-logout-spotlight__icon {
    width: 88px;
    height: 88px;

    margin: 0 auto 21px;

    display: grid;
    place-items: center;

    border-radius: 28px;

    background:
        linear-gradient(
            145deg,
            #dcfce7,
            #ecfdf5
        );

    color: #16a34a;

    font-size: 37px;

    box-shadow:
        0 0 0 11px rgba(240, 253, 244, 0.82),
        0 13px 28px rgba(22, 163, 74, 0.13);
}

.magi-logout-spotlight__brand {
    margin-bottom: 9px;

    color: #94a3b8;

    font-size: 11px;
    font-weight: 850;

    letter-spacing: .18em;

    text-transform: uppercase;
}

.magi-logout-spotlight__title {
    margin: 0;

    color: #0f172a;

    font-size: 30px;
    font-weight: 850;

    line-height: 1.15;
}

.magi-logout-spotlight__message {
    margin: 14px auto 0;

    color: #64748b;

    font-size: 16px;

    line-height: 1.6;
}

body.magi-logout-spotlight-open {
    overflow: hidden;
}

@media (max-width: 600px) {
    .magi-logout-spotlight {
        padding: 18px;
    }

    .magi-logout-spotlight__card {
        width: 100%;

        padding:
            37px
            23px
            31px;

        border-radius: 25px;
    }

    .magi-logout-spotlight__title {
        font-size: 26px;
    }

    .magi-logout-spotlight__message {
        font-size: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .magi-logout-spotlight,
    .magi-logout-spotlight__card,
    .magi-logout-spotlight__close {
        transition: none !important;
    }
}
