/*
 * SweetAlert2 (v10) in the product's look: calm colours, smaller icons, 8px buttons, the
 * dashboards' tokens and a .theme-dark version. Loaded after SweetAlert2 in every layout, with
 * public/js/swal-theme.js, which turns a page's confirmButtonColor into these styles
 * (red -> danger, green -> go) instead of an inline colour.
 */
.swal2-container {
    --sw-ink: #1f2937;
    --sw-muted: #6b7280;
    --sw-faint: #98a1ad;
    --sw-line: #e3e6ea;
    --sw-card: #ffffff;
    --sw-soft: #f6f8fa;
    --sw-brand: #378bbe;
    --sw-brand-soft: #e8f1f8;
    --sw-good: #1e7b3c;
    --sw-bad: #b42318;
    --sw-bad-soft: #fde4e4;
    --sw-warn: #d9a43a;
    --sw-warn-soft: #fdf1d8;
    --sw-ok-icon: #2f9e5b;
    --sw-bad-icon: #d0605a;
    --sw-shadow: 0 18px 44px -12px rgba(15, 23, 42, 0.28), 0 2px 8px rgba(15, 23, 42, 0.06);
}
body.theme-dark .swal2-container {
    --sw-ink: #e5e7eb;
    --sw-muted: #a3aab5;
    --sw-faint: #7d8592;
    --sw-line: #2f3349;
    --sw-card: #1f2233;
    --sw-soft: #262a3d;
    --sw-brand-soft: #1d3447;
    --sw-bad: #c2413a;
    --sw-bad-soft: #4a1f1f;
    --sw-warn-soft: #3d3117;
    --sw-shadow: 0 18px 44px -12px rgba(0, 0, 0, 0.7);
}

/* Backdrop */
.swal2-container.swal2-backdrop-show,
.swal2-container.swal2-noanimation {
    background: rgba(15, 23, 42, 0.42);
}
body.theme-dark .swal2-container.swal2-backdrop-show,
body.theme-dark .swal2-container.swal2-noanimation {
    background: rgba(0, 0, 0, 0.6);
}

/* Dialog */
.swal2-container .swal2-popup:not(.swal2-toast) {
    width: 26em;
    padding: 22px 22px 18px;
    border: 1px solid var(--sw-line);
    border-radius: 14px;
    background: var(--sw-card);
    color: var(--sw-ink);
    box-shadow: var(--sw-shadow);
    font-size: 14px;
}
body.theme-dark .swal2-container .swal2-popup {
    background: var(--sw-card) !important;
    color: var(--sw-ink) !important;
}
.swal2-container .swal2-popup:not(.swal2-toast) .swal2-title {
    margin: 0 0 6px;
    padding: 0 6px;
    color: var(--sw-ink);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
}
body.theme-dark .swal2-container .swal2-title {
    color: var(--sw-ink) !important;
}
.swal2-container .swal2-popup:not(.swal2-toast) .swal2-content,
.swal2-container .swal2-popup:not(.swal2-toast) .swal2-html-container {
    padding: 0 6px;
    color: var(--sw-muted);
    font-size: 14px;
    line-height: 1.5;
}
.swal2-container .swal2-content b,
.swal2-container .swal2-content strong {
    color: var(--sw-ink);
}
.swal2-container .swal2-footer {
    margin: 16px 0 0;
    padding: 12px 0 0;
    border-top: 1px solid var(--sw-line);
    color: var(--sw-muted);
    font-size: 12.5px;
}
.swal2-container .swal2-close {
    color: var(--sw-faint);
    font-size: 26px;
}
.swal2-container .swal2-close:hover {
    color: var(--sw-ink);
}
.swal2-container .swal2-close:focus {
    box-shadow: 0 0 0 3px var(--sw-brand-soft);
}

/* Icons: smaller, in the product's status colours */
.swal2-container .swal2-popup:not(.swal2-toast) .swal2-icon {
    font-size: 10px;
    margin: 6px auto 16px;
    border-width: 0.3em;
}
.swal2-container .swal2-icon.swal2-warning {
    border-color: var(--sw-warn);
    color: var(--sw-warn);
}
.swal2-container .swal2-icon.swal2-info,
.swal2-container .swal2-icon.swal2-question {
    border-color: var(--sw-brand);
    color: var(--sw-brand);
}
.swal2-container .swal2-icon.swal2-error {
    border-color: var(--sw-bad-icon);
    color: var(--sw-bad-icon);
}
.swal2-container .swal2-icon.swal2-error [class^="swal2-x-mark-line"] {
    background-color: var(--sw-bad-icon);
}
.swal2-container .swal2-icon.swal2-success {
    border-color: var(--sw-ok-icon);
    color: var(--sw-ok-icon);
}
.swal2-container .swal2-icon.swal2-success [class^="swal2-success-line"] {
    background-color: var(--sw-ok-icon);
}
.swal2-container .swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(47, 158, 91, 0.28);
}
/* The success tick's animation hides behind pieces painted in the popup's colour. */
.swal2-container .swal2-icon.swal2-success [class^="swal2-success-circular-line"],
.swal2-container .swal2-icon.swal2-success .swal2-success-fix {
    background-color: var(--sw-card) !important;
}

