/* ==================== VARIÁVEIS E RESET ==================== */
:root {
    --primary-color: #C8A58A;
    --primary-color-dark: #b18f76;
    --title-color: #2c2c2c;
    --text-color: #555;
    --light-gray-bg: #f8f9fa;
    --border-color: #e0e0e0;
    --success-bg: #28a745;
    --error-bg: #dc3545;
}


body, .wrapper, .main-panel, .main-sidebar {
    -webkit-user-select: none;  /* Safari */
    -moz-user-select: none;     /* Firefox */
    -ms-user-select: none;      /* Internet Explorer/Edge */
    user-select: none;          /* Padrão */
}

/* 
 * 2. Exceção Essencial: Reabilita a seleção dentro de campos de formulário.
 * Sem isso, o usuário não conseguiria selecionar texto dentro de inputs e textareas.
*/
input, textarea {
    -webkit-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
}

/* 
 * 3. Classe de Utilidade: Crie uma classe para habilitar a seleção onde for útil.
 * Podemos aplicar esta classe em qualquer parágrafo, span ou célula de tabela
 * que contenha informações que o usuário pode querer copiar.
*/
.selectable-text {
    -webkit-user-select: text; /* 'text' é o ideal para conteúdo textual */
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    cursor: text; /* Muda o cursor para indicar que o texto é selecionável */
}


* { margin: 0; padding: 0; box-sizing: border-box; }

html { height: 100%; }

body {
    font-family: 'Poppins', sans-serif;
    background-color: #fff;
    color: var(--text-color);
    line-height: 1.6;
    height: 100%;
    overflow: hidden;
}

/* ==================== ANIMAÇÕES DE ENTRADA ==================== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.logo { animation: fadeInUp 0.6s ease-out forwards; }
h2 { animation: fadeInUp 0.6s 0.1s ease-out forwards; }
p { animation: fadeInUp 0.6s 0.2s ease-out forwards; }
form { animation: fadeInUp 0.6s 0.3s ease-out forwards; }
.logo, h2, p, form { opacity: 0; }

/* ==================== LAYOUT PRINCIPAL (MOBILE FIRST) ==================== */
.login-container {
    display: flex;
    width: 100%;
    height: 100%;
}

.login-form-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    /* MUDANÇA PRINCIPAL AQUI: alinha o item no início (topo) */
    align-items: flex-start; 
    padding: 3rem 1rem 2rem 1rem; /* Aumenta o padding do topo para dar a margem */
    overflow-y: auto; /* Permite rolagem se o conteúdo for muito grande */
}

.form-content {
    width: 100%;
    max-width: 400px;
    background-color: var(--light-gray-bg);
    padding: 2rem 1.5rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.login-image-wrapper {
    display: none;
}

/* ==================== ELEMENTOS DO FORMULÁRIO ==================== */
.logo {
    max-width: 180px;
    height: auto;
    margin: 0 auto 1.5rem auto;
    display: block;
}

h2 {
    color: var(--title-color);
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
}

p {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.input-group {
    position: relative;
    margin-bottom: 1.25rem;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    background-color: #fff;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(200, 165, 138, 0.3);
}

.password-group input { padding-right: 3rem; }

.toggle-password {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    cursor: pointer;
    color: #aaa;
    margin-top: 12px;
    font-size: 1.1rem;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.remember-me { display: flex; align-items: center; gap: 0.5rem; }
.remember-me input[type="checkbox"] { width: 1.1em; height: 1.1em; accent-color: var(--primary-color); }
.button {
    width: 100%;
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}
.button:hover { background: var(--primary-color-dark); }
.button:active { transform: scale(0.98); }

/* ==================== NOTIFICAÇÕES ==================== */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    padding: 15px 20px;
    border-radius: 8px;
    color: #fff;
    min-width: 250px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transform: translateX(120%);
    animation: slideIn 0.5s forwards, slideOut 0.5s 4s forwards;
}

.notification.success { background-color: var(--success-bg); }
.notification.error { background-color: var(--error-bg); }

@keyframes slideIn { to { transform: translateX(0); } }
@keyframes slideOut { from { transform: translateX(0); } to { transform: translateX(120%); } }

/* ==================== LAYOUT DESKTOP ( telas > 992px ) ==================== */
@media (min-width: 992px) {
    .login-form-wrapper {
        width: 50%;
        background-color: #fff;
        /* Volta a centralizar no desktop, onde não há problema de rolagem */
        align-items: center;
        padding: 2rem 1.5rem; /* Reseta o padding */
        overflow-y: hidden;
    }
    
    .form-content {
        background-color: transparent;
        border: none;
        padding: 0;
    }
    
    .login-image-wrapper {
        display: block;
        width: 50%;
        height: 100vh;
    }
    
    .login-image-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}