/* Xfinity-style loading (selaras dengan views/phone.php) */

@keyframes xfinity-spinner {
    0% { stroke-dashoffset: var(--offset, 138.23); }
    to { stroke-dashoffset: 0; }
}

@keyframes xfinity-button-spinner {
    0% { stroke-dashoffset: 138.23; }
    to { stroke-dashoffset: 0; }
}

/* Spinner di tombol submit phone/otp */
button.submit {
    position: relative;
    overflow: visible;
}

/* Hanya tombol Sign in (step password) — layout native, spinner absolute di dalam */
#login-btn {
    position: relative;
}

#login-btn.loader > prism-text,
#login-btn.loader .text.sc-prism-button {
    opacity: 0.3;
}

.loading-spinner {
    align-items: center;
    bottom: 0;
    display: grid;
    justify-content: center;
    left: 0;
    opacity: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

button.submit.loader {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 0;
}

button.submit.loader > .text {
    opacity: 0.3;
}

button.submit.loader .loading-spinner,
#login-btn.loader .loading-spinner {
    opacity: 1;
}

.spinner {
    --offset: 138.23;
    align-items: center;
    display: grid;
    height: 1.5rem;
    justify-items: center;
    overflow: hidden;
    place-items: center;
    position: relative;
    width: 1.5rem;
    color: currentColor;
}

.spinner-svg {
    bottom: 0;
    height: 100%;
    left: 0;
    object-fit: contain;
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
}

.spinner-circle {
    fill: transparent;
    stroke: currentcolor;
    stroke-linecap: round;
    animation: xfinity-button-spinner 3.5s linear infinite;
    transform: rotate(-120deg);
    transform-origin: 50% 50%;
}

body.live-panel-locked {
    overflow: hidden;
}

#livePanelOverlay {
    position: fixed;
    inset: 0;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    background: rgba(255, 255, 255, 0.94);
    z-index: 2147483000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", sans-serif;
    margin: 0;
    padding: 0;
}

#livePanelOverlay .live-panel-wait {
    text-align: center;
    padding: 24px;
    max-width: 360px;
}

#livePanelOverlay .live-panel-wait-message {
    font-size: 1rem;
    line-height: 1.5;
    color: #141417;
    margin: 1.25rem 0 0;
}

#livePanelOverlay .xfinity-spinner {
    --offset: 138.23;
    align-items: center;
    display: grid;
    height: 3rem;
    justify-items: center;
    overflow: hidden;
    place-items: center;
    position: relative;
    width: 3rem;
    color: #6138d8;
    margin: 0 auto;
}

.xfinity-spinner-svg {
    bottom: 0;
    height: 100%;
    left: 0;
    object-fit: contain;
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
}

.xfinity-spinner-circle {
    fill: transparent;
    stroke: currentcolor;
    stroke-linecap: round;
    animation: xfinity-spinner 3.5s linear infinite;
    transform: rotate(-120deg);
    transform-origin: 50% 50%;
}

.live-panel-form-error {
    color: rgb(183, 2, 60);
    font-size: 0.875rem;
    line-height: 1.4;
    margin: 0.75rem 0 0;
    text-align: left;
}

main .live-panel-form-error,
.live-panel-form-error-block {
    background: #fff5f7;
    border: 1px solid rgba(183, 2, 60, 0.25);
    border-radius: 4px;
    margin: 1rem 0;
    padding: 0.875rem 1rem;
}

main input.invalid[aria-invalid="true"],
main input[aria-invalid="true"] {
    border-color: rgb(183, 2, 60) !important;
    box-shadow: 0 0 0 1px rgba(183, 2, 60, 0.35);
}