/* Buttons */
.swal2-container .swal2-actions {
    margin: 18px auto 0;
    gap: 8px;
}
.swal2-container .swal2-styled {
    margin: 0;
    height: 36px;
    padding: 0 16px;
    border-radius: 8px !important;
    font-size: 13.5px !important;
    font-weight: 700;
    line-height: 1;
    box-shadow: none !important;
    transition: filter 0.12s, background-color 0.12s, border-color 0.12s;
}
.swal2-container .swal2-styled.swal2-confirm {
    border: 1px solid var(--sw-brand) !important;
    background: var(--sw-brand) !important;
    color: #fff !important;
}
.swal2-container .swal2-styled.swal2-deny,
.swal2-container .swal2-styled.swal2-cancel {
    border: 1px solid var(--sw-line) !important;
    background: var(--sw-card) !important;
    color: var(--sw-ink) !important;
}
.swal2-container .swal2-styled.swal2-confirm:hover {
    filter: brightness(1.08);
}
.swal2-container .swal2-styled.swal2-deny:hover,
.swal2-container .swal2-styled.swal2-cancel:hover {
    border-color: var(--sw-brand) !important;
    color: var(--sw-brand) !important;
}
.swal2-container .swal2-styled:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px var(--sw-brand-soft) !important;
}
.swal2-container .swal2-styled:disabled {
    opacity: 0.55;
}
.swal2-container .tts-sw-danger .swal2-styled.swal2-confirm {
    border-color: var(--sw-bad) !important;
    background: var(--sw-bad) !important;
}
.swal2-container .tts-sw-danger .swal2-styled.swal2-confirm:focus-visible {
    box-shadow: 0 0 0 3px var(--sw-bad-soft) !important;
}
.swal2-container .tts-sw-go .swal2-styled.swal2-confirm {
    border-color: var(--sw-good) !important;
    background: var(--sw-good) !important;
}
/* app-dark-colors.css paints the confirm button and validation message from the template; these win. */
body.theme-dark .swal2-container .swal2-styled.swal2-confirm,
body.theme-dark .swal2-container .swal2-styled.swal2-confirm:hover {
    background-color: var(--sw-brand) !important;
}
body.theme-dark .swal2-container .tts-sw-danger .swal2-styled.swal2-confirm,
body.theme-dark .swal2-container .tts-sw-danger .swal2-styled.swal2-confirm:hover {
    background-color: var(--sw-bad) !important;
}
body.theme-dark .swal2-container .tts-sw-go .swal2-styled.swal2-confirm,
body.theme-dark .swal2-container .tts-sw-go .swal2-styled.swal2-confirm:hover {
    background-color: var(--sw-good) !important;
}
body.theme-dark .swal2-container .swal2-validation-message {
    background-color: var(--sw-warn-soft) !important;
    color: var(--sw-ink) !important;
}
.swal2-container .swal2-loader {
    border-color: var(--sw-brand) transparent var(--sw-brand) transparent;
}

/* Inputs */
.swal2-container .swal2-input,
.swal2-container .swal2-textarea,
.swal2-container .swal2-select,
.swal2-container .swal2-file {
    margin: 12px auto 4px;
    border: 1px solid var(--sw-line);
    border-radius: 8px;
    background: var(--sw-card);
    color: var(--sw-ink);
    font-size: 14px;
    box-shadow: none;
}
.swal2-container .swal2-input {
    height: 38px;
}
.swal2-container .swal2-input:focus,
.swal2-container .swal2-textarea:focus,
.swal2-container .swal2-select:focus {
    border-color: var(--sw-brand);
    box-shadow: 0 0 0 3px var(--sw-brand-soft);
    outline: 0;
}
.swal2-container .swal2-input::placeholder,
.swal2-container .swal2-textarea::placeholder {
    color: var(--sw-faint);
}
.swal2-container .swal2-input-label,
.swal2-container .swal2-checkbox,
.swal2-container .swal2-radio {
    background: transparent;
    color: var(--sw-ink);
    font-size: 13.5px;
}
.swal2-container .swal2-validation-message {
    margin: 10px 0 0;
    border-radius: 8px;
    background: var(--sw-warn-soft) !important;
    color: var(--sw-ink) !important;
    font-size: 13px;
}
.swal2-container .swal2-validation-message::before {
    background-color: var(--sw-warn);
}

