/* ===================================================================
   Domain-switch loading overlay
   Shown while the backend authenticates into the target domain.
   =================================================================== */

:root {
    --tb-blue: #0072BC;
    --tb-blue-light: #C9E2F8;
    --tb-orange: #F48239;
    --tb-dark: #021A22;
    --tb-gray-200: #e9ecef;
    --tb-gray-400: #adb5bd;
    --tb-gray-500: #6c757d;
}

/* ---- backdrop ---------------------------------------------------- */
#domainSwitchOverlay {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    background: rgba(2, 26, 34, 0.35);
    backdrop-filter: blur(2px);
}

#domainSwitchOverlay.is-active {
    display: flex;
}

body.domain-switch-active {
    overflow: hidden;
}

/* ---- card -------------------------------------------------------- */
#domainSwitchOverlay .domain-switch-overlay__panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 480px;
    max-width: 90vw;
    padding: 56px 48px 40px;
    border-radius: 16px;
    background: #fff;
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.14),
        0 4px 12px rgba(0, 0, 0, 0.06);
    text-align: center;
}

/* ---- spinner ----------------------------------------------------- */
.domain-switch-overlay__icon {
    line-height: 0;
}

.domain-switch-overlay__icon svg {
    width: 80px;
    height: 80px;
}

.domain-switch-overlay__icon .ds-hdr {
    fill: var(--tb-blue);
    opacity: 0.06;
}

.domain-switch-overlay__icon .ds-gl {
    stroke: rgba(0, 0, 0, 0.05);
    stroke-width: 0.3;
}

.domain-switch-overlay__icon .ds-tt {
    stroke: rgba(0, 0, 0, 0.08);
    stroke-width: 0.4;
}

.domain-switch-overlay__icon .ds-b1 {
    fill: var(--tb-orange);
    animation: ds-block-fill 2.4s ease-in-out infinite;
}

.domain-switch-overlay__icon .ds-b2 {
    fill: var(--tb-blue);
    animation: ds-block-fill 2.4s ease-in-out infinite 0.3s;
}

.domain-switch-overlay__icon .ds-b3 {
    fill: var(--tb-blue-light);
    stroke: var(--tb-blue);
    stroke-width: 0.4;
    animation: ds-block-fill 2.4s ease-in-out infinite 0.6s;
}

.domain-switch-overlay__icon .ds-b4 {
    fill: var(--tb-orange);
    opacity: 0.5;
    animation: ds-block-fill 2.4s ease-in-out infinite 0.9s;
}

.domain-switch-overlay__icon .ds-nl {
    stroke: var(--tb-orange);
    stroke-width: 0.6;
    animation: ds-now-slide 2.4s ease-in-out infinite;
}

/* ---- heading ----------------------------------------------------- */
.domain-switch-overlay__heading {
    margin: 0;
    margin-bottom: 12px;
    padding: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--tb-dark);
    line-height: 1.4;
}

/* ---- body text --------------------------------------------------- */
.domain-switch-overlay__text {
    margin: 0;
    margin-bottom: 48px;
    padding: 0;
    font-size: 15px;
    color: var(--tb-gray-500);
    line-height: 1.65;
    max-width: 380px;
}

/* ---- indeterminate progress bar ---------------------------------- */
.domain-switch-overlay__progress {
    width: 100%;
    height: 5px;
    border-radius: 3px;
    background: var(--tb-gray-200);
    overflow: hidden;
    margin-top: 6px;
}

.domain-switch-overlay__progress-bar {
    height: 100%;
    width: 30%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--tb-blue), var(--tb-orange));
    animation: ds-indeterminate-bar 1.8s ease-in-out infinite;
}

/* ---- keyframes --------------------------------------------------- */
@keyframes ds-block-fill {
    0%, 8% {
        opacity: 0;
        transform: scaleY(0);
        transform-origin: top;
    }
    16%, 75% {
        opacity: 1;
        transform: scaleY(1);
    }
    88%, 100% {
        opacity: 0;
        transform: scaleY(1);
    }
}

@keyframes ds-now-slide {
    0%   { transform: translateY(-6px); opacity: 0; }
    20%  { opacity: 1; }
    80%  { opacity: 1; }
    100% { transform: translateY(6px); opacity: 0; }
}

@keyframes ds-indeterminate-bar {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(433%); }
}
