/* login.css */
:root {
    --color-bg-dark: #050505;
    --color-glass: rgba(10, 10, 12, 0.28);
    --neon-white: #ffffff;
    --neon-glow-white: 0 0 15px rgba(255, 255, 255, 0.4), 0 0 30px rgba(255, 255, 255, 0.1);
    --animation-speed: 8s;
}

body.login-body {
    background-color: var(--color-bg-dark);
    color: var(--color-text);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
    position: relative;
    font-family: 'Outfit', sans-serif;
}

/* Fundo de brilho suave para profundidade */
body.login-body::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
    pointer-events: none;
}

#particles-js {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    opacity: 0.4;
}

/* Canvas de Estrelas Cintilantes */
#stars-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
}

/* Canvas de Chip Procedural - Fluxo de Dados Infinito */
#chip-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2;
    pointer-events: none;
    opacity: 0.4;
}

/* Canvas do Portal/Vórtice — Sobrepõe tudo */
#vortex-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999;
    pointer-events: none;
    display: none;
    /* Visível apenas durante a transição */
}

/* Animação tridimensional de colapso espiral do container de login para dentro do buraco negro */
.login-container.vortex-suck {
    animation: vortexSuckContainer 3.8s cubic-bezier(0.5, 0, 0.2, 1) forwards !important;
    transform-origin: center center;
    pointer-events: none;
}

/* O fundo e as estrelas também são sugados para a singularidade imediatamente */
.vortex-suck-bg {
    animation: vortexSuckBackground 2.5s cubic-bezier(0.5, 0, 0.2, 1) forwards !important;
    transform-origin: center center;
}

/* A janela de Acesso diminui de tamanho até desaparecer de forma direta e elegante */
@keyframes vortexSuckContainer {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    100% {
        transform: scale(0);
        opacity: 0;
    }
}

/* O espaço afunila velozmente para o centro */
@keyframes vortexSuckBackground {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
        filter: blur(0);
    }

    60% {
        transform: scale(1.5) rotate(45deg);
        opacity: 0.8;
        filter: blur(4px);
    }

    100% {
        transform: scale(0.01) rotate(720deg);
        opacity: 0;
        filter: blur(25px);
    }
}

.login-container {
    background: var(--color-glass);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2.2rem;
    /* Reduzido de 3rem (~15% reduzido, mas proporcionalmente ajustado) */
    width: 100%;
    max-width: 350px;
    /* Reduzido de 420px (~15-17%) */
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Centraliza todos os itens internamente */
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.8),
        inset 0 0 20px rgba(255, 255, 255, 0.02);
    animation: boxFadeIn 1s ease-out;
}

/* Astros Laterais Sofisticados */
.star-ambient {
    position: absolute;
    z-index: 11;
    pointer-events: none;
}

.star-ambient::before,
.star-ambient::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* Nucleo central brilhante */
.star-ambient::before {
    width: 6px;
    height: 6px;
    background: #ffffff;
    box-shadow:
        0 0 6px 2px #fff,
        0 0 18px 6px rgba(255, 255, 255, 0.8),
        0 0 45px 16px rgba(255, 255, 255, 0.3),
        0 0 90px 30px rgba(255, 255, 255, 0.1);
    animation: starCorePulse 3s infinite ease-in-out;
}

/* Halo externo difuso */
.star-ambient::after {
    width: 80px;
    height: 80px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.04) 40%, transparent 70%);
    animation: starHaloPulse 3s infinite ease-in-out;
}

.star-left {
    left: -20px;
    top: -20px;
    /* Topo da caixa */
}

.star-right {
    right: -20px;
    bottom: -20px;
    /* Base da caixa */
    animation-delay: 1.5s;
}

.star-right::before {
    animation-delay: 1.5s;
}

.star-right::after {
    animation-delay: 1.5s;
}

@keyframes starCorePulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow:
            0 0 6px 2px rgba(255, 255, 255, 0.7),
            0 0 18px 6px rgba(255, 255, 255, 0.56),
            0 0 45px 16px rgba(255, 255, 255, 0.21),
            0 0 90px 30px rgba(255, 255, 255, 0.07);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.5);
        box-shadow:
            0 0 10px 4px rgba(255, 255, 255, 0.7),
            0 0 30px 12px rgba(255, 255, 255, 0.63),
            0 0 70px 25px rgba(255, 255, 255, 0.35),
            0 0 130px 50px rgba(255, 255, 255, 0.105);
    }
}

