/* Tela de login — cena animada em CSS puro.
 * O hub central é o ícone do logo; as órbitas representam as integrações
 * conectadas a ele e os pulsos, as chamadas saindo do gateway.
 * Cores tiradas do próprio logo (violeta #6D28D9 / #8B5CF6 / #A78BFA). */

.login {
    --login-hub: #6d28d9;
    --login-raio: #8b5cf6;
    --login-no: #a78bfa;
    --login-fundo-1: #1b1040;
    --login-fundo-2: #0d0a26;

    position: relative;
    min-height: 100svh;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    place-items: center;
    padding: 1rem;
    overflow: hidden;
    isolation: isolate;
}

/* ---------- Cena ---------- */

.login-cena {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(120% 90% at 30% 40%, #2a1466 0%, transparent 60%),
        linear-gradient(160deg, var(--login-fundo-1) 0%, var(--login-fundo-2) 65%, #150b35 100%);
    overflow: hidden;
}

.login-brilho {
    position: absolute;
    width: 70vmax;
    height: 70vmax;
    left: 50%;
    top: 30%;
    translate: -50% -50%;
    background: radial-gradient(circle, rgb(109 40 217 / 0.35), transparent 60%);
    filter: blur(20px);
    animation: login-respira 14s ease-in-out infinite alternate;
}

.login-orbitas {
    position: absolute;
    left: 50%;
    top: 30%;
    width: min(88vw, 30rem);
    aspect-ratio: 1;
    translate: -50% -50%;
    opacity: 0.55;
}

.orbita {
    position: absolute;
    inset: 0;
    margin: auto;
    border-radius: 50%;
    border: 1px solid rgb(167 139 250 / 0.18);
    animation: login-gira linear infinite;
}

.orbita-1 { width: 100%; height: 100%; animation-duration: 90s; }
.orbita-2 { width: 70%; height: 70%; animation-duration: 55s; animation-direction: reverse; border-style: dashed; }
.orbita-3 { width: 42%; height: 42%; animation-duration: 32s; }

/* Raio: do hub até o nó, como as linhas do logo */
.raio {
    position: absolute;
    left: 50%;
    top: 0;
    width: 2px;
    height: 50%;
    translate: -50% 0;
    background: linear-gradient(to top, transparent 15%, rgb(139 92 246 / 0.7));
    border-radius: 2px;
}

.no {
    position: absolute;
    left: 50%;
    top: 0;
    width: 0.75rem;
    height: 0.75rem;
    translate: -50% -50%;
    border-radius: 50%;
    background: var(--login-no);
    box-shadow: 0 0 0 4px rgb(167 139 250 / 0.15), 0 0 18px rgb(167 139 250 / 0.8);
}

.no-oposto { top: 100%; }
.no-lateral { top: 50%; left: 100%; }
.orbita-1 .no { width: 0.6rem; height: 0.6rem; }

.pulso {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgb(139 92 246 / 0.6);
    scale: 0.15;
    opacity: 0;
    animation: login-pulso 4.5s cubic-bezier(0.2, 0.6, 0.3, 1) infinite;
}

.pulso-2 { animation-delay: 2.25s; }

.login-marca {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 26%;
    height: 26%;
    filter: drop-shadow(0 0 24px rgb(139 92 246 / 0.65));
    animation: login-surge 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.login-legenda {
    display: none;
}

/* ---------- Painel do formulário ---------- */

.login-painel {
    position: relative;
    width: 100%;
    max-width: 26rem;
    margin-top: 38svh;
    padding: 2rem 1.5rem;
    border-radius: 1rem;
    background: var(--background);
    color: var(--foreground);
    box-shadow: 0 24px 60px -20px rgb(13 10 38 / 0.7), 0 0 0 1px rgb(167 139 250 / 0.12);
}

.login-conteudo {
    width: 100%;
    max-width: 22rem;
    margin-inline: auto;
}

.login-marca-topo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
}

.login-marca-topo img {
    width: 2.75rem;
    height: 2.75rem;
}

.login-marca-topo strong {
    display: block;
    font-size: 1.125rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.login-marca-topo span {
    display: block;
    font-size: 0.9375rem;
    line-height: 1.2;
    color: var(--muted-foreground);
}

.login-titulo {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
}

.login-subtitulo {
    margin-top: 0.5rem;
    font-size: 0.9375rem;
    color: var(--muted-foreground);
}


/* ---------- Telas maiores: card centralizado sobre a cena ----------
 * As órbitas ficam centradas atrás do card, que ocupa o lugar do hub;
 * os pulsos parecem sair dele. */

@media (min-width: 48rem) {
    .login-brilho,
    .login-orbitas {
        top: 50%;
    }

    .login-orbitas {
        width: min(115vh, 92vw, 64rem);
        opacity: 0.9;
    }

    .login-marca {
        display: none;
    }

    .login-painel {
        max-width: 28rem;
        margin-top: 0;
        padding: 2.5rem;
        background: color-mix(in oklch, var(--background) 96%, transparent);
        backdrop-filter: blur(12px);
        box-shadow: 0 30px 80px -24px rgb(13 10 38 / 0.85), 0 0 0 1px rgb(167 139 250 / 0.18);
        animation: login-entra 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    }
}

@media (min-width: 64rem) {
    .login-legenda {
        display: block;
        position: absolute;
        left: 0;
        bottom: 0;
        max-width: 26rem;
        padding: 3rem;
        color: rgb(237 233 254 / 0.75);
        font-size: 0.9375rem;
        line-height: 1.55;
    }

    .login-legenda strong {
        display: block;
        margin-bottom: 0.25rem;
        color: #fff;
        font-size: 1.125rem;
        font-weight: 600;
        letter-spacing: -0.01em;
    }
}

/* ---------- Animações ---------- */

@keyframes login-gira {
    to { rotate: 360deg; }
}

@keyframes login-pulso {
    0% { scale: 0.15; opacity: 0.9; }
    100% { scale: 1; opacity: 0; }
}

@keyframes login-respira {
    from { scale: 0.85; opacity: 0.7; }
    to { scale: 1.1; opacity: 1; }
}

@keyframes login-entra {
    from { translate: 0 12px; opacity: 0; }
    to { translate: 0 0; opacity: 1; }
}

@keyframes login-surge {
    from { scale: 0.6; opacity: 0; }
    to { scale: 1; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .login *,
    .login *::before,
    .login *::after {
        animation: none !important;
    }
}
