/* Avisos compartidos SyILife. Ver docs/contratos/avisos.md. */
.th-alerts-enabled .swal2-container { padding: 1rem; }
.th-alerts-enabled .swal2-popup {
    --swal2-background: #141f34;
    --swal2-color: var(--th-color-on-dark);
    --swal2-title-color: var(--th-color-on-dark);
    --swal2-input-background: #fff;
    --swal2-input-color: var(--th-color-heading);
    max-width: calc(100vw - 2rem);
    padding: 0 0 1.35rem;
    isolation: isolate;
    border: 1px solid rgba(162, 184, 234, .25);
    border-radius: var(--th-radius-dialog);
    /* SweetAlert escribe background inline; el tema compartido conserva sus capas. */
    background-image: radial-gradient(ellipse at 0 0, rgba(75, 98, 197, .27), transparent 60%), linear-gradient(125deg, #111b2d, #172038 55%, #1c2340) !important;
    box-shadow: 0 24px 80px rgba(8, 15, 33, .38), inset 0 1px 0 rgba(255, 255, 255, .1);
    font-family: inherit;
}
/* Un único destello de luz; no cubre el foco ni intercepta clics. */
.th-alerts-enabled .swal2-popup::before {
    content: '';
    position: absolute;
    z-index: 3;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(110deg, transparent 36%, rgba(160, 193, 255, .18) 43%, rgba(226, 237, 255, .32) 50%, rgba(160, 193, 255, .18) 57%, transparent 64%);
    background-size: 240% 100%;
    background-position: 100% 0;
    pointer-events: none;
    opacity: 0;
    /* Independiente de showClass: también funciona con entradas personalizadas. */
    animation: th-alert-flash 1.1s .08s linear both;
}
.th-alerts-enabled .swal2-title { padding: 1.4rem 1.5rem 0; color: var(--th-color-on-dark); font-size: var(--th-text-xl); font-weight: var(--th-weight-semibold); line-height: 1.4; letter-spacing: -.02em; overflow-wrap: anywhere; }
/* Compatibilidad con títulos históricos que usaban la utilidad Bootstrap text-dark. */
.th-alerts-enabled .swal2-title.text-dark { color: var(--th-color-on-dark) !important; }
.th-alerts-enabled .swal2-html-container {
    --bs-secondary-color: #a2b1c9;
    --bs-secondary-rgb: 162, 177, 201;
    --bs-dark-rgb: 197, 208, 227;
    margin: .9rem 1.75rem 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--th-color-muted-on-dark);
    font-size: var(--th-text-sm);
    line-height: 1.65;
    overflow-wrap: anywhere;
}
.th-alerts-enabled .swal2-html-container a { color: #a9c8ff; }
.th-alerts-enabled .swal2-html-container :is(.table, .card, .alert, .bg-light, .bg-white, .form-control, .form-select, .input-group-text) {
    --bs-secondary-color: #6c757d;
    --bs-secondary-rgb: 108, 117, 125;
    --bs-dark-rgb: 33, 37, 41;
}
.th-alerts-enabled .swal2-html-container :is(.bg-light, .bg-white) { color: #34445d; }
.th-alerts-enabled .swal2-html-container :is(.table, .bg-light, .bg-white) a { color: var(--th-gradient-blue-start); }
.th-alerts-enabled .swal2-html-container:empty { margin: 0; padding: 0; border: 0; }
.th-alerts-enabled .swal2-popup .swal2-icon {
    --alert-icon-rgb: 137, 186, 255;
    margin: 1.65rem auto .15rem;
    border-width: 2px;
    background: radial-gradient(circle at 35% 20%, rgba(var(--alert-icon-rgb), .15), transparent 70%);
    box-shadow: 0 0 0 .45rem rgba(var(--alert-icon-rgb), .045), inset 0 1px 0 rgba(255, 255, 255, .12);
    animation: th-alert-icon-float 2.8s ease-in-out infinite;
}
.th-alerts-enabled .swal2-icon::after {
    content: '';
    position: absolute;
    inset: -.5rem;
    border: 1px solid rgba(var(--alert-icon-rgb), .25);
    border-radius: 50%;
    pointer-events: none;
    animation: th-alert-icon-halo 2.8s ease-in-out infinite;
}
.th-alerts-enabled .swal2-icon .swal2-icon-content { font-size: 2.8rem; font-weight: 500; }
.th-alerts-enabled .swal2-icon.swal2-success { --alert-icon-rgb: 101, 217, 163; color: #65d9a3; border-color: rgba(101, 217, 163, .45); }
.th-alerts-enabled .swal2-success .swal2-success-ring { border-color: rgba(101, 217, 163, .3); }
.th-alerts-enabled .swal2-success [class^="swal2-success-line"] { background-color: #65d9a3; }
/* Las máscaras nativas asumen un fondo plano; sobre el degradado deben ser transparentes. */
.th-alerts-enabled .swal2-success [class^="swal2-success-circular-line"],
.th-alerts-enabled .swal2-success .swal2-success-fix { background: transparent !important; }
.th-alerts-enabled .swal2-icon.swal2-error { --alert-icon-rgb: 255, 157, 169; color: #ff9da9; border-color: rgba(255, 157, 169, .5); }
.th-alerts-enabled .swal2-error [class^="swal2-x-mark-line"] { background-color: #ff9da9; }
.th-alerts-enabled .swal2-icon.swal2-warning { --alert-icon-rgb: 245, 202, 131; color: #f5ca83; border-color: rgba(245, 202, 131, .5); }
.th-alerts-enabled .swal2-icon.swal2-info { color: #89baff; border-color: rgba(137, 186, 255, .5); }
.th-alerts-enabled .swal2-icon.swal2-question { --alert-icon-rgb: 185, 176, 255; color: #b9b0ff; border-color: rgba(185, 176, 255, .5); }
.th-alerts-enabled .swal2-actions { gap: .65rem; max-width: calc(100% - 2.5rem); margin: 1.25rem auto 0; }
.th-alerts-enabled .swal2-styled.swal2-confirm,
.th-alerts-enabled .swal2-styled.swal2-cancel,
.th-alerts-enabled .swal2-styled.swal2-deny {
    min-height: var(--th-control-height);
    max-width: 100%;
    margin: 0;
    padding: .7rem 1.15rem;
    border: 1px solid rgba(193, 211, 249, .2);
    border-radius: .75rem;
    background-image: linear-gradient(135deg, rgba(255, 255, 255, .07), rgba(8, 15, 33, .12));
    box-shadow: 0 4px 12px rgba(8, 15, 33, .18), inset 0 1px 0 rgba(255, 255, 255, .12);
    color: #fff;
    font-family: inherit;
    font-size: var(--th-text-sm);
    font-weight: var(--th-weight-semibold);
    line-height: 1.4;
    overflow-wrap: anywhere;
    transition: box-shadow .18s ease, border-color .18s ease;
}
.th-alerts-enabled .swal2-styled:hover { border-color: rgba(193, 211, 249, .5); box-shadow: 0 6px 18px rgba(8, 15, 33, .26); }
.th-alerts-enabled .swal2-styled:active { box-shadow: inset 0 2px 5px rgba(8, 15, 33, .25); }
.th-alerts-enabled .swal2-styled:focus-visible,
.th-alerts-enabled .swal2-close:focus-visible { outline: 3px solid #bdd0ff; outline-offset: 3px; box-shadow: none; }
.th-alerts-enabled .swal2-styled:disabled { opacity: .65; cursor: wait; }
.th-alerts-enabled .swal2-close { color: #a2b1c9; border-radius: .5rem; }
.th-alerts-enabled .swal2-close:hover { color: #fff; }
.th-alerts-enabled .swal2-loader { border-color: #a6beff transparent #a6beff transparent; }
.th-alerts-enabled .swal2-timer-progress-bar { background: linear-gradient(90deg, #72b6ef, #9a8cf0); }
.th-alerts-enabled .swal2-footer { margin-top: 1.25rem; border-color: rgba(162, 184, 234, .2); color: var(--th-color-muted-on-dark); font-size: var(--th-text-xs); }
.th-alerts-enabled .swal2-footer a { color: #b9cbff; }
.th-alerts-enabled .swal2-input,
.th-alerts-enabled .swal2-textarea,
.th-alerts-enabled .swal2-select { max-width: calc(100% - 2.5rem); border: 1px solid #cbd7eb; border-radius: .65rem; background: #fff; color: var(--th-color-heading); font-size: var(--th-text-sm); }
.th-alerts-enabled .swal2-input-label { color: var(--th-color-on-dark); font-size: var(--th-text-sm); }
.th-alerts-enabled .swal2-validation-message { margin-inline: 1.25rem; border-radius: .65rem; font-size: var(--th-text-sm); }
.th-alerts-enabled .swal2-popup.swal2-toast { padding: .85rem; }
.th-alerts-enabled .swal2-toast .swal2-title { padding: .25rem; font-size: var(--th-text-sm); }
.th-alerts-enabled .swal2-toast .swal2-html-container { margin: .25rem; padding: .5rem; font-size: var(--th-text-sm); }
.th-alerts-enabled .swal2-toast .swal2-icon { margin: 0 .5rem 0 0; box-shadow: none; }
.th-alerts-enabled .swal2-toast .swal2-icon::after { inset: -.15rem; }
.th-alerts-enabled .swal2-toast .swal2-icon .swal2-icon-content { font-size: 1.5rem; }
@keyframes th-alert-flash {
    0% { background-position: 100% 0; opacity: 0; }
    15%, 85% { opacity: 1; }
    100% { background-position: 0% 0; opacity: 0; }
}
@keyframes th-alert-icon-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-.2rem) scale(1.03); }
}
@keyframes th-alert-icon-halo {
    0%, 100% { transform: scale(1); opacity: .4; }
    50% { transform: scale(1.1); opacity: .8; }
}
@media (max-width: 575.98px) {
    .th-alerts-enabled .swal2-title { padding-inline: 1rem; font-size: var(--th-text-lg); }
    .th-alerts-enabled .swal2-html-container { margin-inline: 1.25rem; }
    .th-alerts-enabled .swal2-actions { max-width: calc(100% - 2rem); gap: var(--th-space-2); }
    .th-alerts-enabled .swal2-styled { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
    .th-alerts-enabled .swal2-popup::before { display: none; }
    .th-alerts-enabled .swal2-popup,
    .th-alerts-enabled .swal2-icon,
    .th-alerts-enabled .swal2-icon::after,
    .th-alerts-enabled .swal2-icon *,
    .th-alerts-enabled .swal2-backdrop-show,
    .th-alerts-enabled .swal2-backdrop-hide { animation: none !important; }
    .th-alerts-enabled .swal2-styled { transition: none; }
}