@keyframes starHaloPulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.42;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.6);
        opacity: 0.7;
    }
}

@keyframes boxFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-back {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    font-size: 1.2rem;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    margin-bottom: 2rem;
    transition: all 0.4s var(--ease-spring);
    /* Centralizado no topo do container */
    align-self: center;
}

.login-back:hover {
    color: var(--neon-white);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateX(-5px) scale(1.05);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 3rem;
}

.login-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #888888 100%) !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: white !important;
    /* Fallback */
    letter-spacing: -1px;
    font-weight: 700;
}

.login-header p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    /* Reduzido levemente */
}

form {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-group {
    margin-bottom: 2rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    /* Reduzido levemente */
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 500;
    text-align: center;
    /* Centralizado */
}

.input-group input {
    width: 100%;
    padding: 1rem 1.2rem;
    /* Reduzido de 1.2rem 1.5rem */
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    /* Reduzido de 1rem */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    /* Centralizado */
}

.input-group input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.1);
    transform: scale(1.02);
}

.password-wrapper {
    position: relative;
}

.btn-toggle-password {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    font-size: 1.1rem;
    transition: color 0.3s;
}

.btn-toggle-password:hover {
    color: var(--neon-white);
}

.btn-glow {
    position: relative;
    background: #fff;
    color: #000;
    border: none;
    padding: 0.65rem 1.6rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.4s;
    overflow: hidden;
    margin: 1rem auto;
    display: block;
    z-index: 1;
}

/* Feixe de luz deslizando da esquerda para direita a cada 6s */
.btn-glow::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.6) 40%,
        rgba(255, 255, 255, 0.9) 50%,
        rgba(255, 255, 255, 0.6) 60%,
        transparent 100%
    );
    animation: lightBeamSweep 6s ease-in-out infinite;
    pointer-events: none;
    border-radius: inherit;
}

@keyframes lightBeamSweep {
    0%   { left: -100%; opacity: 0; }
    5%   { opacity: 1; }
    18%  { left: 160%; opacity: 1; }
    20%  { left: 160%; opacity: 0; }
    100% { left: -100%; opacity: 0; }
}

.btn-glow:hover {
    background: white;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.2);
}

.signup-link {
    color: rgba(255, 255, 255, 0.4);
}

.signup-link a {
    color: white !important;
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
    border-bottom: 1px solid transparent;
    transition: all 0.3s;
}

.signup-link a:hover {
    color: #fff;
    border-bottom-color: #fff;
}

.forgot-link {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.82rem;
}

.forgot-link a {
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s;
    letter-spacing: 0.04em;
}

.forgot-link a:hover {
    color: rgba(255, 255, 255, 0.85);
    border-bottom-color: rgba(255, 255, 255, 0.4);
}

.error-msg,
.success-msg {
    margin: 1.5rem 0;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    text-align: center;
}

.error-msg {
    background: rgba(255, 77, 77, 0.1);
    color: #ff8080;
    border: 1px solid rgba(255, 77, 77, 0.2);
}

.success-msg {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.hidden {
    display: none !important;
}

/* Custom Autofill Styles (replacing default browser yellow with a premium light black) */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 100px rgba(20, 20, 24, 0.95) inset !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 0 0 0 100px rgba(20, 20, 24, 0.95) inset !important;
    text-fill-color: #ffffff !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    body.login-body {
        min-height: 100vh;
        overflow: hidden;
    }

    .login-container {
        padding: 1.5rem;
        max-width: 88%;
        border-radius: 16px;
        height: auto;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
        margin: auto;
    }

    .login-header {
        margin-bottom: 1.2rem;
    }

    .login-header h1 {
        font-size: 2.2rem;
    }

    .login-back {
        margin-bottom: 1rem;
    }

    .input-group {
        margin-bottom: 0.8rem;
    }

    .input-group label {
        margin-bottom: 0.4rem;
        font-size: 0.7rem;
    }

    .input-group input {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    select#reg-tipo {
        padding: 10px 12px !important;
        font-size: 0.85rem !important;
    }

    .btn-glow {
        margin: 0.8rem auto;
        padding: 0.6rem 1.4rem;
    }

    .chip-container {
        display: none;
    }

    /* Disable/lock viewport scroll on mobile */
    html, body {
        overflow: hidden !important;
        height: 100% !important;
        position: fixed !important;
        width: 100% !important;
        overscroll-behavior: none !important;
    }
}
