/* /Components/Layout/ReconnectModal.razor.rz.scp.css */
.components-offline-visible[b-3carqwpug7],
.components-reconnect-first-attempt-visible[b-3carqwpug7],
.components-reconnect-repeated-attempt-visible[b-3carqwpug7],
.components-reconnect-failed-visible[b-3carqwpug7],
.components-pause-visible[b-3carqwpug7],
.components-resume-failed-visible[b-3carqwpug7],
.components-rejoining-animation[b-3carqwpug7] {
    display: none;
}

/*
    The texts by state. The dialog itself is shown only while it is open
    (ReconnectModal.razor.js opens it after a grace period, with show(), not
    showModal()): the template's rules that displayed it for the retrying
    and failed states regardless of [open] are gone, or the grace period
    and the non-blocking bar would not hold.
*/
#components-reconnect-modal.components-reconnect-show .components-reconnect-first-attempt-visible[b-3carqwpug7],
#components-reconnect-modal.components-reconnect-show .components-rejoining-animation[b-3carqwpug7],
#components-reconnect-modal.components-reconnect-paused .components-pause-visible[b-3carqwpug7],
#components-reconnect-modal.components-reconnect-resume-failed .components-resume-failed-visible[b-3carqwpug7],
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-repeated-attempt-visible[b-3carqwpug7],
#components-reconnect-modal.components-reconnect-retrying .components-rejoining-animation[b-3carqwpug7],
#components-reconnect-modal.components-reconnect-failed .components-reconnect-failed-visible[b-3carqwpug7] {
    display: block;
}

/*
    A bar at the bottom of the window (owner, 17.11.2026: the centred popup
    over a scrim blocked the screen whenever the phone lost its connection).
    No backdrop: it is opened non-modally, so the page stays readable and
    scrollable underneath.
*/
#components-reconnect-modal[b-3carqwpug7] {
    position: fixed;
    inset: auto 0 calc(16px + env(safe-area-inset-bottom, 0px)) 0;
    z-index: 2000;
    box-sizing: border-box;
    width: min(30rem, calc(100vw - 32px));
    margin: 0 auto;
    padding: 12px 16px;
    background-color: var(--px-surface);
    color: var(--px-text);
    font-family: var(--px-font);
    font-size: var(--px-text-sm);
    line-height: var(--px-leading-body);
    border: 1px solid var(--px-border-card);
    border-radius: var(--px-radius-card);
    box-shadow: var(--px-shadow-raised);
}

/* Once retrying, its own line replaces the first one (both classes are set). */
#components-reconnect-modal.components-reconnect-retrying .components-reconnect-first-attempt-visible[b-3carqwpug7] {
    display: none;
}

/* show() focuses the dialog; the bar is a notice, not a control. */
#components-reconnect-modal:focus[b-3carqwpug7],
#components-reconnect-modal:focus-visible[b-3carqwpug7] {
    outline: none;
}

#components-reconnect-modal[open][b-3carqwpug7] {
    animation: components-reconnect-modal-slideUp-b-3carqwpug7 0.3s ease-out, components-reconnect-modal-fadeInOpacity-b-3carqwpug7 0.3s ease-out;
}

@keyframes components-reconnect-modal-slideUp-b-3carqwpug7 {
    0% {
        transform: translateY(30px) scale(0.95);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes components-reconnect-modal-fadeInOpacity-b-3carqwpug7 {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes components-reconnect-modal-fadeOutOpacity-b-3carqwpug7 {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

.components-reconnect-container[b-3carqwpug7] {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

#components-reconnect-modal p[b-3carqwpug7] {
    flex: 1 1 12rem;
    margin: 0;
}

#components-reconnect-modal button[b-3carqwpug7] {
    border: 0;
    background-color: var(--px-primary);
    color: var(--px-on-primary);
    font: inherit;
    font-weight: var(--px-weight-semibold);
    min-width: 96px;
    min-height: 40px;
    padding: 0 var(--px-space-6);
    border-radius: var(--px-radius-control);
    cursor: pointer;
}

    #components-reconnect-modal button:focus-visible[b-3carqwpug7] {
        outline: none;
        box-shadow: 0 0 0 3px var(--px-focus-ring);
    }

    #components-reconnect-modal button:hover[b-3carqwpug7] {
        background-color: var(--px-primary-hover);
    }

    #components-reconnect-modal button:active[b-3carqwpug7] {
        background-color: var(--px-primary-active);
    }

.components-rejoining-animation[b-3carqwpug7] {
    position: relative;
    flex: none;
    width: 24px;
    height: 24px;
}

    .components-rejoining-animation div[b-3carqwpug7] {
        position: absolute;
        border: 2px solid var(--px-primary);
        opacity: 1;
        border-radius: 50%;
        animation: components-rejoining-animation-b-3carqwpug7 1.5s cubic-bezier(0, 0.2, 0.8, 1) infinite;
    }

        .components-rejoining-animation div:nth-child(2)[b-3carqwpug7] {
            animation-delay: -0.5s;
        }

@keyframes components-rejoining-animation-b-3carqwpug7 {
    0% {
        top: 12px;
        left: 12px;
        width: 0;
        height: 0;
        opacity: 0;
    }

    4.9% {
        top: 12px;
        left: 12px;
        width: 0;
        height: 0;
        opacity: 0;
    }

    5% {
        top: 12px;
        left: 12px;
        width: 0;
        height: 0;
        opacity: 1;
    }

    100% {
        top: 0px;
        left: 0px;
        width: 24px;
        height: 24px;
        opacity: 0;
    }
}

/*
    Offline (the browser's own event): one line says so, the circuit's
    states and buttons step back - retrying is pointless without a network
    and starts by itself on "online". Written after the state rules, which
    have the same specificity.
*/
#components-reconnect-modal[data-offline] .components-offline-visible[b-3carqwpug7] {
    display: block;
}

#components-reconnect-modal[data-offline] .components-reconnect-first-attempt-visible[b-3carqwpug7],
#components-reconnect-modal[data-offline] .components-reconnect-repeated-attempt-visible[b-3carqwpug7],
#components-reconnect-modal[data-offline] .components-reconnect-failed-visible[b-3carqwpug7],
#components-reconnect-modal[data-offline] .components-rejoining-animation[b-3carqwpug7] {
    display: none;
}

/*
    Phone width (PhoneWidth, 759px; owner 17.11.2026): a banner across the
    top instead of the bar at the bottom. app.css pushes the page and the
    sticky header down by its height (--px-offline-h), so nothing is covered.
*/
@media (max-width: 759px) {
    #components-reconnect-modal[b-3carqwpug7] {
        inset: 0 0 auto 0;
        width: 100%;
        margin: 0;
        padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px;
        border-width: 0 0 1px;
        border-radius: 0;
        border-color: var(--px-warning-line);
        background-color: var(--px-warning-soft);
        box-shadow: none;
        font-size: var(--px-text-md);
    }

    #components-reconnect-modal[open][b-3carqwpug7] {
        animation: components-reconnect-modal-fadeInOpacity-b-3carqwpug7 0.2s ease-out;
    }
}
