/*
 * Dashboard-wide UI bits loaded on every My Account page (src/Core/Assets.php):
 * the loading overlay + spinner (replaces pexinsure's loading2.svg) and the
 * upload spinner on validation cards.
 */

/* --- full-page loading overlay --- */
.preload-screen {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(17, 12, 38, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: pex-fade-in 0.15s ease-out;
}

.preload-screen .preload-box {
    position: static;
    transform: none;
    width: 100%;
    max-width: 340px;
    padding: 28px 24px 22px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(17, 12, 38, 0.25);
    text-align: center;
    color: #1f1a35;
    font-size: 15px;
}

.preload-screen .preload-box img {
    display: none; /* old image-based loader, if any page still adds one */
}

.preload-screen .preload-box p {
    margin: 14px 0 0;
    line-height: 1.45;
}

/* --- spinner (used by the overlay and upload cards) --- */
.pex-spinner {
    display: inline-block;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 4px solid #ece7fb;
    border-top-color: #5630bc;
    animation: pex-spin 0.8s linear infinite;
}

.pex-spinner--sm {
    width: 22px;
    height: 22px;
    border-width: 3px;
}

/* --- upload cards while a file is uploading --- */
.upload-card.pex-uploading .upload-status .fa {
    display: none;
}

.upload-card .pex-upload-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #5630bc;
}

/* --- inline form error (pexFormError) --- */
.pex-form-error {
    margin: 12px 0;
}

@keyframes pex-spin {
    to { transform: rotate(360deg); }
}

@keyframes pex-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .pex-spinner { animation-duration: 2s; }
    .preload-screen { animation: none; }
}
