/* Global SweetAlert2 theme — follows the active website palette. */
body .swal2-container {
    --swal-bg-main: var(--bg_main, var(--panel, var(--bg, #0b0d13)));
    --swal-bg-sub: var(--bg_sub, var(--bg, #141821));
    --swal-font-main: var(--font_main, var(--text, #f5f7fb));
    --swal-font-sub: var(--font_sub, var(--muted, #9aa4b2));
    --swal-border: var(--bg_border, var(--border, color-mix(in srgb, var(--main, #00a6ff) 18%, transparent)));
    --swal-confirm: #20c574;
    --swal-cancel: #dc3545;
    font-family: var(--main-font, 'LINE Seed Sans TH', sans-serif) !important;
    position: fixed !important;
    z-index: 2147483647 !important;
}
body .swal2-container.swal2-backdrop-show,
body .swal2-container.swal2-noanimation {
    background: rgba(0, 0, 0, .66) !important;
    backdrop-filter: blur(6px);
}
body .swal2-container .swal2-popup,
body .swal2-container .swal2-toast {
    overflow: hidden;
    border: 1px solid var(--swal-border) !important;
    border-radius: 20px !important;
    background:
        radial-gradient(circle at 50% 0, color-mix(in srgb, var(--main, #00a6ff) 10%, transparent), transparent 44%),
        linear-gradient(145deg, var(--swal-bg-main), color-mix(in srgb, var(--swal-bg-sub) 90%, var(--swal-bg-main))) !important;
    color: var(--swal-font-main) !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .42),
                0 0 30px color-mix(in srgb, var(--main, #00a6ff) 10%, transparent) !important;
}
body .swal2-container .swal2-title {
    color: var(--swal-font-main) !important;
    font-size: clamp(19px, 3vw, 25px) !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
}
/* Keep every title fragment and every SweetAlert2 action at the site's
   maximum readable weight, including custom HTML rendered inside alerts. */
body .swal2-container .swal2-title,
body .swal2-container .swal2-title *,
body .swal2-container .swal2-actions button,
body .swal2-container button.swal2-styled,
body .swal2-container button.swal2-confirm,
body .swal2-container button.swal2-cancel,
body .swal2-container button.swal2-deny {
    font-weight: 700 !important;
}
body .swal2-container .swal2-html-container,
body .swal2-container .swal2-content,
body .swal2-container .swal2-footer {
    color: var(--swal-font-sub) !important;
    font-size: 13px !important;
    line-height: 1.65 !important;
}
body .swal2-container .swal2-html-container b,
body .swal2-container .swal2-html-container strong,
body .swal2-container .swal2-content b,
body .swal2-container .swal2-content strong,
body .swal2-container .font-main,
body .swal2-container .text-main {
    color: var(--swal-font-main) !important;
}
body .swal2-container .font-sub,
body .swal2-container .text-muted {
    color: var(--swal-font-sub) !important;
}
body .swal2-container .bg-mainn {
    background: var(--swal-bg-main) !important;
}
body .swal2-container .bg-sub,
body .swal2-container .swal2-validation-message {
    border: 1px solid var(--swal-border) !important;
    border-radius: 12px !important;
    background: var(--swal-bg-sub) !important;
    color: var(--swal-font-main) !important;
}
body .swal2-container .swal2-input,
body .swal2-container .swal2-select,
body .swal2-container .swal2-textarea,
body .swal2-container .swal2-file {
    border: 1px solid var(--swal-border) !important;
    border-radius: 12px !important;
    background: var(--swal-bg-sub) !important;
    color: var(--swal-font-main) !important;
    box-shadow: none !important;
}
body .swal2-container .swal2-input::placeholder,
body .swal2-container .swal2-textarea::placeholder {
    color: var(--swal-font-sub) !important;
    opacity: .6;
}
body .swal2-container .swal2-input:focus,
body .swal2-container .swal2-select:focus,
body .swal2-container .swal2-textarea:focus {
    border-color: var(--main, #00a6ff) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--main, #00a6ff) 16%, transparent) !important;
}
body .swal2-container .swal2-radio,
body .swal2-container .swal2-checkbox {
    background: transparent !important;
    color: var(--swal-font-main) !important;
}

/* Confirm is always green with white text; cancel is always red. */
body .swal2-container button.swal2-confirm {
    min-height: 42px;
    padding: 9px 19px !important;
    border: 1px solid color-mix(in srgb, var(--swal-confirm) 74%, white) !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, #27d780, var(--swal-confirm)) !important;
    color: #fff !important;
    font-weight: 700 !important;
    box-shadow: 0 9px 24px color-mix(in srgb, var(--swal-confirm) 30%, transparent) !important;
}
body .swal2-container button.swal2-confirm:hover {
    background: linear-gradient(135deg, #31e48d, #18ad63) !important;
    box-shadow: 0 11px 29px color-mix(in srgb, var(--swal-confirm) 40%, transparent) !important;
    transform: translateY(-1px);
}
body .swal2-container button.swal2-cancel {
    min-height: 42px;
    padding: 9px 19px !important;
    border: 1px solid #ef6070 !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, #ef4b5d, var(--swal-cancel)) !important;
    color: #fff !important;
    font-weight: 700 !important;
    box-shadow: 0 9px 24px rgba(220, 53, 69, .28) !important;
}
body .swal2-container button.swal2-cancel:hover {
    background: linear-gradient(135deg, #ff5d70, #c72535) !important;
    box-shadow: 0 11px 29px rgba(220, 53, 69, .38) !important;
    transform: translateY(-1px);
}
body .swal2-container button.swal2-deny {
    min-height: 42px;
    border: 1px solid var(--swal-border) !important;
    border-radius: 12px !important;
    background: var(--swal-bg-sub) !important;
    color: var(--swal-font-main) !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}
body .swal2-container .swal2-actions button:focus {
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 20%, transparent) !important;
}
body .swal2-container .swal2-close {
    color: var(--swal-cancel) !important;
    text-shadow: none !important;
}
body .swal2-container .swal2-timer-progress-bar {
    background: linear-gradient(90deg, var(--main, #00a6ff), var(--sub, #034cba)) !important;
}
body .swal2-container .swal2-loader {
    border-color: var(--swal-confirm) transparent var(--swal-confirm) transparent !important;
}

/* Icon colors remain semantic and readable on the dark themed paper. */
body .swal2-container .swal2-icon.swal2-success {
    border-color: #28d980 !important;
    color: #28d980 !important;
}
body .swal2-container .swal2-success-ring {
    border-color: color-mix(in srgb, #28d980 35%, transparent) !important;
}
body .swal2-container .swal2-success-line-tip,
body .swal2-container .swal2-success-line-long {
    background-color: #28d980 !important;
}
body .swal2-container .swal2-icon.swal2-error {
    border-color: #ff4d61 !important;
    color: #ff4d61 !important;
}
body .swal2-container .swal2-x-mark-line-left,
body .swal2-container .swal2-x-mark-line-right {
    background-color: #ff4d61 !important;
}
body .swal2-container .swal2-icon.swal2-warning {
    border-color: #ffc107 !important;
    color: #ffc107 !important;
}
body .swal2-container .swal2-icon.swal2-info {
    border-color: var(--main, #00a6ff) !important;
    color: var(--main, #00a6ff) !important;
}
body .swal2-container .swal2-icon.swal2-question {
    border-color: var(--sub, #034cba) !important;
    color: var(--sub, #034cba) !important;
}

@media (max-width: 575.98px) {
    body .swal2-container .swal2-popup { width: calc(100% - 24px) !important; }
    body .swal2-container .swal2-actions { gap: 7px; }
    body .swal2-container .swal2-actions button {
        flex: 1 1 120px;
        margin: 0 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body .swal2-container .swal2-popup,
    body .swal2-container .swal2-actions button { transition: none !important; }
}
