/* ==========================================================================
   NebulaHub — The Cosmic Portal Login System
   Design Futurista, Imersivo, Glassmorphism Cósmico e Alta Conversão
   ========================================================================== */

:root {
    --nebula-bg: #07020d;
    --nebula-card-bg: rgba(18, 8, 30, 0.72);
    --nebula-card-border: rgba(199, 110, 245, 0.22);
    --nebula-glow-1: rgba(141, 27, 194, 0.38);
    --nebula-glow-2: rgba(199, 110, 245, 0.22);
    --nebula-glow-blue: rgba(79, 70, 229, 0.18);
    --nebula-purple: #8D1BC2;
    --nebula-purple-light: #A855F7;
    --nebula-lavender: #C76EF5;
    --nebula-text-primary: #FFFFFF;
    --nebula-text-secondary: rgba(255, 255, 255, 0.72);
    --nebula-text-muted: rgba(255, 255, 255, 0.45);
    --nebula-input-bg: rgba(255, 255, 255, 0.04);
    --nebula-input-border: rgba(255, 255, 255, 0.12);
}

/* Reset da página de login */
body.gw-login-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background-color: var(--nebula-bg) !important;
    color: var(--nebula-text-primary) !important;
    font-family: 'Geist', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Fundo do Espaço Cósmico com Nébulas e Luzes Estelares */
.nebula-space-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* Grid Holográfico em Perspectiva */
.nebula-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(141, 27, 194, 0.14) 1px, transparent 1px),
        linear-gradient(90deg, rgba(141, 27, 194, 0.14) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 20%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, #000 20%, transparent 80%);
    opacity: 0.65;
}

/* Orbes de Nébula Cósmica com Pulsação Suave */
.nebula-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.6;
    animation: nebula-float 12s ease-in-out infinite alternate;
}

.nebula-orb-1 {
    width: 650px;
    height: 650px;
    top: -150px;
    left: -150px;
    background: radial-gradient(circle, var(--nebula-glow-1) 0%, transparent 70%);
}

.nebula-orb-2 {
    width: 700px;
    height: 700px;
    bottom: -180px;
    right: -150px;
    background: radial-gradient(circle, var(--nebula-glow-2) 0%, transparent 70%);
    animation-delay: -4s;
}

.nebula-orb-3 {
    width: 500px;
    height: 500px;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(141, 27, 194, 0.28) 0%, transparent 75%);
    animation-delay: -7s;
}

@keyframes nebula-float {
    0% { transform: scale(1) translate(0, 0); }
    50% { transform: scale(1.12) translate(30px, -20px); }
    100% { transform: scale(0.95) translate(-25px, 25px); }
}

/* Estrelas Cintilantes Sutis */
.nebula-stars {
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(1.5px 1.5px at 15% 20%, rgba(255, 255, 255, 0.9), transparent),
        radial-gradient(1px 1px at 35% 80%, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(2px 2px at 75% 35%, rgba(199, 110, 245, 0.9), transparent),
        radial-gradient(1px 1px at 85% 65%, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1.5px 1.5px at 50% 15%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(2px 2px at 20% 60%, rgba(141, 27, 194, 0.9), transparent);
    background-size: 350px 350px;
    opacity: 0.85;
}

/* Container Principal Centralizado */
.nebula-portal-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1200px;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 32px 24px 24px;
    box-sizing: border-box;
}

/* Topbar do Portal */
.nebula-portal-top {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nebula-brand-header {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.2s ease;
}
.nebula-brand-header:hover {
    transform: translateY(-1px);
}

.nebula-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(199, 110, 245, 0.25);
    border-radius: 9999px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--nebula-lavender);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.nebula-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #C76EF5;
    box-shadow: 0 0 10px #C76EF5;
    position: relative;
}
.nebula-status-dot::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: rgba(199, 110, 245, 0.5);
    animation: nebula-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes nebula-ping {
    0% { transform: scale(1); opacity: 0.9; }
    100% { transform: scale(2.4); opacity: 0; }
}

/* Área Central com o Card e os Widgets Flutuantes */
.nebula-stage {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: auto 0;
    padding: 20px 0;
}

