/* =========================================
   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
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* Adicionado para evitar quebras de layout */
    font-family: 'Poppins', sans-serif;
}

/* =========================================
   Overlay (Fundo com Blur Moderno)
   ========================================= */
#form_user_register {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.5); /* Tom mais azulado escuro */
    backdrop-filter: blur(6px); /* Efeito de vidro moderno */
    -webkit-backdrop-filter: blur(6px);
    z-index: 1005;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* =========================================
   Cartão Principal (COMPACTADO)
   ========================================= */
.Content-New-user {
    background-color: #ffffff;
    width: 50%; 
    max-width: 800px; /* Reduzido de 950px para 800px */
    border-radius: 20px; /* Reduzido ligeiramente */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: row;
    position: relative;
    overflow: hidden;
    max-height: 90vh; /* Permite crescer um pouco mais se necessário */
}

/* Botão Fechar (X) Modernizado e Ajustado */
.close-button {
    position: absolute;
    top: 16px; /* Mais colado ao topo */
    right: 16px;
    width: 32px; /* Reduzido de 36px */
    height: 32px;
    border-radius: 50%;
    background-color: #f1f5f9; 
    border: none;
    font-size: 16px;
    color: #64748b; 
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-button:hover {
    background-color: #fef2f2; 
    color: #ef4444;
    transform: rotate(90deg);
}

/* =========================================
   Lateral Esquerda (COMPACTADA)
   ========================================= */
.form_user_register_naverbar_itenslateral {
    background: linear-gradient(145deg, #1e293b 0%, #334155 100%); 
    width: 20%; /* Ajuste na proporção para o card menor */
    padding: 30px 20px; /* Reduzido o padding vertical */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    position: relative;
}

.form_user_register_user {
    font-size: 0.7rem; /* Reduzido */
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #94a3b8;
    margin-bottom: 8px; /* Reduzido */
    font-weight: 600;
}

.title_newuser {
    font-size: 1.4rem; /* Reduzido de 1.6rem */
    margin-bottom: 25px; /* Reduzido */
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff !important;
}

/* Avatar / Foto (COMPACTADO) */
.lockscreen-image {
    width: 110px; /* Reduzido de 140px */
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.15); /* Borda mais fina */
    background-color: #f8fafc;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 20px -5px rgba(0,0,0,0.3);
}

.lockscreen-image:hover {
    transform: scale(1.05) translateY(-3px);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 15px 25px -5px rgba(0,0,0,0.4);
}

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

/* =========================================
   Área de Inputs (COMPACTADA)
   ========================================= */
.form_user_register_naverbar_inputs {
    width: 74%;
    padding: 30px 35px; /* Reduzido de 40px 45px */
    background-color: #ffffff;
    display: grid;
    grid-template-columns: 100px 1fr; /* Reduzido o espaço do código de 140px para 100px */
    column-gap: 16px; /* Reduzido de 24px */
    row-gap: 16px; /* Reduzido de 24px */
    align-content: flex-start;
    overflow-y: auto;
}

/* TÍTULO H1 */
.titulousuario {
    grid-column: 1 / -1 !important; 
    width: 100% !important;
    justify-content: flex-start !important; 
    text-align: left !important;
    font-size: 1.5rem; /* Reduzido de 1.8rem */
    font-weight: 800;
    color: #0f172a; 
    margin-bottom: 5px !important;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

/* Posicionamento no Grid */
.codigo-form-user { grid-column: 1; width: 100%; }
.usuario-form-user { grid-column: 2; width: 100%; }

.email-form-user, .btn-newuser {
    grid-column: 1 / -1;
    width: 100%;
}

/* SENHAS LADO A LADO */
.form_user_register_naverbar_Senhas {
    grid-column: 1 / -1;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px; /* Reduzido de 24px */
}

/* Labels */
.LabelName {
    font-size: 0.8rem; /* Reduzido de 0.85rem */
    font-weight: 600;
    color: #475569;
    margin-bottom: 4px; /* Reduzido de 8px */
    display: block;
}

/* Inputs Modernizados (COMPACTADOS) */
.form-control {
    display: block;
    width: 100%;
    padding: 0 14px; /* Ajuste interno */
    padding-right: 35px;
    border: 1.5px solid #e2e8f0;
    background-color: #f8fafc;
    border-radius: 8px; /* Reduzido de 12px */
    font-size: 0.9rem; /* Texto menor */
    font-weight: 500;
    color: #0f172a;
    transition: all 0.2s ease;
    height: 42px !important; /* Altura muito menor (antes era 50px) */
}

.form-control:focus {
    border-color: #3b82f6; 
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); 
    outline: none;
}

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

/* Código em destaque cinza */
#codigo {
    background-color: #f1f5f9;
    color: #64748b;
    font-weight: 700;
    text-align: center;
    padding-right: 14px; 
}

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

.generate-password-btn {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 0.75rem; /* Reduzido */
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

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

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

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

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

.confirmasenha {
    margin-top: 0;
    width: 100%;
}

.confirmasenha .LabelName {
    display: inline-block;
    margin-bottom: 4px;
}

/* =========================================
   FORÇA DA SENHA
   ========================================= */
.NavForcasenha {
    grid-column: 1 / -1;
    margin-top: -5px;
    position: relative;
    padding-bottom: 10px; /* Reduzido */
    display: flex;
    align-items: center;
    gap: 10px; /* Reduzido */
    font-size: 0.75rem; /* Reduzido */
    color: #64748b;
    font-weight: 600;
}

.NavForcasenha::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px; /* Reduzido de 6px */
    background-color: #f1f5f9;
    border-radius: 4px;
}

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

