/* SweetAlert2: match site typography + Bootstrap (loads after sweetalert2.min.css; #wrapper uses bg-body-tertiary; html has data-bs-theme) */
.swal2-container {
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --swal2-background: var(--bs-tertiary-bg);
    --swal2-color: var(--bs-body-color);
    --swal2-border: 1px solid var(--bs-border-color);
    --swal2-border-radius: var(--bs-border-radius-lg);
    --swal2-footer-border-color: var(--bs-border-color);
    --swal2-footer-background: transparent;
    --swal2-footer-color: var(--bs-secondary-color);
    --swal2-close-button-color: var(--bs-secondary-color);
    --swal2-input-border: 1px solid var(--bs-border-color);
    --swal2-input-background: var(--bs-body-bg);
    --swal2-input-box-shadow: none;
    --swal2-input-hover-box-shadow: none;
    /* Drop default blue focus ring / border (sweetalert2.min.css --swal2-input-focus-*) */
    --swal2-input-focus-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;
    --swal2-input-focus-border: 1px solid var(--bs-border-color);
    --swal2-validation-message-background: var(--bs-secondary-bg);
    --swal2-validation-message-color: var(--bs-body-color);
    --swal2-timer-progress-bar-background: rgba(var(--bs-emphasis-color-rgb), 0.25);
}
[data-bs-theme="dark"] .swal2-container {
    --swal2-backdrop: rgba(0, 0, 0, 0.65);
}
/* Repeat on .swal2-popup so [data-swal2-theme=dark] from the library does not override inherited vars */
.swal2-container .swal2-popup {
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --swal2-background: var(--bs-tertiary-bg);
    --swal2-color: var(--bs-body-color);
    box-shadow: var(--bs-box-shadow-lg);
}
/* Modals: SweetAlert2 defaults (1.875em title, 1.125em body) read larger than the rest of the site */
.swal2-popup:not(.swal2-toast) h2.swal2-title {
    font-size: 1.25rem !important;
    font-weight: 500 !important;
    color: var(--bs-emphasis-color);
}
.swal2-popup:not(.swal2-toast) .swal2-html-container {
    font-size: 1rem !important;
}
.swal2-container input.swal2-input,
.swal2-container input.swal2-file,
.swal2-container textarea.swal2-textarea,
.swal2-container select.swal2-select,
.swal2-container .swal2-radio label,
.swal2-container .swal2-checkbox label {
    font-size: 0.85em !important;
}
.swal2-container div.swal2-validation-message {
    font-size: 0.85em !important;
    font-weight: 400 !important;
}
.swal2-container button.swal2-close {
    font-family: inherit;
    font-size: 1.75rem;
}
.swal2-container input.swal2-input::placeholder,
.swal2-container input.swal2-file::placeholder,
.swal2-container textarea.swal2-textarea::placeholder {
    color: var(--bs-secondary-color);
    opacity: 1;
}

/* Lucide icons (iconHtml): base SVG sizing; toasts + modals override below */
.swal2-icon .swal2-icon-content svg.swal2-lucide-icon {
    display: block;
    width: 1.35em;
    height: 1.35em;
    vertical-align: middle;
}

/* Modals: Lucide — remove default double-ring / animated success artwork */
.swal2-popup:not(.swal2-toast) .swal2-icon:has(svg.swal2-lucide-icon) {
    border: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
    line-height: 1 !important;
    width: auto !important;
    height: auto !important;
    margin: 1.15em auto 0.5em !important;
    animation: none !important;
}
.swal2-popup:not(.swal2-toast) .swal2-icon:has(svg.swal2-lucide-icon) .swal2-icon-content {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: inherit !important;
}
.swal2-popup:not(.swal2-toast) .swal2-icon .swal2-icon-content svg.swal2-lucide-icon {
    width: 3.25rem;
    height: 3.25rem;
}
.swal2-popup:not(.swal2-toast) .swal2-icon.swal2-success {
    color: var(--bs-success);
}
.swal2-popup:not(.swal2-toast) .swal2-icon.swal2-error {
    color: var(--bs-danger);
}
.swal2-popup:not(.swal2-toast) .swal2-icon.swal2-warning {
    color: var(--bs-warning-text-emphasis);
}
.swal2-popup:not(.swal2-toast) .swal2-icon.swal2-info {
    color: var(--bs-info-text-emphasis);
}
.swal2-popup:not(.swal2-toast) .swal2-icon.swal2-question {
    color: var(--bs-primary);
}

/* Drop SweetAlert2's default circular frame (border + 50% radius) on toasts */
.swal2-toast .swal2-icon {
    border: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
    line-height: 1 !important;
}

.swal2-toast .swal2-icon .swal2-icon-content svg.swal2-lucide-icon {
    width: 1.65rem;
    height: 1.65rem;
}

/* Toast icons (e.g. Settings saved): Lucide uses currentColor — swap SweetAlert’s default hues for Bootstrap tokens */
.swal2-toast .swal2-icon.swal2-success {
    color: var(--bs-success);
}
.swal2-toast .swal2-icon.swal2-error {
    color: var(--bs-danger);
}
.swal2-toast .swal2-icon.swal2-warning {
    color: var(--bs-warning-text-emphasis);
}
.swal2-toast .swal2-icon.swal2-info {
    color: var(--bs-info-text-emphasis);
}
.swal2-toast .swal2-icon.swal2-question {
    color: var(--bs-primary);
}