/* Card Principal em Glassmorphism Cósmico */
.nebula-card {
    position: relative;
    width: 100%;
    max-width: 450px;
    background: var(--nebula-card-bg);
    border: 1px solid var(--nebula-card-border);
    border-radius: 28px;
    padding: 38px 36px 32px;
    backdrop-filter: blur(32px) saturate(180%);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
    box-shadow: 
        0 20px 60px -15px rgba(0, 0, 0, 0.7),
        0 0 40px -10px rgba(141, 27, 194, 0.25),
        inset 0 1px 1px rgba(255, 255, 255, 0.15);
    z-index: 2;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.nebula-card:hover {
    border-color: rgba(199, 110, 245, 0.35);
    box-shadow: 
        0 24px 70px -12px rgba(0, 0, 0, 0.8),
        0 0 50px -5px rgba(141, 27, 194, 0.35),
        inset 0 1px 1px rgba(255, 255, 255, 0.25);
}

/* Feixe de Luz no Topo do Card */
.nebula-card-shine {
    position: absolute;
    top: 0;
    left: 15%;
    right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #C76EF5, transparent);
    opacity: 0.8;
}

/* Cabeçalho do Card */
.nebula-card-header {
    text-align: center;
    margin-bottom: 28px;
}

.nebula-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 9999px;
    background: rgba(141, 27, 194, 0.18);
    border: 1px solid rgba(199, 110, 245, 0.3);
    color: #E2ACFF;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.nebula-card-title {
    font-size: 26px;
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: #FFFFFF;
    margin: 0 0 8px 0;
    background: linear-gradient(180deg, #FFFFFF 40%, rgba(255, 255, 255, 0.82) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nebula-card-subtitle {
    font-size: 13.5px;
    color: var(--nebula-text-secondary);
    line-height: 1.45;
    margin: 0;
}

/* Formulário e Inputs */
.nebula-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.nebula-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nebula-label {
    font-size: 12.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    letter-spacing: -0.01em;
}

.nebula-input-wrapper {
    position: relative;
    width: 100%;
}

.nebula-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--nebula-lavender);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.nebula-input {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 44px;
    background: var(--nebula-input-bg);
    border: 1px solid var(--nebula-input-border);
    border-radius: 14px;
    color: #FFFFFF;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.nebula-input::placeholder {
    color: var(--nebula-text-muted);
    font-size: 13.5px;
}

/* Tratamento de Autofill do Navegador para manter o fundo escuro cósmico */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
.nebula-input:-webkit-autofill,
.nebula-input:-webkit-autofill:hover, 
.nebula-input:-webkit-autofill:focus,
.nebula-input:-webkit-autofill:active {
    -webkit-text-fill-color: #FFFFFF !important;
    -webkit-box-shadow: 0 0 0 1000px #150926 inset !important;
    box-shadow: 0 0 0 1000px #150926 inset !important;
    border-color: rgba(199, 110, 245, 0.45) !important;
    color: #FFFFFF !important;
    caret-color: #FFFFFF !important;
    transition: background-color 5000s ease-in-out 0s;
}

.nebula-input:hover {
    border-color: rgba(199, 110, 245, 0.35);
    background: rgba(255, 255, 255, 0.06);
}

.nebula-input:focus {
    border-color: var(--nebula-purple-light);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 0 0 3px rgba(141, 27, 194, 0.25),
        0 0 24px rgba(141, 27, 194, 0.25);
}

.nebula-input-wrapper:focus-within .nebula-input-icon {
    color: #FFFFFF;
}

.nebula-toggle-pwd {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 8px;
    color: var(--nebula-text-muted);
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background 0.15s ease;
}
.nebula-toggle-pwd:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.08);
}

/* Linha de Manter Conectado & Esqueci a Senha */
.nebula-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    margin-top: 2px;
}

.nebula-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--nebula-text-secondary);
    user-select: none;
    font-size: 12.5px;
}

.nebula-checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
}

.nebula-checkbox-label input[type="checkbox"]:checked {
    background: var(--nebula-purple);
    border-color: var(--nebula-lavender);
}

.nebula-checkbox-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4.5px;
    top: 1.5px;
    width: 4px;
    height: 8px;
    border: solid #FFFFFF;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.nebula-link-muted {
    color: var(--nebula-lavender);
    text-decoration: none;
    font-weight: 500;
    font-size: 12.5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s ease, text-shadow 0.15s ease;
}
.nebula-link-muted:hover {
    color: #FFFFFF;
    text-shadow: 0 0 10px rgba(199, 110, 245, 0.6);
}

/* Botão Cósmico de Acesso */
.nebula-btn-submit {
    position: relative;
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #8D1BC2 0%, #A855F7 100%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 14px;
    color: #FFFFFF;
    font-size: 14.5px;
    font-weight: 650;
    letter-spacing: -0.01em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 
        0 8px 24px -4px rgba(141, 27, 194, 0.5),
        inset 0 1px 1px rgba(255, 255, 255, 0.35);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    margin-top: 4px;
}

.nebula-btn-submit::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transform: skewX(-22deg);
    transition: left 0.75s ease;
}

