/*
 * Institute — SweetAlert2
 * Tema visual global para web, panel y administración.
 * No modifica la librería vendor.
 */


/* Fondo */

.swal2-container.swal2-backdrop-show,
.swal2-container.swal2-noanimation {
    background: var(
        --theme-overlay-override,
        rgba(7, 9, 12, .72)
    );
    backdrop-filter: blur(
        var(--theme-blur-soft-override, 5px)
    );
    -webkit-backdrop-filter: blur(
        var(--theme-blur-soft-override, 5px)
    );
}


/* Ventana */

.swal2-container .swal2-popup {
    color: var(--theme-text) !important;
    background: var(--theme-surface) !important;

    border: var(--theme-card-border-width-override, 1px) solid var(--theme-border);
    border-radius: var(--theme-card-radius-override, 16px);

    box-shadow: var(
        --theme-shadow-overlay-override,
        0 24px 70px rgba(0, 0, 0, .48)
    );

    font-family: inherit;
}


/* Encabezado y contenido */

.swal2-container .swal2-title {
    margin-bottom: 4px;

    color: var(--theme-text, #f4f5f7) !important;

    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
}

.swal2-container .swal2-content,
.swal2-container .swal2-html-container {
    color: var(--theme-text-muted, #aeb6c2) !important;

    font-size: 14px;
    line-height: 1.55;
}

.swal2-container .swal2-content p,
.swal2-container .swal2-html-container p {
    color: inherit !important;
}


/*
 * SWEETALERT INNER CONTENT COLOR
 * Algunos wrappers internos reciben colores legacy globales.
 * Deben heredar el texto semántico definido por html-container.
 */
.swal2-container
.swal2-html-container > div {
    color: inherit !important;
}


/* Iconos */

.swal2-container .swal2-icon {
    margin-top: 20px;
    margin-bottom: 18px;
}

.swal2-container .swal2-icon.swal2-warning {
    color: var(--theme-status-warning, #ffab00) !important;

    border-color: color-mix(
        in srgb,
        var(--theme-status-warning, #ffab00) 58%,
        transparent
    ) !important;

}

/* SWEETALERT WARNING CONTENT */
.swal2-container
.swal2-icon.swal2-warning
.swal2-icon-content {
    color: inherit !important;
}


.swal2-container .swal2-icon.swal2-error {
    color: #e05b5b;
    border-color: rgba(224, 91, 91, .55);
}

.swal2-container .swal2-icon.swal2-error [class^="swal2-x-mark-line"] {
    background-color: #e05b5b;
}

.swal2-container .swal2-icon.swal2-info {
    /*
     * Dark conserva el aspecto histórico.
     * Light oscurece semánticamente el azul info contra la
     * superficie del modal para asegurar mejor contraste.
     */
    --institute-swal-info-color: light-dark(
        color-mix(
            in srgb,
            var(--theme-status-info, #27aeff) 55%,
            var(
                --theme-surface-contrast,
                var(--theme-text, #2b171d)
            ) 45%
        ),
        #7ea6cf
    );

    color: var(--institute-swal-info-color) !important;

    border-color: color-mix(
        in srgb,
        var(--institute-swal-info-color) 58%,
        transparent
    ) !important;
}

.swal2-container
.swal2-icon.swal2-info
.swal2-icon-content {
    color: inherit !important;
}

.swal2-container .swal2-icon.swal2-question {
    color: var(--theme-text-muted);
    border-color: color-mix(in srgb, var(--theme-text-muted, #aeb6c2) 50%, transparent);
}

.swal2-container .swal2-icon.swal2-success {
    color: #43c78a;
    border-color: rgba(67, 199, 138, .62);
}

.swal2-container .swal2-icon.swal2-success .swal2-success-ring,
.swal2-container .swal2-icon.swal2-success .swal2-success-circular-line-left,
.swal2-container .swal2-icon.swal2-success .swal2-success-circular-line-right,
.swal2-container .swal2-icon.swal2-success .swal2-success-fix {
    display: none !important;
}

.swal2-container .swal2-icon.swal2-success .swal2-success-line-tip,
.swal2-container .swal2-icon.swal2-success .swal2-success-line-long {
    background-color: #43c78a !important;
}


/* Loader */

.swal2-container .institute-swal-loader-wrap {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 92px;
}

.swal2-container .institute-swal-loader {
    display: block;

    width: 46px;
    height: 46px;

    border: 3px solid var(--theme-border, rgba(255,255,255,.12));
    border-top-color: var(--theme-accent);
    border-right-color: color-mix(in srgb, var(--theme-accent, #b20000) 55%, transparent);
    border-radius: 50%;

    animation: institute-swal-spin .75s linear infinite;
}

@keyframes institute-swal-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .swal2-container .institute-swal-loader {
        animation-duration: 1.5s;
    }
}


/* Acciones */

.swal2-container .swal2-actions {
    margin-top: 24px;
}

.swal2-container .swal2-styled,
.swal2-container .swal2-popup .btn {
    min-height: 40px;

    border-radius: var(--theme-button-radius-override, 9px);

    font-size: 13px;
    font-weight: 600;

    box-shadow: none;
}

.swal2-container .swal2-styled.swal2-confirm,
.swal2-container .swal2-popup .btn-primary {
    color: var(--theme-accent-contrast, #fff);
    background: var(--theme-accent);
    border-color: var(--theme-accent);
}

.swal2-container .swal2-styled.swal2-confirm:hover,
.swal2-container .swal2-popup .btn-primary:hover {
    color: var(--theme-accent-contrast, #fff);
    background: var(--theme-accent-strong, #980000);
    border-color: var(--theme-accent-strong, #980000);
}

.swal2-container .swal2-styled.swal2-cancel,
.swal2-container .swal2-popup .btn-secondary {
    color: var(--theme-text, #d9dde3);
    background: var(--theme-surface-soft);
    border-color: var(--theme-border);
}

.swal2-container .swal2-styled.swal2-cancel:hover,
.swal2-container .swal2-popup .btn-secondary:hover {
    color: var(--theme-text, #fff);
    background: var(--theme-glass-hover-override, #292e37);
    border-color: var(--theme-border, #3b414c);
}

.swal2-container .swal2-popup .btn-danger {
    color: #fff;
    background: #a51f2d;
    border-color: #a51f2d;
}

.swal2-container .swal2-popup .btn-danger:hover {
    color: #fff;
    background: #8f1926;
    border-color: #8f1926;
}


/* Inputs usados dentro de SweetAlert */

.swal2-container .swal2-input,
.swal2-container .swal2-textarea,
.swal2-container .swal2-select {
    color: var(--theme-text);
    background: var(--theme-field-bg);

    border: 1px solid var(--theme-border);
    border-radius: var(--theme-control-radius);

    box-shadow: none;
}

.swal2-container .swal2-input:focus,
.swal2-container .swal2-textarea:focus,
.swal2-container .swal2-select:focus {
    border-color: var(--theme-accent);

}


/* Formularios incrustados */

.swal2-container .swal2-popup .input-label {
    display: block;

    margin-bottom: 8px;

    color: var(--theme-text, #d9dde3);

    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}

.swal2-container .swal2-popup .form-control {
    min-height: 42px;
    padding: 0 13px;

    color: var(--theme-text);
    background: var(--theme-field-bg);

    border: 1px solid var(--theme-border);
    border-radius: var(--theme-control-radius);

    box-shadow: none;
}

.swal2-container .swal2-popup textarea.form-control {
    min-height: 100px;
    padding-top: 11px;
    padding-bottom: 11px;
}

.swal2-container .swal2-popup .form-control::placeholder {
}

.swal2-container .swal2-popup .form-control:focus {
    color: var(--theme-text);
    background: var(--theme-field-bg);

    border-color: var(--theme-accent);

    outline: 0;
}

.swal2-container .swal2-popup .form-control:disabled,
.swal2-container .swal2-popup .form-control[readonly] {
}


/* Cierre */

.swal2-container .swal2-close {
    color: var(--theme-text-muted);
}

.swal2-container .swal2-close:hover {
    color: var(--theme-text, #fff);
}


/* Mobile */

@media (max-width: 575px) {

    .swal2-container {
        padding: 12px;
    }

    .swal2-container .swal2-popup {
        max-width: 100%;
        padding: 22px 16px 20px;

        border-radius: var(--theme-card-radius-override, 13px);
    }

    .swal2-container .swal2-title {
        font-size: 20px;
    }

    .swal2-container .swal2-content,
    .swal2-container .swal2-html-container {
        font-size: 13px;
    }

    .swal2-container .swal2-actions {
        width: 100%;
    }
}


/*
 * ==========================================================
 * SWEETALERT — RICH CONTENT SEMANTIC PRIMITIVES
 * ==========================================================
 * Contenido HTML complejo insertado mediante Swal.fire().
 * ==========================================================
 */

.swal2-container .institute-swal-content {
    color: var(--theme-text, #f4f5f7);
}

.swal2-container .institute-swal-content__title,
.swal2-container .institute-swal-content__text,
.swal2-container .institute-swal-content__value {
    color: var(--theme-text, #f4f5f7) !important;
}

.swal2-container .institute-swal-content__label,
.swal2-container .institute-swal-content__muted {
    color: var(--theme-text-muted, #aeb6c2) !important;
}

.swal2-container .institute-swal-content__surface {
    color: var(--theme-text, #f4f5f7) !important;
    background: var(--theme-surface-soft) !important;
    border: 1px solid var(--theme-border);
}

.swal2-container .institute-swal-content__accent-icon {
    color: var(--theme-accent-contrast, #ffffff) !important;
    background: linear-gradient(
        135deg,
        var(--theme-accent-strong, var(--theme-accent, #b4283e)),
        var(--theme-accent, #b4283e)
    ) !important;
}

.swal2-container .institute-swal-content__accent-icon svg,
.swal2-container .institute-swal-content__accent-icon svg * {
    color: inherit !important;
    stroke: currentColor !important;
}

.swal2-container .institute-swal-content__accent-value {
    color: var(--theme-accent, #b4283e) !important;
}

.swal2-container .institute-swal-content__divider {
    background: var(--theme-border) !important;
}

.swal2-container .institute-swal-content__primary-action {
    color: var(--theme-accent-contrast, #ffffff) !important;
    background: var(--theme-accent, #b4283e) !important;
    border: 1px solid var(--theme-accent, #b4283e) !important;
    box-shadow: none !important;
}

.swal2-container .institute-swal-content__primary-action:hover,
.swal2-container .institute-swal-content__primary-action:focus {
    color: var(--theme-accent-contrast, #ffffff) !important;
    background: var(--theme-accent-strong, var(--theme-accent, #b4283e)) !important;
    border-color: var(--theme-accent-strong, var(--theme-accent, #b4283e)) !important;
}

.swal2-container .institute-swal-content__secondary-action {
    color: var(--theme-text, #f4f5f7) !important;
    background: color-mix(
        in srgb,
        var(--theme-text, #f4f5f7) 6%,
        transparent
    ) !important;
    border: 1px solid var(--theme-border) !important;
    box-shadow: none !important;
}

.swal2-container .institute-swal-content__secondary-action:hover,
.swal2-container .institute-swal-content__secondary-action:focus {
    color: var(--theme-text, #f4f5f7) !important;
    background: var(
        --theme-glass-hover-override,
        color-mix(in srgb, var(--theme-text, #f4f5f7) 10%, transparent)
    ) !important;
}

.swal2-container .institute-swal-content__quiet-action {
    color: var(--theme-text-muted, #aeb6c2) !important;
    background: transparent !important;
    border: 0 !important;
}

.swal2-container .institute-swal-content__quiet-action:hover,
.swal2-container .institute-swal-content__quiet-action:focus {
    color: var(--theme-text, #f4f5f7) !important;
}


/* Resumen interno que usa la familia semántica de contenido */
.swal2-container .institute-swal-exchange-summary {
    background: var(
        --theme-content-surface,
        var(--theme-surface-soft)
    ) !important;

    color: var(
        --theme-content-text,
        var(--theme-text)
    ) !important;

    border-color: var(
        --theme-content-border,
        var(--theme-border)
    ) !important;
}

.swal2-container
.institute-swal-exchange-summary
.institute-swal-content__label {
    color: var(
        --theme-content-text-muted,
        var(--theme-text-muted)
    ) !important;
}

.swal2-container
.institute-swal-exchange-summary
.institute-swal-content__value:not(.institute-swal-content__accent-value) {
    color: var(
        --theme-content-text,
        var(--theme-text)
    ) !important;
}


/*
 * SWEETALERT — LÍNEA DE TÍTULO
 *
 * Los títulos Institute que reutilizan .after-line deben mantener
 * el separador cromáticamente unido al propio título.
 */
.swal2-container
.institute-swal-content__title.after-line::after {
    background-color: currentColor !important;
}
