/* =====================================================================
   Tela de carregamento (boot do app e transição pós-login)
   Usada pelo index.html (antes do Blazor) e pelo componente TelaCarregamento,
   com o mesmo visual para não haver "salto" entre as duas.
   ===================================================================== */

.g-splash {
    position: fixed;
    inset: 0;
    z-index: 2400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    overflow: hidden;
    background: var(--g-bg, #0a0a0a);
    color: var(--g-text, #f5f5f5);
    font-family: var(--g-font, 'Inter', system-ui, sans-serif);
    opacity: 1;
    transition: opacity .38s ease, visibility .38s ease;
}

.g-splash.saindo {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Brilho de fundo animado */
.g-splash::before,
.g-splash::after {
    content: "";
    position: absolute;
    width: 62vmax;
    height: 62vmax;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .5;
    pointer-events: none;
    animation: gSplashFloat 14s ease-in-out infinite alternate;
}

.g-splash::before {
    top: -30vmax;
    left: -22vmax;
    background: radial-gradient(circle, rgba(var(--g-accent-rgb, 249, 115, 22), .32) 0%, transparent 65%);
}

.g-splash::after {
    bottom: -34vmax;
    right: -24vmax;
    background: radial-gradient(circle, rgba(var(--g-accent-rgb, 249, 115, 22), .18) 0%, transparent 65%);
    animation-delay: -7s;
}

:root[data-theme="light"] .g-splash::before,
:root[data-theme="light"] .g-splash::after { opacity: .35; }

.g-splash-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(var(--g-fg-rgb, 255, 255, 255), .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--g-fg-rgb, 255, 255, 255), .035) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 10%, transparent 70%);
    mask-image: radial-gradient(ellipse at center, #000 10%, transparent 70%);
    pointer-events: none;
}

.g-splash-box {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Logo com anel orbital */
.g-splash-logo {
    position: relative;
    width: 112px;
    height: 112px;
    display: grid;
    place-items: center;
    margin-bottom: 28px;
    animation: gSplashIn .5s cubic-bezier(.2, .8, .2, 1) both;
}

.g-splash-logo svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    animation: gSplashSpin 1.6s linear infinite;
}

.g-splash-logo .trilho {
    fill: none;
    stroke: rgba(var(--g-fg-rgb, 255, 255, 255), .08);
    stroke-width: 3;
}

.g-splash-logo .arco {
    fill: none;
    stroke: var(--g-accent, #f97316);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 80 220;
    filter: drop-shadow(0 0 6px rgba(var(--g-accent-rgb, 249, 115, 22), .7));
}

.g-splash-logo-img {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--g-surface, #141414);
    border: 1px solid var(--g-border, #262626);
    box-shadow: 0 10px 40px rgba(var(--g-accent-rgb, 249, 115, 22), .22);
    animation: gSplashPulse 2.2s ease-in-out infinite;
}

.g-splash-logo-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.g-splash-logo-img .inicial {
    font-size: 30px;
    font-weight: 800;
    color: var(--g-accent, #f97316);
    letter-spacing: -1px;
}

.g-splash-eyebrow {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--g-accent, #f97316);
    margin-bottom: 8px;
    animation: gSplashIn .5s ease .08s both;
}

.g-splash-title {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.2;
    margin: 0 0 6px;
    color: var(--g-text, #f5f5f5);
    animation: gSplashIn .5s ease .14s both;
}

.g-splash-sub {
    font-size: .92rem;
    color: var(--g-text-2, #a3a3a3);
    margin: 0 0 26px;
    min-height: 1.3em;
    animation: gSplashIn .5s ease .2s both;
}

/* Barra de progresso */
.g-splash-bar {
    width: 100%;
    max-width: 280px;
    height: 4px;
    border-radius: 999px;
    background: rgba(var(--g-fg-rgb, 255, 255, 255), .08);
    overflow: hidden;
    margin-bottom: 22px;
    animation: gSplashIn .5s ease .26s both;
}

.g-splash-bar > span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--g-accent, #f97316), var(--g-accent-2, #fb923c));
    box-shadow: 0 0 12px rgba(var(--g-accent-rgb, 249, 115, 22), .6);
    transition: width .45s cubic-bezier(.2, .8, .2, 1);
}

/* Barra sem percentual conhecido */
.g-splash-bar.indeterminada > span {
    width: 38%;
    animation: gSplashIndet 1.25s ease-in-out infinite;
}

/* Etapas */
.g-splash-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    animation: gSplashIn .5s ease .32s both;
}

.g-splash-steps li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .86rem;
    color: var(--g-text-3, #737373);
    transition: color .25s ease;
}

.g-splash-steps .marca {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(var(--g-fg-rgb, 255, 255, 255), .14);
    display: grid;
    place-items: center;
    transition: all .25s ease;
}

.g-splash-steps li.ativa { color: var(--g-text, #f5f5f5); }

.g-splash-steps li.ativa .marca {
    border-color: var(--g-accent, #f97316);
    border-right-color: transparent;
    animation: gSplashSpin .8s linear infinite;
}

.g-splash-steps li.feita { color: var(--g-text-2, #a3a3a3); }

.g-splash-steps li.feita .marca {
    background: var(--g-accent, #f97316);
    border-color: var(--g-accent, #f97316);
}

.g-splash-steps li.feita .marca::after {
    content: "";
    width: 5px;
    height: 9px;
    border: solid var(--g-on-accent, #0a0a0a);
    border-width: 0 2px 2px 0;
    transform: translateY(-1px) rotate(45deg);
}

/* Dica rotativa */
.g-splash-tip {
    margin-top: 34px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(var(--g-fg-rgb, 255, 255, 255), .035);
    border: 1px solid var(--g-border, #262626);
    font-size: .8rem;
    line-height: 1.45;
    color: var(--g-text-2, #a3a3a3);
    max-width: 340px;
    animation: gSplashIn .5s ease .5s both;
}

.g-splash-tip b {
    color: var(--g-accent, #f97316);
    font-weight: 700;
    margin-right: 4px;
}

.g-splash-tip .texto { display: inline; animation: gSplashFade .45s ease both; }

/* Esconde o SVG que o Blazor usa para calcular o percentual */
.g-splash .loading-progress {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

@keyframes gSplashSpin { to { transform: rotate(360deg); } }

@keyframes gSplashIn {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: none; }
}

@keyframes gSplashFade {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

@keyframes gSplashPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.04); }
}

@keyframes gSplashFloat {
    from { transform: translate(0, 0); }
    to { transform: translate(6vmax, 4vmax); }
}

@keyframes gSplashIndet {
    0% { transform: translateX(-110%); }
    100% { transform: translateX(290%); }
}

@media (prefers-reduced-motion: reduce) {
    .g-splash *,
    .g-splash::before,
    .g-splash::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
