* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: Geneva, Verdana, Tahoma, sans-serif;
    color: #666;
}

body {
    background: url('../../images/crm.jpg') no-repeat center center fixed; 
    background-size: cover;
    /* Removido o display flex daqui, pois o main-container fará o trabalho */
    margin: 0;
}

/* Header fixado de forma absoluta para ser independente do grid */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #FFFFFF;
    padding: 15px 30px;
    width: 90%;
    max-width: 800px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
    
    /* Centralizado no topo independente do resto */
    position: absolute;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
}

.logo {
    height: 40px;
    width: auto;
}

.menu-toggle {
    display: none;
}

.menu-toggle a {
    color: #00549D;
    text-decoration: none;
    font-weight: bold;
    font-size: 20px;
}

.main-container {
    display: grid;
    /* Linha 1 (Topo), Linha 2 (Caixa - tamanho do conteúdo), Linha 3 (Baixo) */
    grid-template-rows: 1fr auto 1fr; 
    min-height: 100vh;
    width: 100%;
}

/* Ocupa o primeiro "1fr" do Grid e centraliza o título vertical/horizontalmente */
.top-section {
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Adicionamos padding no topo para o título não ficar escondido atrás do header */
    padding-top: 120px; 
    padding-left: 20px;
    padding-right: 20px;
}

.page-title {
    font-family: 'Myriad Pro', Arial, sans-serif;
    font-size: 24px;
    color: #FFF;
    text-transform: uppercase;
    text-align: center;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    margin: 0; /* Removido margin-bottom antigo */
}

/* Login Box */
.login-box {
    grid-row: 2;
    margin: 0 auto; /* Centraliza horizontalmente dentro da sua célula do grid */
    
    background-color: #fff;
    width: 100%;
    max-width: 400px;
    padding: 30px 25px;
    border-radius: 20px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bottom-section {
    grid-row: 3;
}

.login-header h2 {
    font-size: 18px;
    color: #444;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 15px;
}

.login-header p {
    font-size: 12px;
    color: #888;
    text-align: center;
}

/* Form Elements */
#loginForm {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.input-group label {
    font-size: 14px;
    color: #444;
    font-weight: bold;
}

.phone-input-row {
    display: flex;
    gap: 8px;
}

.phone-input-row select {
    width: 105px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 14px;
    color: #222;
    outline: none;
    transition: border-color 0.3s;
}

.phone-input-row input {
	width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 14px;
    color: #222;
    outline: none;
    transition: border-color 0.3s;
}

.phone-input-row input:focus {
    border-color: #00549D;
}

.mensagem-alerta {
    /* Reserva o espaço vertical */
    min-height: 42px; 
    width: 100%;
    
    /* Centralização interna */
    display: flex;
    align-items: center;
    justify-content: center;
    
    font-size: 13px;
    text-align: center;
    font-weight: bold;
    padding: 10px;
    border-radius: 8px;
    
    /* Invisível por padrão, mas ocupando espaço */
    visibility: hidden;
    border: 1px solid transparent; 
    
    /* Transição suave para não aparecer de forma brusca */
    transition: opacity 0.3s ease;
    opacity: 0;
}

/* Classe utilitária para quando a mensagem deve aparecer */
.mensagem-alerta.visible {
    visibility: visible;
    opacity: 1;
}

.btn-group {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

#entrar {
    width: 100%;
    padding: 12px;
    border-radius: 15px;
    border: 1px solid #808080;
    background-color: transparent;
    color: #808080;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
}

#entrar:hover, #entrar:focus {
    background-color: #00549D;
    color: #fff;
    border-color: #00549D;
}

#entrar:disabled {
    background-color: #eee;
    color: #aaa;
    border-color: #ccc;
    cursor: not-allowed;
}

/* Responsividade Mobile */
@media (max-width: 600px) {

    .menu-toggle {
        display: block;
    }
    
	.header {
        position: fixed;
        top: 0;
        left: 0;
        transform: none; /* Remove o translateX no mobile */
        width: 100%;
        border-radius: 0;
    }

    .main-container {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding-top: 100px; /* Compensa o header fixo */
        padding-bottom: 30px;
    }

    .top-section {
        padding-top: 0;
        margin-bottom: 20px; /* Separa o título do login no celular */
    }    
}