:root {
    --notify-primary: #2563eb;
    --notify-success: #10b981;
    --notify-warning: #f59e0b;
    --notify-error: #ef4444;
    --notify-info: #0ea5e9;
    --notify-dark: #0f172a;
    --notify-muted: #64748b;
    --notify-border: rgba(148, 163, 184, 0.25);
}

.notification-container {
    position: fixed;
    z-index: 5000;
    top: 20px;
    right: 20px;
    width: min(390px, calc(100% - 40px));
    display: grid;
    gap: 12px;
    pointer-events: none;
}

.app-notification {
    position: relative;
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 30px;
    align-items: start;
    gap: 12px;
    overflow: hidden;
    padding: 15px;
    color: var(--notify-dark);
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--notify-border);
    border-radius: 16px;
    box-shadow:
        0 20px 50px rgba(15, 23, 42, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(18px);
    pointer-events: auto;
    animation: notificationEnter 0.35s ease both;
}

.app-notification.is-leaving {
    animation: notificationLeave 0.3s ease both;
}

.app-notification__icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    color: white;
    font-size: 23px;
    border-radius: 13px;
    box-shadow: 0 9px 20px rgba(15, 23, 42, 0.16);
}

.app-notification--success .app-notification__icon {
    background: linear-gradient(135deg, #059669, #34d399);
}

.app-notification--warning .app-notification__icon {
    background: linear-gradient(135deg, #d97706, #fbbf24);
}

.app-notification--error .app-notification__icon {
    background: linear-gradient(135deg, #dc2626, #fb7185);
}

.app-notification--info .app-notification__icon {
    background: linear-gradient(135deg, #0284c7, #38bdf8);
}

.app-notification__content {
    min-width: 0;
    padding-top: 2px;
}

.app-notification__label {
    display: block;
    margin-bottom: 4px;
    color: var(--notify-muted);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.app-notification__title {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.3;
}

.app-notification__message {
    color: var(--notify-muted);
    font-size: 10px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.app-notification__close {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    color: #64748b;
    font-size: 18px;
    background: transparent;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}

.app-notification__close:hover {
    color: #dc2626;
    background: #fff1f2;
}

.app-notification__progress {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    transform-origin: left;
    animation-name: notificationProgress;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

.app-notification--success .app-notification__progress {
    background: var(--notify-success);
}

.app-notification--warning .app-notification__progress {
    background: var(--notify-warning);
}

.app-notification--error .app-notification__progress {
    background: var(--notify-error);
}

.app-notification--info .app-notification__progress {
    background: var(--notify-info);
}

/* Confirmación */

.app-confirm {
    position: fixed;
    z-index: 6000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
}

.app-confirm__backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            circle at 50% 35%,
            rgba(37, 99, 235, 0.16),
            transparent 45%
        ),
        rgba(2, 8, 23, 0.78);
    backdrop-filter: blur(7px);
    animation: confirmBackdropEnter 0.25s ease both;
}

.app-confirm__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 440px);
    padding: 27px;
    text-align: center;
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.98),
            rgba(247, 250, 255, 0.95)
        );
    border: 1px solid rgba(255, 255, 255, 0.75);
    border-radius: 22px;
    box-shadow:
        0 35px 90px rgba(2, 8, 23, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    animation: confirmDialogEnter 0.3s ease both;
}

.app-confirm__glow {
    position: absolute;
    top: -60px;
    left: 50%;
    width: 180px;
    height: 110px;
    background: rgba(37, 99, 235, 0.23);
    border-radius: 50%;
    filter: blur(40px);
    transform: translateX(-50%);
    pointer-events: none;
}

.app-confirm__icon {
    position: relative;
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
    color: white;
    font-size: 32px;
    background: linear-gradient(135deg, #ea580c, #fb923c);
    border: 5px solid #ffedd5;
    border-radius: 21px;
    box-shadow: 0 15px 30px rgba(234, 88, 12, 0.25);
}

.app-confirm--danger .app-confirm__icon {
    background: linear-gradient(135deg, #dc2626, #fb7185);
    border-color: #ffe4e6;
    box-shadow: 0 15px 30px rgba(220, 38, 38, 0.24);
}

.app-confirm--success .app-confirm__icon {
    background: linear-gradient(135deg, #059669, #34d399);
    border-color: #d1fae5;
    box-shadow: 0 15px 30px rgba(5, 150, 105, 0.24);
}

.app-confirm__label {
    display: block;
    margin-bottom: 7px;
    color: var(--notify-primary);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.app-confirm__title {
    margin-bottom: 10px;
    color: var(--notify-dark);
    font-size: 21px;
    line-height: 1.3;
}

.app-confirm__message {
    margin: 0 auto 23px;
    color: var(--notify-muted);
    font-size: 11px;
    line-height: 1.65;
}

.app-confirm__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.app-confirm__button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 15px;
    font-size: 11px;
    font-weight: 800;
    border-radius: 11px;
    cursor: pointer;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.app-confirm__button--cancel {
    color: #475569;
    background: white;
    border: 1px solid #dce5f0;
}

.app-confirm__button--cancel:hover {
    color: #0f172a;
    background: #f8fafc;
}

.app-confirm__button--confirm {
    color: white;
    background: linear-gradient(135deg, #ea580c, #f97316);
    border: 0;
    box-shadow: 0 10px 22px rgba(234, 88, 12, 0.22);
}

.app-confirm--danger .app-confirm__button--confirm {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    box-shadow: 0 10px 22px rgba(220, 38, 38, 0.22);
}

.app-confirm--success .app-confirm__button--confirm {
    background: linear-gradient(135deg, #059669, #10b981);
    box-shadow: 0 10px 22px rgba(5, 150, 105, 0.22);
}

.app-confirm__button:hover {
    transform: translateY(-1px);
}

@keyframes notificationEnter {
    from {
        opacity: 0;
        transform: translateX(35px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes notificationLeave {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(35px);
    }
}

@keyframes notificationProgress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

@keyframes confirmBackdropEnter {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes confirmDialogEnter {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 520px) {
    .notification-container {
        top: 12px;
        right: 12px;
        width: calc(100% - 24px);
    }

    .app-notification {
        grid-template-columns: 42px minmax(0, 1fr) 28px;
        padding: 13px;
    }

    .app-notification__icon {
        width: 42px;
        height: 42px;
    }

    .app-confirm {
        padding: 13px;
    }

    .app-confirm__dialog {
        padding: 22px 18px;
        border-radius: 18px;
    }

    .app-confirm__actions {
        grid-template-columns: 1fr;
    }

    .app-confirm__button--cancel {
        order: 2;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-notification,
    .app-notification.is-leaving,
    .app-confirm__backdrop,
    .app-confirm__dialog,
    .app-notification__progress {
        animation: none;
    }
}