/* ============================================
   NOTIFICACIONES — Toast reutilizable
   Success | Warning | Error | Info
   Esquina superior derecha, sin librerías
   ============================================ */

.tp-notify-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
    width: min(100% - 2rem, 360px);
    pointer-events: none;
}

.tp-notify {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    width: 100%;
    padding: 0.9rem 1rem 1.1rem;
    border-radius: 0.9rem;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.9));
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 14px 40px rgba(2, 6, 23, 0.45);
    color: #f8fafc;
    backdrop-filter: blur(10px);
    pointer-events: auto;
    overflow: hidden;
    opacity: 0;
    transform: translateX(120%);
    transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.tp-notify::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: currentColor;
    opacity: 0.85;
}

.tp-notify.is-visible {
    opacity: 1;
    transform: translateX(0);
}

.tp-notify.is-leaving {
    opacity: 0;
    transform: translateX(120%);
}

.tp-notify__icon {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    margin-top: 1px;
}

.tp-notify__icon svg {
    width: 20px;
    height: 20px;
}

.tp-notify__body {
    flex: 1;
    min-width: 0;
}

.tp-notify__title {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 0.15rem;
}

.tp-notify__message {
    font-size: var(--font-size-sm, 0.875rem);
    color: rgba(226, 232, 240, 0.9);
    line-height: 1.45;
    word-break: break-word;
}

.tp-notify__close {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: rgba(248, 250, 252, 0.06);
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    transition: color var(--transition-fast, 180ms ease), background var(--transition-fast, 180ms ease), transform var(--transition-fast, 180ms ease);
}

.tp-notify__close:hover {
    color: #f8fafc;
    background: rgba(248, 250, 252, 0.14);
    transform: translateY(-1px);
}

.tp-notify__close svg {
    width: 14px;
    height: 14px;
}

.tp-notify__progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    transform-origin: left;
    animation-name: tpNotifyProgress;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

.tp-notify:hover .tp-notify__progress {
    animation-play-state: paused;
}

/* Tipos */
.tp-notify--success {
    color: #34d399;
    border-color: rgba(52, 211, 153, 0.28);
}

.tp-notify--success .tp-notify__title,
.tp-notify--success .tp-notify__icon {
    color: #a7f3d0;
}

.tp-notify--success .tp-notify__progress {
    background: linear-gradient(90deg, #10b981, #34d399);
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.5);
}

.tp-notify--warning {
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.3);
}

.tp-notify--warning .tp-notify__title,
.tp-notify--warning .tp-notify__icon {
    color: #fde68a;
}

.tp-notify--warning .tp-notify__progress {
    background: linear-gradient(90deg, #d97706, #fbbf24);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.tp-notify--error {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
}

.tp-notify--error .tp-notify__title,
.tp-notify--error .tp-notify__icon {
    color: #fecaca;
}

.tp-notify--error .tp-notify__progress {
    background: linear-gradient(90deg, #dc2626, #f87171);
    box-shadow: 0 0 10px rgba(248, 113, 113, 0.5);
}

.tp-notify--info {
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.3);
}

.tp-notify--info .tp-notify__title,
.tp-notify--info .tp-notify__icon {
    color: #bfdbfe;
}

.tp-notify--info .tp-notify__progress {
    background: linear-gradient(90deg, #2563eb, #60a5fa);
    box-shadow: 0 0 10px rgba(96, 165, 250, 0.5);
}

@keyframes tpNotifyProgress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

@media (max-width: 480px) {
    .tp-notify-container {
        top: 0.75rem;
        right: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tp-notify {
        transition: none;
    }

    .tp-notify__progress {
        animation: none;
    }
}
