/* ==========================================================================
   SUCRE IMPULSA - SISTEMA DE ALERTAS Y MODALES ORIGINALES
   Reemplazo de alertas y confirmaciones nativas del navegador (alert, confirm)
   ========================================================================== */

/* Contenedor Overlay del Modal */
.sucre-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
}

.sucre-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Tarjeta del Modal */
.sucre-modal-card {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.06);
    padding: 28px 26px 24px;
    text-align: center;
    transform: scale(0.9) translateY(12px);
    transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.24s;
    position: relative;
    overflow: hidden;
}

.sucre-modal-overlay.active .sucre-modal-card {
    transform: scale(1) translateY(0);
}

/* Icono en Insignia Circular */
.sucre-modal-badge {
    width: 68px;
    height: 68px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: transform 0.3s ease;
}

.sucre-modal-overlay.active .sucre-modal-badge {
    transform: scale(1);
    animation: sucreBounce 0.4s ease 0.1s;
}

@keyframes sucreBounce {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* Variantes de color por tipo */
.sucre-modal-badge.type-danger {
    background: #fee2e2;
    color: #dc2626;
    box-shadow: 0 0 0 8px #fef2f2;
}

.sucre-modal-badge.type-warning {
    background: #fef3c7;
    color: #d97706;
    box-shadow: 0 0 0 8px #fffbeb;
}

.sucre-modal-badge.type-success {
    background: #dcfce7;
    color: #16a34a;
    box-shadow: 0 0 0 8px #f0fdf4;
}

.sucre-modal-badge.type-info,
.sucre-modal-badge.type-primary {
    background: #e0f2fe;
    color: #0284c7;
    box-shadow: 0 0 0 8px #f0f9ff;
}

/* Título y Mensaje */
.sucre-modal-title {
    font-family: 'Poppins', 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 10px;
    line-height: 1.35;
}

.sucre-modal-message {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 0.92rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0 0 24px;
    word-break: break-word;
}

/* Acciones / Botones */
.sucre-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.sucre-modal-btn {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s ease;
    min-width: 110px;
    user-select: none;
}

.sucre-modal-btn:focus-visible {
    outline: 2px solid #0f172a;
    outline-offset: 2px;
}

.sucre-modal-btn-cancel {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.sucre-modal-btn-cancel:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.sucre-modal-btn-confirm.btn-danger {
    background: #dc2626;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
}

.sucre-modal-btn-confirm.btn-danger:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(220, 38, 38, 0.45);
}

.sucre-modal-btn-confirm.btn-primary {
    background: #1b7a42;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(27, 122, 66, 0.35);
}

.sucre-modal-btn-confirm.btn-primary:hover {
    background: #145f33;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(27, 122, 66, 0.45);
}

.sucre-modal-btn-confirm.btn-warning {
    background: #d97706;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35);
}

.sucre-modal-btn-confirm.btn-warning:hover {
    background: #b45309;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(217, 119, 6, 0.45);
}

/* ==========================================================================
   TOASTS FLOTANTES ORIGINALES
   ========================================================================== */
.sucre-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1000000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
    width: calc(100vw - 40px);
    pointer-events: none;
}

.sucre-toast {
    pointer-events: auto;
    background: #ffffff;
    border-radius: 14px;
    padding: 14px 16px 14px 18px;
    box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 14px;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
    position: relative;
    overflow: hidden;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.sucre-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.sucre-toast.hide {
    transform: translateX(120%);
    opacity: 0;
}

.sucre-toast-icon {
    font-size: 1.35rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sucre-toast.toast-success {
    border-left: 5px solid #16a34a;
}
.sucre-toast.toast-success .sucre-toast-icon {
    color: #16a34a;
}

.sucre-toast.toast-danger,
.sucre-toast.toast-error {
    border-left: 5px solid #dc2626;
}
.sucre-toast.toast-danger .sucre-toast-icon,
.sucre-toast.toast-error .sucre-toast-icon {
    color: #dc2626;
}

.sucre-toast.toast-warning {
    border-left: 5px solid #d97706;
}
.sucre-toast.toast-warning .sucre-toast-icon {
    color: #d97706;
}

.sucre-toast.toast-info {
    border-left: 5px solid #0284c7;
}
.sucre-toast.toast-info .sucre-toast-icon {
    color: #0284c7;
}

.sucre-toast-body {
    flex: 1;
    min-width: 0;
}

.sucre-toast-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 2px;
}

.sucre-toast-message {
    font-size: 0.84rem;
    color: #475569;
    line-height: 1.45;
    margin: 0;
}

.sucre-toast-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.15rem;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
    flex-shrink: 0;
}

.sucre-toast-close:hover {
    color: #0f172a;
    background: #f1f5f9;
}

.sucre-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.35;
    width: 100%;
    transform-origin: left;
}

@media (max-width: 480px) {
    .sucre-modal-card {
        padding: 24px 20px 20px;
    }
    .sucre-modal-actions {
        flex-direction: column-reverse;
        width: 100%;
    }
    .sucre-modal-btn {
        width: 100%;
    }
    .sucre-toast-container {
        top: 14px;
        right: 14px;
        left: 14px;
        width: auto;
    }
}
