/* =========================================
   Importação de Fonte Moderna
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* =========================================
   Reset e Configurações Básicas
   ========================================= */
* {
    /* box-sizing: border-box; */
    margin: 0;
    padding: 0;
    font-family: 'Poppins', sans-serif;
}

/* =========================================
   Overlay (Fundo)
   ========================================= */
#form_user_register {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Contraste adequado */
    z-index: 1005;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: all 0.3s ease;
}

#form_user_register.hide-img {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

/* =========================================
   Cartão Principal
   ========================================= */
.Content-New-user {
    background-color: #ffffff;
    width: 50%;
    max-width: 900px;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: row;
    position: relative;
    overflow: hidden;
    max-height: 78vh;
}

/* Botão Fechar (X) */
.close-button {
    position: absolute;
    top: 20px;
    right: 25px;
    background: transparent;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    z-index: 20;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
}

.close-button:hover {
    color: #ef4444;
    transform: scale(1.1);
}

/* =========================================
   Lateral Esquerda
   ========================================= */
.form_user_register_naverbar_itenslateral {
    background-color: #34495e;
    width: 23%;
    padding: 40px 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    position: relative;
    border-right: 1px solid rgba(255,255,255,0.1);
}

.form_user_register_user {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    opacity: 0.8;
    margin-bottom: 15px;
    font-weight: 500;
}

/* ESTILO NOVO PARA O TÍTULO H1 */
.titulousuario {
    font-size: 1.8rem;
    margin-bottom: 0px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    width: 25rem !important;
}

.title_newuser {
    font-size: 1.5rem;
    margin-bottom: 30px;
    font-weight: 700;
    line-height: 1.3;
    color: white !important;
}

/* Avatar / Foto */
.lockscreen-image {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.25);
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.lockscreen-image:hover {
    transform: scale(1.05);
    border-color: #fff;
    box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

input[type="file"]#Img_card_user {
    display: none;
}

/* =========================================
   Área de Inputs (GRID LAYOUT)
   ========================================= */
.form_user_register_naverbar_inputs {
    width: 75%;
        padding: 15px 2rem;
    background-color: #fff;
    /* overflow-y: auto; */
    
    /* Configuração do Grid para alinhar Código e Nome */
    display: grid;
    grid-template-columns: 120px 1fr; /* Coluna 1 fixa (código), Coluna 2 flexível (nome) */
    column-gap: 20px;
    row-gap: 20px;
    align-content: flex-start;
}

/* Posicionamento no Grid */
.codigo-form-user {
    grid-column: 1; /* Ocupa a primeira célula */
    width: 100%;
}

.usuario-form-user {
    grid-column: 2; /* Ocupa a segunda célula */
    width: 100%;
}

/* Estes elementos ocupam a linha inteira (ambas as colunas) */
.email-form-user,
.btn-newuser {
    grid-column: 1 / -1; /* Do início ao fim */
    width: 100%;
}

/* SENHAS LADO A LADO (Desktop) */
.form_user_register_naverbar_Senhas {
    grid-column: 1 / -1;
    width: 100%;
    
    display: grid;
    grid-template-columns: 1fr 1fr; /* Duas colunas iguais */
    gap: 20px;
}

/* Labels */
.LabelName {
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
    display: block;
}

/* Inputs */
.form-control {
    display: block;
    width: 100%;
    padding: 10px 15px;
    padding-right: 40px; /* Espaço para ícone */
    border: 2px solid #e2e8f0;
    background-color: #f8fafc;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #334155;
    transition: all 0.2s ease;
    height: 46px !important;
}

.form-control:focus {
    border-color: #34495e;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(52, 73, 94, 0.1);
    outline: none;
}

.form-control::placeholder {
    color: #94a3b8;
}

/* =========================================
   Senha e Toggle
   ========================================= */
.password-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.generate-password-btn {
    background: none;
    border: none;
    color: #3b82f6; /* Azul destaque */
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
}