/* Toasts: base 1rem (site body); title + html container track that via 1em */
.swal2-toast.swal2-popup {
    font-size: 1rem;
    box-shadow: var(--bs-box-shadow);
}
/* Lighter than SweetAlert2’s default modal title (600) */
.swal2-toast h2.swal2-title {
    font-weight: 500 !important;
    font-size: 1em !important;
    color: var(--bs-emphasis-color);
}

.swal2-toast .swal2-html-container {
    font-weight: 400 !important;
    font-size: 1em !important;
}

/* Toast: Lucide on close + action buttons */
.swal2-toast button.swal2-close {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    line-height: 1;
    opacity: 0.88;
}
.swal2-toast button.swal2-close:hover {
    opacity: 1;
}
.swal2-toast button.swal2-close svg.swal2-close-lucide {
    display: block;
    width: 1.1rem;
    height: 1.1rem;
}
.swal2-toast .swal2-actions button.swal2-styled {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}
.swal2-toast .swal2-actions button.swal2-styled svg.swal2-btn-lucide {
    display: block;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* Action buttons: match Bootstrap / main.css (SweetAlert2 uses its own colors + color-mix hovers) */
.swal2-container .swal2-popup:not(.swal2-toast) .swal2-actions {
    gap: 0.5rem;
}
.swal2-container .swal2-popup:not(.swal2-toast) .swal2-actions button.swal2-styled.btn {
    margin: 0 !important;
    padding: var(--bs-btn-padding-y) var(--bs-btn-padding-x) !important;
    font-size: var(--bs-btn-font-size) !important;
    font-weight: var(--bs-btn-font-weight) !important;
    line-height: var(--bs-btn-line-height) !important;
    border-radius: var(--bs-btn-border-radius) !important;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}
.swal2-container .swal2-popup:not(.swal2-toast) .swal2-actions button.swal2-styled.swal2-confirm.btn.btn-primary {
    --swal2-confirm-button-background-color: var(--bs-btn-bg);
    --swal2-confirm-button-color: var(--bs-btn-color);
    border: var(--bs-btn-border-width) solid var(--bs-btn-border-color) !important;
    box-shadow: var(--bs-btn-box-shadow) !important;
}
.swal2-container .swal2-popup:not(.swal2-toast) .swal2-actions button.swal2-styled.swal2-confirm.btn.btn-primary:hover {
    background-color: var(--bs-btn-hover-bg) !important;
    color: var(--bs-btn-hover-color) !important;
    border-color: var(--bs-btn-hover-border-color) !important;
}
.swal2-container .swal2-popup:not(.swal2-toast) .swal2-actions button.swal2-styled.swal2-confirm.btn.btn-primary:active {
    background-color: var(--bs-btn-active-bg) !important;
    color: var(--bs-btn-active-color) !important;
    border-color: var(--bs-btn-active-border-color) !important;
}
.swal2-container .swal2-popup:not(.swal2-toast) .swal2-actions button.swal2-styled.swal2-cancel.btn.btn-outline-secondary {
    --swal2-cancel-button-background-color: var(--bs-btn-bg);
    --swal2-cancel-button-color: var(--bs-btn-color);
    border: var(--bs-btn-border-width) solid var(--bs-btn-border-color) !important;
    box-shadow: var(--bs-btn-box-shadow) !important;
}
.swal2-container .swal2-popup:not(.swal2-toast) .swal2-actions button.swal2-styled.swal2-cancel.btn.btn-outline-secondary:hover {
    background-color: var(--bs-btn-hover-bg) !important;
    color: var(--bs-btn-hover-color) !important;
    border-color: var(--bs-btn-hover-border-color) !important;
}
.swal2-container .swal2-popup:not(.swal2-toast) .swal2-actions button.swal2-styled.swal2-cancel.btn.btn-outline-secondary:active {
    background-color: var(--bs-btn-active-bg) !important;
    color: var(--bs-btn-active-color) !important;
    border-color: var(--bs-btn-active-border-color) !important;
}
.swal2-container .swal2-popup:not(.swal2-toast) .swal2-actions button.swal2-styled.swal2-deny.btn.btn-outline-danger {
    --swal2-deny-button-background-color: var(--bs-btn-bg);
    --swal2-deny-button-color: var(--bs-btn-color);
    border: var(--bs-btn-border-width) solid var(--bs-btn-border-color) !important;
    box-shadow: var(--bs-btn-box-shadow) !important;
}
.swal2-container .swal2-popup:not(.swal2-toast) .swal2-actions button.swal2-styled.swal2-deny.btn.btn-outline-danger:hover {
    background-color: var(--bs-btn-hover-bg) !important;
    color: var(--bs-btn-hover-color) !important;
    border-color: var(--bs-btn-hover-border-color) !important;
}
.swal2-container .swal2-popup:not(.swal2-toast) .swal2-actions button.swal2-styled.swal2-deny.btn.btn-outline-danger:active {
    background-color: var(--bs-btn-active-bg) !important;
    color: var(--bs-btn-active-color) !important;
    border-color: var(--bs-btn-active-border-color) !important;
}
/* Dark theme: same visibility fix as .modal .btn-outline-secondary in main.css */
[data-bs-theme="dark"] .swal2-container button.swal2-styled.btn.btn-outline-secondary {
    --bs-btn-color: rgba(255, 255, 255, 0.88);
    --bs-btn-border-color: rgba(255, 255, 255, 0.42);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: rgba(255, 255, 255, 0.08);
    --bs-btn-hover-border-color: rgba(255, 255, 255, 0.55);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: rgba(255, 255, 255, 0.12);
    --bs-btn-active-border-color: rgba(255, 255, 255, 0.55);
}
