/* Papo toast — feedback flutuante no canto superior direito */

.papo-toast-root {
    position: fixed;
    top: max(1rem, env(safe-area-inset-top, 0px));
    right: max(1rem, env(safe-area-inset-right, 0px));
    z-index: 1000002;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    width: min(22rem, calc(100vw - 2rem));
    pointer-events: none;
}

.papo-toast {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    width: 100%;
    padding: 0.75rem 0.875rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--papo-color-border, #e2e8f0);
    box-shadow:
        0 16px 40px -12px rgba(15, 23, 42, 0.22),
        0 4px 12px -4px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    color: var(--papo-color-text, #0f172a);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.8125rem;
    line-height: 1.45;
    pointer-events: auto;
    transform: translateX(calc(100% + 1.5rem));
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

.papo-toast.is-visible {
    transform: translateX(0);
    opacity: 1;
}

.papo-toast.is-leaving {
    transform: translateX(calc(100% + 1.5rem));
    opacity: 0;
}

.papo-toast__icon {
    flex-shrink: 0;
    width: 1.375rem;
    height: 1.375rem;
    margin-top: 0.05rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

.papo-toast__body {
    flex: 1;
    min-width: 0;
    padding-right: 0.25rem;
}

.papo-toast__message {
    margin: 0;
    word-break: break-word;
}

.papo-toast__close {
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    margin: -0.125rem -0.125rem 0 0;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--papo-color-muted, #64748b);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}

.papo-toast__close:hover {
    background: rgba(15, 23, 42, 0.06);
    color: var(--papo-color-text, #0f172a);
}

.papo-toast__close:focus-visible {
    outline: 2px solid var(--papo-color-brand, #61ce70);
    outline-offset: 2px;
}

.papo-toast--success {
    border-left: 3px solid var(--papo-color-brand, #61ce70);
}

.papo-toast--success .papo-toast__icon {
    background: var(--papo-color-brand-soft, #f0fdf4);
    color: var(--papo-color-brand-dark, #28a745);
}

.papo-toast--error {
    border-left: 3px solid var(--papo-color-danger, #dc3545);
}

.papo-toast--error .papo-toast__icon {
    background: #fef2f2;
    color: var(--papo-color-danger, #dc3545);
}

.papo-toast--warning {
    border-left: 3px solid #f59e0b;
}

.papo-toast--warning .papo-toast__icon {
    background: #fffbeb;
    color: #d97706;
}

.papo-toast--info {
    border-left: 3px solid var(--papo-color-primary, #007cba);
}

.papo-toast--info .papo-toast__icon {
    background: #eff6ff;
    color: var(--papo-color-primary, #007cba);
}

@media (max-width: 768px) {
    .papo-toast-root {
        top: max(0.75rem, env(safe-area-inset-top, 0px));
        right: max(0.75rem, env(safe-area-inset-right, 0px));
        width: min(20rem, calc(100vw - 1.5rem));
    }

    .papo-toast {
        padding: 0.6875rem 0.75rem;
        font-size: 0.78125rem;
    }
}