.generate-password-btn:hover { color: #2563eb; text-decoration: underline; }

.password-wrapper {
    position: relative;
    display: block;
    width: 100%; 
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 0;
    display: flex;
    align-items: center;
    z-index: 5;
    height: 100%;
}

.password-toggle-btn:hover { color: #475569; }

.confirmasenha {
    margin-top: 0; /* Removido margem pois o gap do grid já espaça */
    width: 100%;
}

/* MODIFICAÇÃO: Permite que o Label e o Status fiquem na mesma linha */
.confirmasenha .LabelName {
    display: inline-block;
    margin-bottom: 6px;
}

/* =========================================
   FORÇA DA SENHA (CORRIGIDO)
   ========================================= */
.NavForcasenha {
    /* Força ocupar as duas colunas do grid de senhas */
    grid-column: 1 / -1;
    margin-top: 10px;
    position: relative;
    padding-bottom: 10px; /* Espaço reservado para a barra */
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

/* Barra de Fundo (Cinza) */
.NavForcasenha::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: #e2e8f0;
    border-radius: 2px;
}

/* Barra de Progresso (Colorida) */
.NavForcasenha::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    border-radius: 2px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease;
    width: 0%; /* Padrão zero */
    background-color: transparent;
}

/* Classes controladas pelo JS */
.NavForcasenha.strength-1::after { width: 20%; background-color: #ef4444; } /* Vermelho */
.NavForcasenha.strength-2::after { width: 40%; background-color: #f97316; } /* Laranja */
.NavForcasenha.strength-3::after { width: 60%; background-color: #eab308; } /* Amarelo */
.NavForcasenha.strength-4::after { width: 80%; background-color: #84cc16; } /* Verde Claro */
.NavForcasenha.strength-5::after { width: 100%; background-color: #22c55e; } /* Verde Forte */

/* Texto Badge */
.tipyforcauser {
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    background-color: #f1f5f9;
    color: #94a3b8;
}

/* =========================================
   Botões
   ========================================= */
.btn-newuser {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 0px;
    border-top: 1px solid #f1f5f9;
}

.btn {
    padding: 0 30px;
    height: 46px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn:active { transform: translateY(1px); }

/* Estilo Ghost para Cancelar */
.btnCancelar {
    background-color: transparent !important;
    border: 2px solid #cbd5e1 !important;
    color: #64748b !important;
}

.btnCancelar:hover {
    border-color: #94a3b8 !important;
    color: #475569 !important;
    background-color: #f8fafc !important;
}

.btn-success {
    background-color: #34495e;
    color: white;
    box-shadow: 0 4px 10px rgba(52, 73, 94, 0.25);
}

.btn-success:hover {
    background-color: #2c3e50;
    box-shadow: 0 6px 15px rgba(52, 73, 94, 0.35);
    transform: translateY(-2px);
}

/* =========================================
   INTEGRAÇÃO JS (Alertas e Validação)
   ========================================= */
.form-alert {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    border-radius: 8px;
    background-color: #fef2f2;
    color: #991b1b;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 80%;
    text-align: center;
    border-left: 5px solid #ef4444;
}

.form-alert.show { opacity: 1; visibility: visible; top: 30px; }
.form-alert.success { background-color: #f0fdf4; color: #166534; border-left-color: #22c55e; }

.input-error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.Passconfirm {
    font-size: 0.8rem;
    font-weight: 700;
    margin-left: 10px;
    display: inline-block;
    opacity: 0;
    transition: opacity 0.2s;
    text-transform: uppercase;
}

.Passconfirm.show { opacity: 1; }
.Passconfirm.valid { color: #22c55e; }
.Passconfirm.invalid { color: #ef4444; }

/* =========================================
   Ajuste Específico para Resolução 1024px
   ========================================= */
@media (max-width: 1024px) {
    .Content-New-user {
        /* Aumenta para 70% (aprox 716px) para manter o tamanho visual parecido com o de 1440px */
        width: 70%; 
    }
}

/* =========================================
   Responsividade (Mobile)
   ========================================= */
/* =========================================
   Responsividade (Mobile e Tablets)
   ========================================= */
@media (max-width: 768px) {
    .Content-New-user {
        flex-direction: column;
        width: 100%;        
        height: 100%;       
        /* Usa 100dvh se o navegador suportar, para não esconder atrás da barra de endereço do celular */
        height: 100dvh; 
        max-width: 100%;
        max-height: 100%;    
        border-radius: 0;    
        box-shadow: none;    
        
        /* CORREÇÃO CRÍTICA: Permite que o formulário role no celular */
        overflow-y: auto; 
    }

    .form_user_register_naverbar_itenslateral {
        width: 100%;
        padding: 15px 20px; /* Reduzido levemente para dar espaço ao formulário */
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        text-align: left;
        gap: 15px;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        flex-shrink: 0; 
    }
    
    .title_newuser {
        margin-bottom: 0;
        font-size: 1.2rem;
    }
    
    .titulousuario {
        font-size: 1.1rem; /* Reduzido para não quebrar linha à toa */
        width: auto !important; 
        margin-bottom: 0;
    }
    
    .form_user_register_user { display: none; }

    .lockscreen-image {
        width: 50px; /* Reduzido para dar mais espaço de tela */
        height: 50px;
        border-width: 2px;
    }

    /* Reseta o Grid para Mobile (uma coluna) */
    .form_user_register_naverbar_inputs {
        width: 100%;
        padding: 20px 15px; /* Reduzido as laterais de 25px para 15px para aproveitar a tela */
        display: flex;
        flex-direction: column;
        gap: 15px;
        flex-grow: 1; 
        overflow-y: visible; /* Deixa o scroll para o Content-New-user */
    }

    .codigo-form-user, .usuario-form-user {
        width: 100%;
        grid-column: auto;
    }

    /* Senhas voltam a ficar empilhadas no mobile */
    .form_user_register_naverbar_Senhas {
        display: flex; 
        flex-direction: column;
        gap: 15px;
    }

    .close-button {
        color: white; 
        top: 20px;
        right: 15px;
        background-color: rgba(255, 255, 255, 0.2); /* Cria um fundinho para ficar fácil de clicar */
        width: 35px;
        height: 35px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* MELHORIA NOS BOTÕES PARA MOBILE */
    .btn-newuser {
        flex-direction: column-reverse; /* Inverte: Confirmar fica em cima, Cancelar embaixo */
        gap: 10px;
        padding-top: 15px;
        padding-bottom: 20px; /* Espaço para não colar no fim da tela do celular */
    }

    .btn-newuser .btn {
        width: 100%; /* Botões ocupam 100% da largura, evitando cliques errados com o dedo */
        height: 50px; /* Pouco mais alto para o "touch" do dedo */
    }
}

/* =========================================
   Responsividade (Telas muito pequenas - ex: iPhone SE)
   ========================================= */
@media (max-width: 400px) {
    .form-control {
        height: 42px !important; /* Diminui a altura dos inputs para caber mais coisa na tela */
        font-size: 0.85rem;
    }
    
    .LabelName {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }
}