/* SweetAlert2 personalizado - Fundación Jesús Infante
   Adaptado a las variables del proyecto para tema claro y oscuro.
   Variables principales: --text, --card-bg, --bg, --neu-card, --neu-card-sm,
   --neu-radius, --border-color, --colorprimary, --colorprimarydark, --muted-text. */

.swal2-popup {
    border-radius: var(--neu-radius, 16px);
    background: var(--surface, var(--bg, var(--neu-bg, #f0ede6)));
    color: var(--text, var(--text-color, #3d3d3d));
    box-shadow: none !important;
}

.swal2-close {
    color: var(--text, var(--text-color, #3d3d3d)) !important;
}

.swal2-shown .swal2-container {
    background: rgba(0, 0, 0, 0.85) !important;
}

.swal2-toast-shown .swal2-popup {
    font-size: 1.2em !important;
}

.swal2-toast-shown .swal2-container {
    background: transparent !important;
}

.swal2-title,
.swal2-content,
.swal2-html-container {
    color: var(--text, var(--text-color, #3d3d3d)) !important;
}

div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line] {
    background: transparent !important;
}

div:where(.swal2-icon).swal2-success .swal2-success-fix {
    background: transparent !important;
}

.swal2-select {
    color: var(--text, var(--text-color, #3d3d3d)) !important;
    background: var(--surface, var(--bg, var(--neu-bg, #f0ede6)));
    border: 1px solid var(--border-color, rgba(128, 128, 128, 0.3));
}

.swal2-select option {
    color: var(--text, var(--text-color, #000000)) !important;
    background: var(--surface, var(--bg, var(--neu-bg, #f0ede6))) !important;
}

.swal2-styled.swal2-confirm {
    background: var(--button-bg, var(--colorprimary, #c9a560));
    color: var(--button-text, #ffffff);
    border: 1px solid transparent;
    box-shadow: none !important;
    font-weight: bold;
}

.swal2-styled.swal2-confirm:hover {
    background: var(--button-hover, var(--colorprimarydark, #a5833e));
    filter: brightness(0.95);
}

.swal2-styled.swal2-cancel {
    background: #6c757d;
    color: #ffffff;
    border: 1px solid transparent;
}

.swal2-styled.swal2-cancel:hover {
    background: #5a6268;
    filter: brightness(0.95);
}

/* Z-index sobre otros modales */
.swal2-popup-quagga,
.swal2-popup-quagga.swal2-popup,
.swal2-container.swal2-shown .swal2-popup-quagga {
    z-index: 999999 !important;
}

.swal2-container {
    z-index: 999999 !important;
}

.swal2-backdrop-show {
    z-index: 999998 !important;
}

/* Toasts */
.swal2-popup.swal2-toast {
    background: var(--surface, var(--bg, var(--neu-bg, #f0ede6)));
    border-radius: 15px;
    box-shadow: none !important;
}

.swal2-popup.swal2-toast .swal2-title {
    color: var(--text, var(--text-color, #3d3d3d)) !important;
    font-size: 1.1em;
    font-weight: 600;
}

.swal2-popup.swal2-toast .swal2-content,
.swal2-popup.swal2-toast .swal2-html-container {
    color: var(--text, var(--text-color, #3d3d3d)) !important;
    font-size: 0.95em;
}

.swal2-popup.swal2-toast .swal2-icon {
    border-color: var(--text, var(--text-color, #3d3d3d)) !important;
}

.swal2-popup.swal2-toast .swal2-icon.swal2-success { border-color: #4ade80 !important; }
.swal2-popup.swal2-toast .swal2-icon.swal2-error { border-color: #f87171 !important; }
.swal2-popup.swal2-toast .swal2-icon.swal2-warning { border-color: #fbbf24 !important; }
.swal2-popup.swal2-toast .swal2-icon.swal2-info { border-color: #60a5fa !important; }

.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content {
    color: var(--text, var(--text-color, #3d3d3d)) !important;
}

.swal2-popup.swal2-toast .swal2-success-ring {
    background: transparent !important;
}

.swal2-popup.swal2-toast .swal2-success-circular-line-left,
.swal2-popup.swal2-toast .swal2-success-circular-line-right {
    background: transparent !important;
}

.swal2-popup.swal2-toast .swal2-success-fix {
    background: transparent !important;
}

.swal2-popup.swal2-toast .swal2-progress-steps .swal2-progress-step {
    background: var(--surface, var(--bg, var(--neu-bg, #f0ede6)));
    color: var(--text, var(--text-color, #3d3d3d));
}

.swal2-popup.swal2-toast .swal2-progress-steps .swal2-progress-step-line {
    background: var(--text, var(--text-color, #3d3d3d));
}

.swal2-popup.swal2-toast .swal2-input,
.swal2-popup.swal2-toast .swal2-textarea,
.swal2-popup.swal2-toast .swal2-select,
.swal2-input,
.swal2-textarea,
.swal2-select {
    background: var(--bg, var(--neu-bg, #f0ede6));
    color: var(--text, var(--text-color, #3d3d3d));
    border: 1px solid var(--border-color, rgba(128, 128, 128, 0.3));
}

.swal2-popup.swal2-toast .swal2-input::placeholder,
.swal2-popup.swal2-toast .swal2-textarea::placeholder,
.swal2-input::placeholder,
.swal2-textarea::placeholder {
    color: var(--muted-text, #777);
}

.swal2-popup.swal2-toast .swal2-validation-message {
    background: rgba(248, 113, 113, 0.9);
    color: white;
}

.swal2-popup.swal2-toast .swal2-footer {
    color: var(--text, var(--text-color, #3d3d3d));
    font-size: 0.85em;
}
