/* =============================================================================
   DIGIFACT - Notificaciones transitorias (componente unico)
   -----------------------------------------------------------------------------
   Un solo estilo para los dos contextos del estandar:
     .digifact-notificaciones        -> contenedor de TOASTS (esquina inf. derecha)
     .digifact-notificacion--inline  -> mensaje INLINE dentro de un formulario
   Los colores acompanan al tipo, pero el mensaje SIEMPRE lleva icono + texto
   (no depende solo del color). Autocierre 2.5 s (success/info), 3.5 s (warning),
   5 s (error) + boton X. Ver assets/js/notificaciones.js
   ========================================================================== */

.digifact-notificaciones,
.digifact-notif-host {
    --digifact-notif-success: #059669;
    --digifact-notif-error: #dc2626;
    --digifact-notif-warning: #d97706;
    --digifact-notif-info: #0891b2;
}

/* --- Contenedor global de TOASTS (esquina inferior derecha) --------------- */
.digifact-notificaciones {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 2055;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .5rem;
    width: min(360px, calc(100vw - 24px));
    pointer-events: none;
}
.digifact-notificaciones:empty { display: none; }

/* --- Host inline dentro de formularios ------------------------------------ */
.digifact-notif-host { display: block; }
.digifact-notif-host:empty { display: none; }

/* --- Tarjeta de notificacion (mismo componente en ambos contextos) -------- */
.digifact-notificacion {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    width: 100%;
    padding: .6rem .7rem;
    background: #ffffff;
    border: 1px solid var(--border-color, #e5e7eb);
    border-left: 4px solid var(--digifact-notif-info);
    border-radius: .5rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .16);
    font-size: .875rem;
    line-height: 1.35;
    color: var(--text-primary, #111827);
    animation: digifactNotifEntrada .18s ease-out;
}
.digifact-notificacion--inline {
    margin-top: .85rem;
    box-shadow: none;
    background: #ffffff;
}

.digifact-notificacion--success { border-left-color: var(--digifact-notif-success); }
.digifact-notificacion--error   { border-left-color: var(--digifact-notif-error); }
.digifact-notificacion--warning { border-left-color: var(--digifact-notif-warning); }
.digifact-notificacion--info    { border-left-color: var(--digifact-notif-info); }

.digifact-notificacion__icono { margin-top: .15rem; font-size: 1rem; }
.digifact-notificacion--success .digifact-notificacion__icono { color: var(--digifact-notif-success); }
.digifact-notificacion--error   .digifact-notificacion__icono { color: var(--digifact-notif-error); }
.digifact-notificacion--warning .digifact-notificacion__icono { color: var(--digifact-notif-warning); }
.digifact-notificacion--info    .digifact-notificacion__icono { color: var(--digifact-notif-info); }

.digifact-notificacion__cuerpo { flex: 1 1 auto; min-width: 0; }
.digifact-notificacion__titulo { font-weight: 600; }
.digifact-notificacion__mensaje { word-wrap: break-word; overflow-wrap: anywhere; }
.digifact-notificacion__pie { margin-top: .15rem; font-size: .78rem; color: var(--text-secondary, #6b7280); }

.digifact-notificacion__cerrar {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: var(--text-secondary, #6b7280);
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 .15rem;
    cursor: pointer;
}
.digifact-notificacion__cerrar:hover { color: var(--text-primary, #111827); }

/* --- Salida suave (~250 ms) y eliminacion del DOM ------------------------- */
.digifact-notificacion--saliendo {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .25s ease, transform .25s ease;
}

@keyframes digifactNotifEntrada {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 576px) {
    .digifact-notificaciones {
        right: 8px;
        left: 8px;
        bottom: 8px;
        width: auto;
        align-items: stretch;
    }
}
