.tfp-preloader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(245, 247, 251, 0.88);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.24s ease, visibility 0.24s ease;
}

.tfp-preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.tfp-preloader__content {
    width: min(100%, 13.75rem);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tfp-preloader__logo {
    width: 6.75rem;
    height: auto;
    object-fit: contain;
    flex: 0 0 auto;
}

/* Logo conmutable igual que el sistema (app.css): light => Logotipo.png, dark => Logotipo-oscuro.png */
.logo-dark {
    display: none;
}

html[data-bs-theme='dark'] .logo-light {
    display: none;
}

html[data-bs-theme='dark'] .logo-dark {
    display: inline-block;
}

.tfp-preloader__name {
    width: 100%;
    margin: 0;
    padding-top: 0.875rem;
    color: #eaf2f5;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.4;
    text-align: center;
}

.tfp-preloader__progress {
    width: 100%;
    height: 0.125rem;
    margin-top: 1.75rem;
    overflow: hidden;
    border-radius: 999px;
    background: #16212f;
}

.tfp-preloader__progress-fill {
    display: block;
    width: 100%;
    height: 100%;
    transform-origin: left center;
    transform: scaleX(0);
    border-radius: inherit;
    background: linear-gradient(90deg, var(--color-brand) 0%, rgba(255, 255, 255, 0.34) 48%, var(--color-brand) 100%);
    background-size: 220% 100%;
    animation: tfpPreloaderBarMotion 1.6s linear infinite;
    will-change: transform, background-position;
}

.tfp-preloader__meta {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.625rem;
}

.tfp-preloader__status {
    min-width: 0;
    color: rgba(226, 232, 240, 0.62);
    font-size: 0.75rem;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tfp-preloader__folio {
    flex: 0 0 auto;
    color: rgba(148, 163, 184, 0.52);
    font-size: 0.6875rem;
    line-height: 1.35;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;
    letter-spacing: 0.08em;
}

body.tfp-preloader-lock {
    overflow: hidden;
}

html[data-bs-theme='dark'] .tfp-preloader,
body.theme-dark .tfp-preloader {
    background: rgba(5, 11, 24, 0.82);
}

@keyframes tfpPreloaderBarMotion {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -20% 0;
    }
}

html[data-bs-theme='light'] .tfp-preloader__name,
body.theme-light .tfp-preloader__name {
    color: #1f2937;
}

html[data-bs-theme='light'] .tfp-preloader__status,
body.theme-light .tfp-preloader__status {
    color: rgba(71, 85, 105, 0.78);
}

html[data-bs-theme='light'] .tfp-preloader__folio,
body.theme-light .tfp-preloader__folio {
    color: rgba(100, 116, 139, 0.74);
}

@media (max-width: 575.98px) {
    .tfp-preloader {
        padding: 1.25rem;
    }
}
