/* ================== Pacioli SweetAlert2 (Full) ================== */

/* Variables base */
:root {
    --pacioli-primary:#263B89;
    --pl-text:#374151;           /* NUEVO: texto base para contenedor html */
    --pl-muted:#A0AEC0;
}

/* Popup */
.swal2-popup{
    border-radius:16px !important;
    padding:2rem 2rem 1.5rem !important;
    font-family:"Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    box-shadow:0 10px 30px rgba(0,0,0,.12);
}
.swal2-title{
    font-weight:800 !important;
    color:#2d3748 !important;
    letter-spacing:.2px;
}
.swal2-html-container{
    color:var(--pl-text) !important;
    font-size:1.05rem !important;
}

/* Iconos (borde más marcado) */
.swal2-icon{ border-width:3px !important; }
.swal2-icon.swal2-error{ border-color:#ea868f !important; color:#e35d6a !important; }
.swal2-icon.swal2-info{ border-color:#9ec5fe !important; color:#2563eb !important; }
.swal2-icon.swal2-warning{ border-color:#ffd8a8 !important; color:#d9480f !important; }

/* === FIX success: evitar que herede negro por currentColor === */
.swal2-icon.swal2-success{
    /* color de aro y del check */
    border-color:#8ad7a0 !important;
    color:#2f855a !important;                  /* fallback frente a herencias globales */
    --swal2-success:#2f855a;                   /* variable interna (algunas builds la usan) */
}
/* líneas del check */
.swal2-icon.swal2-success .swal2-success-line-tip,
.swal2-icon.swal2-success .swal2-success-line-long{
    background-color:#2f855a !important;
}
/* anillo exterior */
.swal2-icon.swal2-success .swal2-success-ring{
    border:.25em solid rgba(47,133,90,.35) !important;
}

/* Toast + success sobre fondo oscuro */
.swal2-toast .swal2-icon.swal2-success{
    color:#34d399 !important;                  /* un poco más luminoso para contraste en #111827 */
    border-color:#a7f3d0 !important;
}
.swal2-toast .swal2-icon.swal2-success .swal2-success-line-tip,
.swal2-toast .swal2-icon.swal2-success .swal2-success-line-long{
    background-color:#34d399 !important;
}
.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{
    border-color:rgba(52,211,153,.35) !important;
}

/* Botones */
.swal2-actions{
    justify-content:center !important;
    gap:.5rem;
    margin-top:1.25rem !important;
}
.swal2-styled{
    border-radius:10px !important;
    padding:.65rem 1.15rem !important;
    font-weight:700 !important;
    box-shadow:0 3px 10px rgba(0,0,0,.08);
}
.swal2-styled.swal2-confirm{
    background:var(--pacioli-primary) !important;
    border:0 !important;
}
.swal2-styled.swal2-cancel{
    background:#e9ecef !important;
    color:#111827 !important;
    border:0 !important;
}

/* Botón “Ver detalle” (lo añade Alerts.js) */
.swal2-details-btn{
    background:#f1f5f9 !important;
    color:#0f172a !important;
    border:1px solid #e2e8f0 !important;
    border-radius:10px;
    padding:.55rem .95rem;
    font-weight:600;
}
.swal2-details-btn:hover{ background:#e9eef6 !important; }

/* Loader (cuando usamos Alerts.loading) */
.swal2-loader{
    border-width:.25rem !important;
    border-color: rgba(38,59,137,.2) rgba(38,59,137,.2) rgba(38,59,137,.2) var(--pacioli-primary) !important;
    width:2.1rem !important;
    height:2.1rem !important;
}

/* Toast (arriba a la derecha) */
.swal2-toast{
    border-radius:10px !important;
    background:#111827 !important;
    color:#fff !important;
    box-shadow:0 6px 20px rgba(0,0,0,.18);
}
.swal2-timer-progress-bar{ background:rgba(255,255,255,.25) !important; }

/* ===== Estados inválidos homogéneos (inputs + select2) ===== */
.is-invalid{ border-color:#dc3545 !important; }
.is-invalid:focus{
    box-shadow:0 0 0 .2rem rgba(220,53,69,.15) !important;
}
.invalid-feedback.pl-msg{
    display:block;
    color:#dc3545;
    font-weight:600;
    margin-top:.35rem;
}
/* Select2 en error */
.select2-container .select2-selection.is-invalid,
.select2-container--bootstrap-5 .select2-selection.is-invalid{
    border-color:#dc3545 !important;
    box-shadow:0 0 0 .2rem rgba(220,53,69,.15) !important;
}
/* Alinear textos de lista de validación de Alerts.validation */
.swal2-html-container ul.pl-errors{
    text-align:left;
    margin:0;
    padding-left:1.2rem;
    color:var(--pl-text);
}

/* ===== Loading BAR (default) ===== */
.pl-loading { display:flex; flex-direction:column; align-items:center; gap:.9rem; }
.pl-bar {
    width:280px;
    max-width:80vw;
    height:6px;
    border-radius:999px;
    background:#eef2f7;
    overflow:hidden;
    position:relative;
    border:1px solid #e6e9f0;
}
.pl-bar::after{
    content:"";
    position:absolute;
    inset:0 50% 0 0;
    border-radius:999px;
    background:linear-gradient(90deg, rgba(38,59,137,.15), rgba(38,59,137,.85));
    animation:pl-bar 1.1s ease-in-out infinite;
}
@keyframes pl-bar{
    0%{ left:-40%; right:100%; }
    50%{ left:10%; right:10%; }
    100%{ left:100%; right:-40%; }
}
.pl-text{ font-weight:700; color:#2d3748; }

/* ===== Loading DOTS ===== */
.pl-dots{ display:flex; gap:.45rem; align-items:center; justify-content:center; }
.pl-dots span{
    width:8px; height:8px; border-radius:999px;
    background:var(--pacioli-primary);
    opacity:.35;
    animation:pl-dot 1.2s infinite;
}
.pl-dots span:nth-child(2){ animation-delay:.15s }
.pl-dots span:nth-child(3){ animation-delay:.30s }
.pl-dots span:nth-child(4){ animation-delay:.45s }
@keyframes pl-dot{
    0%,100%{ transform:translateY(0); opacity:.35 }
    50%{ transform:translateY(-6px); opacity:1 }
}

/* ===== Loading RING ===== */
.pl-ring{ width:48px; height:48px; position:relative; }
.pl-ring::before, .pl-ring::after{
    content:"";
    position:absolute;
    inset:0;
    border-radius:50%;
    border:3px solid rgba(38,59,137,.25);
    border-top-color:var(--pacioli-primary);
    animation:pl-ring 0.9s linear infinite;
}
.pl-ring::after{
    inset:6px;
    border-top-color:rgba(38,59,137,.55);
    animation-direction:reverse;
}
@keyframes pl-ring{ to{ transform:rotate(360deg) } }

.pl-toast {
    background: #fff !important;
    color: #333 !important;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
    border-radius: 8px;
    font-size: 0.9rem;
}
.pl-toast .swal2-icon {
    border: none !important;
}