.NavForcasenha.strength-1::after { width: 20%; background-color: #ef4444; } 
.NavForcasenha.strength-2::after { width: 40%; background-color: #f97316; } 
.NavForcasenha.strength-3::after { width: 60%; background-color: #eab308; } 
.NavForcasenha.strength-4::after { width: 80%; background-color: #84cc16; } 
.NavForcasenha.strength-5::after { width: 100%; background-color: #10b981; } 

.tipyforcauser {
    font-weight: 800;
    padding: 2px 8px; /* Reduzido */
    border-radius: 4px;
    font-size: 0.65rem; /* Reduzido */
    text-transform: uppercase;
    background-color: #f1f5f9;
    color: #94a3b8;
    letter-spacing: 0.5px;
}

/* =========================================
   Botões Modernos (COMPACTADOS)
   ========================================= */
.btn-newuser {
    display: flex;
    justify-content: flex-end;
    gap: 12px; /* Reduzido de 16px */
    padding-top: 15px; /* Reduzido de 20px */
    margin-top: 5px;
}

.btn {
    padding: 0 24px; /* Reduzido de 32px */
    height: 40px; /* Reduzido de 48px */
    border-radius: 8px; /* Reduzido de 12px */
    font-size: 0.9rem; /* Reduzido de 0.95rem */
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn:active { transform: scale(0.97); }

/* Ghost / Cancelar */
.btnCancelar {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
}

.btnCancelar:hover {
    background-color: #e2e8f0 !important;
    color: #1e293b !important;
}

/* Primary / Confirmar */
.btn-success {
    background-color: #2563eb; 
    color: white;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2); /* Sombra mais discreta */
}

.btn-success:hover {
    background-color: #1d4ed8;
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.3);
    transform: translateY(-2px);
}

/* =========================================
   INTEGRAÇÃO JS (Alertas e Validação)
   ========================================= */
.form-alert {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    padding: 12px 20px;
    border-radius: 8px;
    background-color: #fef2f2;
    color: #991b1b;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.15);
    width: 85%;
    text-align: center;
    border: 1px solid #fecaca;
}

.form-alert.show { 
    opacity: 1; 
    visibility: visible; 
    transform: translateX(-50%) translateY(0); 
}
.form-alert.success { 
    background-color: #f0fdf4; 
    color: #166534; 
    border-color: #bbf7d0; 
    box-shadow: 0 10px 25px rgba(34, 197, 94, 0.15);
}

.input-error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
    animation: shake 0.4s ease-in-out;
}
.input-error:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important; }

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

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

.Passconfirm.show { opacity: 1; }
.Passconfirm.valid { color: #10b981; }
.Passconfirm.invalid { color: #ef4444; }

/* =========================================
   Ajuste Específico para Resolução Média
   ========================================= */
@media (max-width: 1200px) {
    .Content-New-user { width: 75%; }
}

@media (max-width: 992px) {
    .Content-New-user { width: 90%; }
    .form_user_register_naverbar_inputs { padding: 25px; }
}

/* =========================================
   Responsividade (Mobile e Tablets)
   ========================================= */
@media (max-width: 768px) {
    .Content-New-user {
        flex-direction: column;
        width: 100%;        
        height: 100dvh; 
        max-width: 100%;
        max-height: 100%;    
        border-radius: 0;    
        box-shadow: none;    
        overflow-y: auto; 
    }

    .form_user_register_naverbar_itenslateral {
        width: 100%;
        padding: 20px;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        text-align: left;
        gap: 20px;
        background: #1e293b; 
        flex-shrink: 0; 
    }
    
    .title_newuser {
        margin-bottom: 0;
        font-size: 1.2rem;
    }
    
    .titulousuario {
        font-size: 1.2rem;
        width: auto !important; 
        margin-bottom: 0;
    }
    
    .form_user_register_user { display: none; }

    .lockscreen-image {
        width: 60px; 
        height: 60px;
        border-width: 2px;
        box-shadow: none;
    }

    .form_user_register_naverbar_inputs {
        width: 100%;
        padding: 24px 20px;
        display: flex;
        flex-direction: column;
        gap: 16px;
        flex-grow: 1; 
        overflow-y: visible; 
    }

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

    .form_user_register_naverbar_Senhas {
        display: flex; 
        flex-direction: column;
        gap: 16px;
    }

    .close-button {
        top: 16px;
        right: 16px;
        background-color: rgba(255, 255, 255, 0.1) !important; 
        color: #f8fafc !important;
    }

    .close-button:hover { 
        background-color: rgba(255, 255, 255, 0.2) !important; 
        color: #fff !important; 
    }

    .btn-newuser {
        flex-direction: column-reverse; 
        gap: 10px;
        padding-top: 20px;
        padding-bottom: 30px; 
        border-top: none;
    }

    .btn-newuser .btn {
        width: 100%; 
        height: 48px; 
    }
}

/* =========================================
   Responsividade (Telas muito pequenas)
   ========================================= */
@media (max-width: 400px) {
    .form-control {
        height: 40px !important; 
        font-size: 0.85rem;
    }
    
    .LabelName { font-size: 0.75rem; margin-bottom: 4px; }
}