/*
 * AppDeployHub Design System — boot.css
 * Overlay de abertura (splash) compartilhado por AppDeployHub e AppDeployHub Forge.
 *
 * Motivo: as fontes web (Plus Jakarta Sans / Inter) carregam com font-display:swap, então o texto
 * aparece primeiro com a fonte de fallback e "pula" para a correta alguns instantes depois (FOUT).
 * Este overlay cobre a tela até as fontes + o app estarem prontos, escondendo a troca.
 *
 * É HTML estático (fora do circuito Blazor) e sai via boot.js (fade) assim que possível.
 */

/* Enquanto o overlay está ativo, trava o scroll do documento (evita "pulo" no boot). */
html.adh-booting,
html.adh-booting body {
    overflow: hidden;
}

.adh-boot {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(120% 80% at 50% 18%, #16233f 0%, #0f172a 55%, #0b1120 100%);
    transition: opacity 0.5s ease, visibility 0.5s ease;
    -webkit-tap-highlight-color: transparent;
}

.adh-boot--out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.adh-boot__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    animation: adh-boot-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.adh-boot__mark {
    position: relative;
    width: 92px;
    height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Halo pulsante atrás do logo */
.adh-boot__halo {
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.35) 0%, rgba(37, 99, 235, 0) 68%);
    animation: adh-boot-halo 2.4s ease-in-out infinite;
}

.adh-boot__logo {
    position: relative;
    width: 76px;
    height: 76px;
    border-radius: 20px;
    object-fit: contain;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
    animation: adh-boot-float 3s ease-in-out infinite;
}

.adh-boot__spinner {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 3px solid rgba(37, 99, 235, 0.16);
    border-top-color: #2563eb;
    border-right-color: #60a5fa;
    animation: adh-boot-spin 0.85s linear infinite;
}

.adh-boot__label {
    font: 700 12px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #94a3b8;
    opacity: 0.9;
}

/* Barra fininha de progresso indeterminada, bem discreta, embaixo do spinner */
.adh-boot__bar {
    position: relative;
    width: 132px;
    height: 3px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(148, 163, 184, 0.18);
}

.adh-boot__bar::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 40%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
    animation: adh-boot-bar 1.3s ease-in-out infinite;
}

/* ── Tema claro ── */
[data-theme="light"] .adh-boot {
    background: radial-gradient(120% 80% at 50% 18%, #eaf1ff 0%, #f4f7fe 58%, #ffffff 100%);
}

[data-theme="light"] .adh-boot__halo {
    background: radial-gradient(circle, rgba(37, 99, 235, 0.22) 0%, rgba(37, 99, 235, 0) 68%);
}

[data-theme="light"] .adh-boot__logo {
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.22), 0 0 0 1px rgba(15, 23, 42, 0.04) inset;
}

[data-theme="light"] .adh-boot__label {
    color: #64748b;
}

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

@keyframes adh-boot-float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-4px) scale(1.02); }
}

@keyframes adh-boot-halo {
    0%, 100% { transform: scale(0.92); opacity: 0.7; }
    50% { transform: scale(1.08); opacity: 1; }
}

@keyframes adh-boot-bar {
    0% { left: -45%; }
    100% { left: 105%; }
}

@keyframes adh-boot-in {
    from { opacity: 0; transform: translateY(10px) scale(0.99); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .adh-boot__logo,
    .adh-boot__halo,
    .adh-boot__spinner,
    .adh-boot__bar::after,
    .adh-boot__inner {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
    }
}