.nebula-btn-submit:hover {
    transform: translateY(-1.5px);
    box-shadow: 
        0 12px 32px -4px rgba(141, 27, 194, 0.65),
        inset 0 1px 1px rgba(255, 255, 255, 0.45);
    background: linear-gradient(135deg, #9C20D6 0%, #B86BFA 100%);
}

.nebula-btn-submit:hover::after {
    left: 150%;
}

.nebula-btn-submit:active {
    transform: translateY(0.5px) scale(0.99);
}

.nebula-btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

/* Divisor Cósmico */
.nebula-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 22px 0 16px;
    color: var(--nebula-text-muted);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nebula-divider::before,
.nebula-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

/* Rodapé do Card */
.nebula-card-footer {
    text-align: center;
    font-size: 13px;
    color: var(--nebula-text-secondary);
}

.nebula-link-highlight {
    color: var(--nebula-lavender);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}
.nebula-link-highlight:hover {
    color: #FFFFFF;
    text-shadow: 0 0 12px rgba(199, 110, 245, 0.8);
    text-decoration: underline;
}

/* ==========================================================================
   WIDGETS FLUTUANTES EM ÓRBITA (DESKTOP)
   Adicionam vida, dinamismo e visual ultra-tecnológico à tela
   ========================================================================== */
.nebula-orbit-widget {
    position: absolute;
    padding: 14px 18px;
    background: rgba(18, 8, 30, 0.65);
    border: 1px solid rgba(199, 110, 245, 0.18);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 1;
    pointer-events: none;
    user-select: none;
}

/* Widget Esquerdo: Atividade de Pagamento PIX */
.nebula-orbit-left {
    left: 4%;
    top: 35%;
    max-width: 290px;
    animation: orbit-float-left 7s ease-in-out infinite;
}

/* Widget Direito: Criptografia e Nível Bancário */
.nebula-orbit-right {
    right: 4%;
    bottom: 30%;
    max-width: 280px;
    animation: orbit-float-right 8s ease-in-out infinite;
}

.nebula-orbit-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(141, 27, 194, 0.22);
    border: 1px solid rgba(199, 110, 245, 0.3);
    color: #E2ACFF;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nebula-orbit-content {
    flex: 1;
    min-width: 0;
}

.nebula-orbit-title {
    font-size: 12.5px;
    font-weight: 650;
    color: #FFFFFF;
    margin: 0;
}

.nebula-orbit-subtitle {
    font-size: 11.5px;
    color: var(--nebula-text-muted);
    margin: 2px 0 0 0;
}

.nebula-orbit-badge {
    font-size: 12px;
    font-weight: 700;
    color: #E2ACFF;
}

@keyframes orbit-float-left {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(-1deg); }
}

@keyframes orbit-float-right {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(12px) rotate(1deg); }
}

/* Oculta os widgets orbitais em telas médias e compactas */
@media (max-width: 1080px) {
    .nebula-orbit-widget {
        display: none !important;
    }
}

/* Rodapé Inferior: Segurança de Nível Bancário */
.nebula-portal-foot {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding-top: 16px;
    font-size: 12px;
    color: var(--nebula-text-muted);
}

.nebula-foot-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.6);
}

.nebula-foot-badge i,
.nebula-foot-badge svg {
    color: var(--nebula-lavender);
    width: 14px;
    height: 14px;
}

/* Responsividade Mobile Extrema */
@media (max-width: 640px) {
    .nebula-portal-container {
        padding: 20px 16px 16px;
    }
    .nebula-card {
        padding: 28px 22px 24px;
        border-radius: 22px;
    }
    .nebula-card-title {
        font-size: 22px;
    }
    .nebula-portal-foot {
        gap: 12px;
        font-size: 11px;
    }
    .nebula-form-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
}

/* ==========================================================================
   ESTILOS EXCLUSIVOS DO CADASTRO / REGISTRO
   ========================================================================== */
.nebula-card.is-wide {
    max-width: 520px;
}

.nebula-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* Indicador de Força de Senha Cósmico */
.gw-strength {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 14px;
    margin-top: 4px;
}

.gw-strength-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--nebula-text-muted);
    font-weight: 500;
    margin-bottom: 8px;
}

.gw-strength-label {
    font-weight: 600;
    color: var(--nebula-lavender);
}

.gw-meter {
    display: flex;
    gap: 6px;
    height: 4px;
    margin-bottom: 10px;
}

.gw-meter i {
    flex: 1;
    height: 100%;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.1);
    transition: background-color 0.25s ease;
}

.gw-strength[data-level="1"] .gw-meter i:nth-child(1) { background: #f87171; }
.gw-strength[data-level="2"] .gw-meter i:nth-child(-n+2) { background: #fbbf24; }
.gw-strength[data-level="3"] .gw-meter i:nth-child(-n+3) { background: #a855f7; }
.gw-strength[data-level="4"] .gw-meter i:nth-child(-n+4) { background: #c084fc; box-shadow: 0 0 8px rgba(192, 132, 252, 0.6); }

.gw-rules {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    font-size: 11px;
    color: var(--nebula-text-muted);
}

.gw-rules li {
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease;
}

.gw-rules li i,
.gw-rules li svg {
    width: 13px;
    height: 13px;
    opacity: 0.4;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.gw-rules li.is-ok {
    color: #E2ACFF;
}

.gw-rules li.is-ok i,
.gw-rules li.is-ok svg {
    opacity: 1;
    color: #C76EF5;
}

/* Mensagens de Erro */
.gw-error {
    display: none;
    align-items: center;
    gap: 6px;
    color: #f87171;
    font-size: 12px;
    margin-top: 4px;
}

.is-invalid .gw-error {
    display: flex;
}

.is-invalid .nebula-input,
.is-invalid .gw-input {
    border-color: #f87171 !important;
    background: rgba(239, 68, 68, 0.06) !important;
}

.gw-terms-wrap {
    margin-top: 2px;
}
