/* Public site — bottom reconnect toast */

#components-reconnect-modal.site-reconnect {
    position: fixed;
    inset: auto auto 1.25rem 50%;
    transform: translateX(-50%) translateY(12px);
    width: max-content;
    max-width: calc(100vw - 1.5rem);
    margin: 0;
    padding: 0;
    border: none !important;
    outline: none !important;
    outline-offset: 0 !important;
    box-shadow: none !important;
    background: transparent;
    color: #0f172a;
    font-family: Payda, ui-sans-serif, system-ui, sans-serif;
    border-radius: 1.15rem;
    overflow: visible;
    opacity: 0;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.28s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

#components-reconnect-modal.site-reconnect:focus,
#components-reconnect-modal.site-reconnect:focus-visible,
#components-reconnect-modal.site-reconnect:modal {
    border: none !important;
    outline: none !important;
    outline-offset: 0 !important;
    box-shadow: none !important;
}

#components-reconnect-modal.site-reconnect[open] {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

#components-reconnect-modal.site-reconnect::backdrop {
    background: transparent;
    outline: none;
}

.site-reconnect .reconnect-shell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: max-content;
    max-width: calc(100vw - 1.5rem);
    padding: 0.85rem 1.05rem;
    border-radius: 1.15rem;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1);
    backdrop-filter: blur(12px);
}

.site-reconnect .reconnect-visual {
    flex: 0 0 auto;
    width: 1.35rem;
    height: 1.35rem;
    display: grid;
    place-items: center;
    background: transparent;
    border: 0;
}

.site-reconnect .reconnect-body {
    flex: 1 1 auto;
    min-width: 0;
}

.site-reconnect .reconnect-actions {
    flex: 0 0 auto;
    display: none;
    align-items: center;
    gap: 0.4rem;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-actions,
#components-reconnect-modal.components-reconnect-paused .reconnect-actions,
#components-reconnect-modal.components-reconnect-resume-failed .reconnect-actions {
    display: flex;
}

.site-reconnect .reconnect-msg {
    display: none;
    margin: 0;
    text-align: right;
}

.site-reconnect .reconnect-msg strong {
    display: block;
    font-size: 0.82rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.12rem;
    line-height: 1.35;
}

.site-reconnect .reconnect-msg .reconnect-sub {
    display: block;
    font-size: 0.72rem;
    line-height: 1.45;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
}

.site-reconnect .reconnect-msg .reconnect-sub #components-seconds-to-next-attempt {
    display: inline;
    font-weight: 700;
    color: #334155;
    white-space: nowrap;
}

.components-reconnect-first-attempt-visible,
.components-reconnect-repeated-attempt-visible,
.components-reconnect-failed-visible,
.components-pause-visible,
.components-resume-failed-visible,
.components-rejoining-animation,
.reconnect-glyph {
    display: none !important;
}

/* Blazor keeps .show when adding .retrying — first message must hide */
#components-reconnect-modal.components-reconnect-show:not(.components-reconnect-retrying) .components-reconnect-first-attempt-visible,
#components-reconnect-modal.components-reconnect-show:not(.components-reconnect-retrying) .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible,
#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation,
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible,
#components-reconnect-modal.components-reconnect-paused .components-pause-visible,
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible {
    display: block !important;
}

#components-reconnect-modal.components-reconnect-failed .reconnect-glyph-warn,
#components-reconnect-modal.components-reconnect-resume-failed .reconnect-glyph-warn,
#components-reconnect-modal.components-reconnect-paused .reconnect-glyph-pause {
    display: grid !important;
}

#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible.reconnect-btn,
#components-reconnect-modal.components-reconnect-paused .components-pause-visible.reconnect-btn,
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible.reconnect-btn,
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible.reconnect-btn-ghost,
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible.reconnect-btn-ghost {
    display: inline-flex !important;
}

.site-reconnect .reconnect-btn,
.site-reconnect .reconnect-btn-ghost {
    border: 0;
    cursor: pointer;
    border-radius: 999px;
    padding: 0.45rem 0.85rem;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    transition: transform 0.12s ease, background-color 0.15s ease;
}

.site-reconnect .reconnect-btn {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.22);
}

.site-reconnect .reconnect-btn:hover {
    background: #1d4ed8;
}

.site-reconnect .reconnect-btn-ghost {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}

.site-reconnect .reconnect-btn-ghost:hover {
    background: #e2e8f0;
}

.site-reconnect .reconnect-btn:active,
.site-reconnect .reconnect-btn-ghost:active {
    transform: scale(0.97);
}

.site-reconnect .reconnect-glyph {
    place-items: center;
    width: 1.2rem;
    height: 1.2rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    color: #fff;
    background: #2563eb;
}

.site-reconnect .reconnect-glyph-pause {
    background: #64748b;
}

.site-reconnect .components-rejoining-animation {
    position: relative;
    width: 1.15rem;
    height: 1.15rem;
}

.site-reconnect .components-rejoining-animation::before,
.site-reconnect .components-rejoining-animation::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 999px;
    border: 2px solid transparent;
    border-top-color: #3b82f6;
    border-right-color: rgba(59, 130, 246, 0.35);
    animation: site-reconnect-soft-spin 0.9s linear infinite;
}

.site-reconnect .components-rejoining-animation::after {
    inset: 0.2rem;
    border-top-color: #93c5fd;
    border-right-color: rgba(147, 197, 253, 0.25);
    animation-direction: reverse;
    animation-duration: 1.25s;
}

@keyframes site-reconnect-soft-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 640px) {
    .site-reconnect .reconnect-shell {
        flex-wrap: wrap;
        width: calc(100vw - 1.5rem);
        max-width: calc(100vw - 1.5rem);
    }

    .site-reconnect .reconnect-msg .reconnect-sub {
        white-space: normal;
    }

    .site-reconnect .reconnect-actions {
        width: 100%;
        justify-content: stretch;
    }

    .site-reconnect .reconnect-btn,
    .site-reconnect .reconnect-btn-ghost {
        flex: 1 1 auto;
        justify-content: center;
    }
}
