﻿:root {
    --fp-toast-width: min(92vw, 520px);
    --fp-toast-radius: 16px;
    --fp-toast-shadow: 0 14px 35px rgba(15, 23, 42, 0.14);
    --fp-toast-border: #e6edf5;
    --fp-toast-bg: rgba(255, 255, 255, 0.98);
    --fp-toast-title: #223041;
    --fp-toast-text: #607086;
    --fp-toast-close: #7c8a9c;
    --fp-info: #4f9fe8;
    --fp-info-soft: rgba(79, 159, 232, 0.12);
    --fp-success: #22b573;
    --fp-success-soft: rgba(34, 181, 115, 0.12);
    --fp-warning: #f59e0b;
    --fp-warning-soft: rgba(245, 158, 11, 0.12);
    --fp-error: #ef4444;
    --fp-error-soft: rgba(239, 68, 68, 0.12);
}

/* Contenedor */
.fp-toast-root {
    position: fixed;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: var(--fp-toast-width);
    pointer-events: none;
}

.fp-toast-root--top-center {
    top: 78px;
    left: 50%;
    transform: translateX(-50%);
}

.fp-toast-root--top-right {
    top: 78px;
    right: 20px;
}

.fp-toast-root--bottom-right {
    right: 20px;
    bottom: 20px;
}

/* Toast */
.fp-toast {
    position: relative;
    display: grid;
    grid-template-columns: 46px 1fr 18px;
    gap: 14px;
    align-items: start;
    padding: 14px 16px;
    border-radius: var(--fp-toast-radius);
    background: var(--fp-toast-bg);
    /*border: 1px solid var(--fp-toast-border);*/
    box-shadow: var(--fp-toast-shadow);
    backdrop-filter: blur(8px);
    overflow: hidden;
    pointer-events: auto;
    animation: fpToastIn 0.22s ease-out;
}

    .fp-toast.is-closing {
        animation: fpToastOut 0.20s ease-in forwards;
    }

.fp-toast__icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fp-accent-soft);
    color: var(--fp-accent);
    flex-shrink: 0;
}

    .fp-toast__icon svg {
        width: 22px;
        height: 22px;
    }

.fp-toast__content {
    min-width: 0;
}

.fp-toast__title {
    margin: 0;
    font-size: 15px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--fp-toast-title);
}

.fp-toast__message {
    margin: 6px 0 0 0;
    font-size: 14px;
    line-height: 1.45;
    color: var(--fp-toast-text);
    word-break: break-word;
}

.fp-toast__close {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--fp-toast-close);
    cursor: pointer;
    padding: 0;
    margin-top: 2px;
    font-size: 18px;
    line-height: 1;
    transition: transform 0.15s ease, opacity 0.15s ease;
    opacity: 0.8;
}

    .fp-toast__close:hover {
        transform: scale(1.08);
        opacity: 1;
    }

.fp-toast__progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    transform-origin: left center;
    background: var(--fp-accent);
    opacity: 0.85;
    animation: fpToastProgress var(--fp-duration) linear forwards;
}

/* Variantes */
.fp-toast--success {
    --fp-accent: var(--fp-success);
    --fp-accent-soft: var(--fp-success-soft);
}

.fp-toast--info {
    --fp-accent: var(--fp-info);
    --fp-accent-soft: var(--fp-info-soft);
}

.fp-toast--warning {
    --fp-accent: var(--fp-warning);
    --fp-accent-soft: var(--fp-warning-soft);
}

.fp-toast--error {
    --fp-accent: var(--fp-error);
    --fp-accent-soft: var(--fp-error-soft);
}

/* Animaciones */
@keyframes fpToastIn {
    from {
        opacity: 0;
        transform: translateY(-14px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fpToastOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

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

@keyframes fpToastProgress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

/* Dark mode */
body.dark-mode .fp-toast {
    background: var(--color-principal);
    border-color: var(--color-bordes);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

body.dark-mode .fp-toast__title {
    color: var(--color-texto);
}

body.dark-mode .fp-toast__message {
    color: var(--color-texto);
}

body.dark-mode .fp-toast__close {
    color: #b8c4d4;
}

/* Responsive */
@media (max-width: 768px) {
    .fp-toast-root--top-center,
    .fp-toast-root--top-right {
        top: 68px;
    }

    .fp-toast-root--top-center {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    .fp-toast-root--top-right,
    .fp-toast-root--bottom-right {
        right: 12px;
        left: 12px;
        width: auto;
        transform: none;
    }

    .fp-toast {
        grid-template-columns: 42px 1fr 18px;
        padding: 12px 14px;
        gap: 12px;
    }

    .fp-toast__icon {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }
}