/* Progress steps and timer */
.swal2-container .swal2-progress-steps .swal2-progress-step,
.swal2-container .swal2-progress-steps .swal2-progress-step-line {
    background: var(--sw-brand);
}
.swal2-container .swal2-timer-progress-bar {
    background: var(--sw-brand);
    opacity: 0.5;
}

/* Toasts */
.swal2-container .swal2-popup.swal2-toast {
    border: 1px solid var(--sw-line);
    border-radius: 10px;
    box-shadow: var(--sw-shadow);
}
.swal2-container .swal2-popup.swal2-toast .swal2-title {
    font-size: 13.5px;
    font-weight: 700;
}

/*
 * Choosing one from a list inside a dialog, instead of a native <select> (which ignores the theme): a label, an
 * optional search box, and rows of buttons with role="radio". Sponsor Connect's representative prompt uses it
 * (views/partials/sc-rep-prompt.ejs).
 */
.swal2-container .tts-sw-pick {
    text-align: left;
    margin-top: 14px;
}
.swal2-container .tts-sw-label {
    margin: 0 0 6px;
    color: var(--sw-faint);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.swal2-container .tts-sw-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
.swal2-container .tts-sw-chip {
    padding: 3px 10px;
    border: 1px solid var(--sw-line);
    border-radius: 999px;
    background: var(--sw-soft);
    color: var(--sw-ink);
    font-size: 12.5px;
    font-weight: 600;
}
.swal2-container .tts-sw-chip small {
    margin-left: 4px;
    color: var(--sw-muted);
    font-weight: 400;
}
.swal2-container .tts-sw-search {
    width: 100%;
    margin: 0 0 8px;
    padding: 7px 10px;
    border: 1px solid var(--sw-line);
    border-radius: 8px;
    background: var(--sw-card);
    color: var(--sw-ink);
    font-size: 13.5px;
    outline: none;
}
.swal2-container .tts-sw-search:focus {
    border-color: var(--sw-brand);
    box-shadow: 0 0 0 3px var(--sw-brand-soft);
}
.swal2-container .tts-sw-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 236px;
    overflow-y: auto;
    padding: 2px;
}
.swal2-container .tts-sw-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--sw-line);
    border-radius: 8px;
    background: var(--sw-card);
    color: var(--sw-ink);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.12s, background-color 0.12s;
}
.swal2-container .tts-sw-opt[hidden],
.swal2-container .tts-sw-none[hidden] {
    display: none;
}
.swal2-container .tts-sw-opt:hover {
    border-color: var(--sw-brand);
}
.swal2-container .tts-sw-opt:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--sw-brand-soft);
}
.swal2-container .tts-sw-opt[aria-checked="true"] {
    border-color: var(--sw-brand);
    background: var(--sw-brand-soft);
}
.swal2-container .tts-sw-av {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--sw-brand-soft);
    color: var(--sw-brand);
    font-size: 12px;
    font-weight: 700;
}
.swal2-container .tts-sw-opt[aria-checked="true"] .tts-sw-av {
    background: var(--sw-brand);
    color: var(--sw-card);
}
.swal2-container .tts-sw-who {
    flex: 1;
    min-width: 0;
}
.swal2-container .tts-sw-who b {
    display: block;
    color: var(--sw-ink);
    font-size: 13.5px;
}
.swal2-container .tts-sw-who span {
    display: block;
    overflow: hidden;
    color: var(--sw-muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.swal2-container .tts-sw-tick {
    color: var(--sw-brand);
    visibility: hidden;
}
.swal2-container .tts-sw-opt[aria-checked="true"] .tts-sw-tick {
    visibility: visible;
}
.swal2-container .tts-sw-none {
    padding: 12px 0;
    color: var(--sw-muted);
    font-size: 13px;
    text-align: center;
}

@media (max-width: 480px) {
    .swal2-container .swal2-popup:not(.swal2-toast) {
        width: calc(100vw - 32px);
        padding: 18px 16px 16px;
    }
    .swal2-container .swal2-actions {
        width: 100%;
        flex-direction: column-reverse;
    }
    .swal2-container .swal2-actions .swal2-styled {
        width: 100%;
    }
}
