/* Custom Utility - Alert Manager: this module's own designs on top of SweetAlert2's themes. */

.cu-swal-container { z-index: 100000 !important; }
.cu-swal { font-family: inherit; }
.cu-swal .swal2-html-container { font-size: 1.07em; line-height: 1.55; }
.cu-swal .swal2-html-container p:last-child { margin-bottom: 0; }
/* confirm() / alert() text: line breaks kept; a long list scrolls inside the popup */
.cu-swal .swal2-html-container.cu-swal-plain { white-space: pre-line; overflow-wrap: anywhere; max-height: min(55vh, 440px); overflow-y: auto; }
.cu-swal .swal2-html-container.cu-swal-plain-lines { text-align: left; }
.cu-swal.cu-swal-toast .swal2-html-container { font-size: 14px; margin: .35em .9em .35em .6em; text-align: left; }
.cu-swal-step { color: #6b7280; font-size: 12.5px; letter-spacing: .04em; }
.cu-idle-left { font-variant-numeric: tabular-nums; }

/* ---- Glass: frosted panel over a blurred page ---- */
.cu-swal-glass {
    --swal2-background: rgba(255, 255, 255, .72);
    background: rgba(255, 255, 255, .72) !important;
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 20px !important;
    box-shadow: 0 24px 60px -12px rgba(15, 23, 42, .35);
}
.swal2-container:has(.cu-swal-glass).swal2-backdrop-show { background: rgba(15, 23, 42, .28); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.cu-swal-glass .swal2-styled { border-radius: 999px !important; padding: .6em 1.6em; }
/* the success icon's animation masks are painted in the popup colour: invisible on see-through glass */
.cu-swal-glass .swal2-success-circular-line-left,
.cu-swal-glass .swal2-success-circular-line-right,
.cu-swal-glass .swal2-success-fix { background: transparent !important; }

/* ---- Gradient: coloured band on top, by type ---- */
.cu-swal-gradient {
    --cu-g1: #2563eb; --cu-g2: #7c3aed;
    border-radius: 16px !important;
    overflow: hidden;
    padding-top: 0 !important;
    box-shadow: 0 20px 50px -15px rgba(15, 23, 42, .4);
}
.cu-swal-gradient::before {
    content: ""; display: block; height: 8px; margin: 0 0 1.25em; grid-column: 1 / -1; position: relative; z-index: 3;
    background: linear-gradient(90deg, var(--cu-g1), var(--cu-g2));
}
.cu-swal-gradient.cu-swal-toast::before { height: 100%; width: 6px; margin: 0; position: absolute; left: 0; top: 0; }
.cu-swal-gradient.cu-swal-toast { position: relative; padding-left: 1.1em !important; padding-top: .625em !important; }
.cu-swal-gradient.cu-swal-t-success { --cu-g1: #16a34a; --cu-g2: #0d9488; }
.cu-swal-gradient.cu-swal-t-error   { --cu-g1: #dc2626; --cu-g2: #db2777; }
.cu-swal-gradient.cu-swal-t-warning { --cu-g1: #f59e0b; --cu-g2: #ea580c; }
.cu-swal-gradient.cu-swal-t-info    { --cu-g1: #0891b2; --cu-g2: #2563eb; }
.cu-swal-gradient .swal2-styled { border-radius: 10px !important; }

/* ---- Soft: tinted background, by type ---- */
.cu-swal-soft { border-radius: 18px !important; border: 1px solid transparent; }
.cu-swal-soft.cu-swal-t-success { --swal2-background: #f0fdf4; background: #f0fdf4 !important; border-color: #bbf7d0; }
.cu-swal-soft.cu-swal-t-error   { --swal2-background: #fef2f2; background: #fef2f2 !important; border-color: #fecaca; }
.cu-swal-soft.cu-swal-t-warning { --swal2-background: #fffbeb; background: #fffbeb !important; border-color: #fde68a; }
.cu-swal-soft.cu-swal-t-info,
.cu-swal-soft.cu-swal-t-question { --swal2-background: #eff6ff; background: #eff6ff !important; border-color: #bfdbfe; }
.cu-swal-soft .swal2-title { color: #111827; }
.cu-swal-soft .swal2-styled { border-radius: 999px !important; box-shadow: none !important; }

/* Perfex's Bootstrap 3 sets a font-size on buttons that is too small inside SweetAlert. */
.cu-swal .swal2-actions .swal2-styled { font-size: 1em; }


/* ---- "Cards" toasts (toastStyle = cards): titled pastel cards that stack ---- */
.cu-tc-stack { position: fixed; z-index: 100001; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; max-width: calc(100vw - 24px); pointer-events: none; }
.cu-tc-pos-top-start, .cu-tc-pos-bottom-start { align-items: flex-start; }
.cu-tc-pos-top, .cu-tc-pos-bottom { align-items: center; }
.cu-tc-pos-center { top: 50%; left: 50%; transform: translate(-50%, -50%); align-items: center; }
.cu-tc-pos-top-end { top: 16px; right: 16px; }
.cu-tc-pos-top-start { top: 16px; left: 16px; }
.cu-tc-pos-top { top: 16px; left: 50%; transform: translateX(-50%); }
.cu-tc-pos-bottom-end { bottom: 16px; right: 16px; }
.cu-tc-pos-bottom-start { bottom: 16px; left: 16px; }
.cu-tc-pos-bottom { bottom: 16px; left: 50%; transform: translateX(-50%); }

.cu-tc {
    --cu-tc-bg: #fff; --cu-tc-line: #e5e7eb; --cu-tc-ic: #475569; --cu-tc-title: #111827;
    position: relative; overflow: hidden; pointer-events: auto;
    display: flex; align-items: flex-start; gap: .85em;
    width: var(--cu-al-toast-w, 360px); max-width: 100%; box-sizing: border-box;
    font-size: var(--cu-al-fs, 14px);
    padding: 1em 2.85em 1em 1em; border-radius: 12px;
    background: var(--cu-tc-bg); border: 1px solid var(--cu-tc-line);
    box-shadow: 0 10px 25px -8px rgba(15, 23, 42, .18), 0 2px 6px rgba(15, 23, 42, .06);
    font-family: inherit; color: #374151; text-align: left;
}
.cu-tc-success { --cu-tc-bg: #e8f8ee; --cu-tc-line: #b7e8c8; --cu-tc-ic: #22a35a; --cu-tc-title: #14532d; }
.cu-tc-error   { --cu-tc-bg: #fdecec; --cu-tc-line: #f6c2c2; --cu-tc-ic: #e5484d; --cu-tc-title: #7f1d1d; }
.cu-tc-info,
.cu-tc-loading { --cu-tc-bg: #e9f1fe; --cu-tc-line: #bcd3fb; --cu-tc-ic: #3b82f6; --cu-tc-title: #1e3a8a; }
.cu-tc-warning { --cu-tc-bg: #fff7e0; --cu-tc-line: #f8de9a; --cu-tc-ic: #f5a524; --cu-tc-title: #78350f; }
.cu-tc-notice  { --cu-tc-bg: #ffffff; --cu-tc-line: #e5e7eb; --cu-tc-ic: #64748b; --cu-tc-title: #111827; }

.cu-tc-ic { flex: 0 0 2em; width: 2em; height: 2em; border-radius: 50%; background: var(--cu-tc-ic); display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.cu-tc-ic svg { width: 1.3em; height: 1.3em; fill: #fff; }
.cu-tc-notice .cu-tc-ic { background: #f1f5f9; }
.cu-tc-notice .cu-tc-ic svg { fill: #475569; }
.cu-tc-loading .cu-tc-ic { background: transparent; }
.cu-tc-spin { width: 1.7em; height: 1.7em; box-sizing: border-box; border-radius: 50%; border: 3px solid rgba(59, 130, 246, .25); border-top-color: var(--cu-tc-ic); animation: cu-tc-spin .8s linear infinite; }

.cu-tc-body { flex: 1; min-width: 0; }
.cu-tc-title { font-weight: 700; font-size: 1.07em; line-height: 1.3; color: var(--cu-tc-title); margin-bottom: 2px; }
.cu-tc-msg { font-size: .96em; line-height: 1.45; color: #4b5563; word-wrap: break-word; }
.cu-tc-msg:empty { display: none; }
.cu-tc-msg p:last-child { margin-bottom: 0; }

.cu-tc-x { position: absolute; top: .45em; right: .45em; width: 1.25em; height: 1.25em; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #6b7280; font-size: 1.4em; line-height: 1; cursor: pointer; opacity: .75; }
.cu-tc-x:hover, .cu-tc-x:focus-visible { opacity: 1; background: rgba(15, 23, 42, .06); outline: none; }

.cu-tc-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--cu-tc-ic); opacity: .55; transform-origin: left; transform: scaleX(0); }
.cu-tc-bar.is-on { animation: cu-tc-shrink linear forwards; transform: scaleX(1); }
.cu-tc.is-paused .cu-tc-bar { animation-play-state: paused; }

.cu-tc-anim { animation: cu-tc-in .22s ease-out; }
.cu-tc-anim.is-leaving { animation: cu-tc-out .2s ease-in forwards; }

@keyframes cu-tc-spin { to { transform: rotate(360deg); } }
@keyframes cu-tc-shrink { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes cu-tc-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes cu-tc-out { to { opacity: 0; transform: translateX(16px); } }
@media (prefers-reduced-motion: reduce) {
    .cu-tc-anim, .cu-tc-anim.is-leaving { animation: none; }
    .cu-tc-spin { animation-duration: 2s; }
}

/* ---- Size and colour settings (Alert Manager > Size and colours), set per popup by cu_alerts.js ---- */
.cu-swal.cu-al-sized { font-size: var(--cu-al-fs, 16px); --swal2-icon-zoom: var(--cu-al-zoom, 1); }
.cu-swal.cu-al-sized:not(.swal2-toast) .swal2-title { font-size: 1.45em; }
.cu-swal.cu-al-sized.swal2-toast .swal2-title { font-size: 1.05em; }
.cu-swal.cu-al-colored { --swal2-background: var(--cu-al-bg); --swal2-color: var(--cu-al-fg); background: var(--cu-al-bg) !important; color: var(--cu-al-fg) !important; }
.cu-swal.cu-al-colored .swal2-title { color: var(--cu-al-title) !important; }
.cu-swal.cu-al-colored .swal2-html-container { color: var(--cu-al-fg) !important; }
.cu-tc.cu-al-colored { --cu-tc-bg: var(--cu-al-bg); --cu-tc-title: var(--cu-al-title); --cu-tc-line: rgba(15, 23, 42, .1); }
.cu-tc.cu-al-colored .cu-tc-msg { color: var(--cu-al-fg); }
.cu-tc.cu-al-colored .cu-tc-x { color: var(--cu-al-fg); }

/* @mentions in a login alert's message */
.cu-mention { display: inline-block; padding: 0 7px; border-radius: 999px; background: #e0e7ff; color: #3730a3; font-weight: 600; line-height: 1.6; white-space: nowrap; }

/* Popup details > shape (class cu-al-shaped is added only while "Customise the popup shape" is on; modal popups, never toasts). */
.cu-swal.cu-al-shaped:not(.swal2-toast) { border-radius: var(--cu-al-radius, 14px) !important; box-shadow: var(--cu-al-shadow, none) !important; }
.cu-swal.cu-al-shaped:not(.swal2-toast) .swal2-icon { --swal2-icon-zoom: 1; zoom: 1; font-size: calc(var(--cu-al-icon, 84px) / 5.5); }
.cu-swal.cu-al-shaped:not(.swal2-toast) .swal2-actions .swal2-styled { box-sizing: border-box; height: var(--cu-al-btn-h, 46px); border-radius: var(--cu-al-btn-r, 10px) !important; }
.cu-swal.cu-al-shaped.cu-al-align-right:not(.swal2-toast) .swal2-actions { justify-content: flex-end; }
.cu-swal.cu-al-shaped.cu-al-align-stretch:not(.swal2-toast) .swal2-actions { width: 100%; }
.cu-swal.cu-al-shaped.cu-al-align-stretch:not(.swal2-toast) .swal2-actions .swal2-styled { flex: 1 1 0; }

.cu-swal.cu-al-shaped:not(.swal2-toast) .swal2-title { font-size: var(--cu-al-title-size, 22px); }
@keyframes cu-al-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cu-al-fade-out { from { opacity: 1; } to { opacity: 0; } }
.cu-swal.cu-al-fade-in { animation: cu-al-fade-in .18s ease-out; }
.cu-swal.cu-al-fade-out { animation: cu-al-fade-out .15s ease-in forwards; }

/* Tooltips (assets/js/cu_tooltips.js): one styled tip for whatever the pointer rests on */
.cu-tip { position: absolute; z-index: 100001; top: 0; left: 0; max-width: min(320px, calc(100vw - 12px)); padding: 6px 10px; border-radius: 7px;
    background: #111827; color: #f9fafb; font: 500 12.5px/1.4 inherit; font-family: inherit; letter-spacing: .01em; text-align: left;
    white-space: normal; overflow-wrap: anywhere; pointer-events: none; box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .45);
    opacity: 0; transform: translateY(3px); transition: opacity .12s ease, transform .12s ease; }
.cu-tip[hidden] { display: none; }
.cu-tip.is-on { opacity: 1; transform: none; }
.cu-tip.is-below { transform: translateY(-3px); }
.cu-tip.is-below.is-on { transform: none; }
.cu-tip-arrow { position: absolute; top: 100%; width: 0; height: 0; margin-left: -5px; border: 5px solid transparent; border-top-color: #111827; }
.cu-tip.is-below .cu-tip-arrow { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: #111827; }
@media (prefers-reduced-motion: reduce) { .cu-tip { transition: none; transform: none; } }
/* Perfex's own Bootstrap tooltips: the same look */
.cu-tips-on .tooltip { font-family: inherit; }
.cu-tips-on .tooltip.in { opacity: 1; }
.cu-tips-on .tooltip-inner { max-width: 320px; padding: 6px 10px; border-radius: 7px; background: #111827; color: #f9fafb; font-size: 12.5px; font-weight: 500; line-height: 1.4; box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .45); }
.cu-tips-on .tooltip.top .tooltip-arrow { border-top-color: #111827; }
.cu-tips-on .tooltip.bottom .tooltip-arrow { border-bottom-color: #111827; }
.cu-tips-on .tooltip.left .tooltip-arrow { border-left-color: #111827; }
.cu-tips-on .tooltip.right .tooltip-arrow { border-right-color: #111827; }
