/* Variáveis: paleta em tons de azul */
:root {
    --blue-primary: #1565c0;
    --blue-dark: #0d47a1;
    --blue-darker: #0a3d91;
    --blue-light: #e3f2fd;
    --blue-lighter: #bbdefb;
    --bg-card: #ffffff;
    --bg-page: #fafbfc;
    --text-primary: #1a237e;
    --text-body: #37474f;
    --border-blue: rgba(13, 71, 161, 0.2);
    --shadow-soft: 0 2px 8px rgba(13, 71, 161, 0.08);
    --radius: 8px;
}

/* Reset básico */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Estrutura da página para garantir footer na base */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-body);
    background: linear-gradient(180deg, var(--blue-light) 0%, var(--bg-page) 30%);
}

/* Container principal usando flexbox */
.page-container {
    display: flex;
    flex: 1;
    width: 100%;
    position: relative;
    padding-bottom: 100px; /* espaço para o footer fixo */
}

/* Menu lateral */
.sidebar {
    width: 300px;
    padding: 20px;
    background-color: var(--bg-card);
    border-right: 2px solid var(--blue-lighter);
    flex-shrink: 0;
    box-shadow: var(--shadow-soft);
}

/* Estilos para o logo */
.logo-container {
    text-align: center;
    margin-bottom: 20px;
}

.logo {
    max-width: 100%;
    height: auto;
    max-height: 120px;
}

/* Título da serventia */
.serventia-title {
    text-align: center;
    font-size: 14px;
    margin-bottom: 20px;
    text-transform: uppercase;
    padding: 10px;
    border: 1px solid var(--border-blue);
    background-color: var(--blue-light);
    color: var(--text-primary);
    border-radius: var(--radius);
}

/* Logos oficiais (Brasil, Pernambuco) – destaque no topo da sidebar */
.official-logos {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    padding: 18px 16px;
    background-color: var(--blue-light);
    border-radius: var(--radius);
    border: 2px solid var(--blue-dark);
    box-shadow: 0 2px 12px rgba(13, 71, 161, 0.12);
}

.official-logos-label {
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--blue-dark);
}

.official-logos-images {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.official-logos img {
    height: 64px;
    width: auto;
    object-fit: contain;
}

/* Botões do menu */
.menu-buttons button {
    display: block;
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 10px;
    background-color: var(--bg-card);
    border: 1px solid var(--blue-lighter);
    color: var(--text-primary);
    text-align: center;
    text-transform: uppercase;
    font-size: 14px;
    cursor: pointer;
    border-radius: var(--radius);
    transition: background-color 0.3s, color 0.3s;
}

.menu-buttons button:hover {
    background-color: var(--blue-dark);
    color: white;
}

/* Link do Whatsapp */
.whatsapp-button {
    display: block;
    width: 100%;
    text-decoration: none;
}

/* Conteúdo principal */
.main-content {
    flex-grow: 1;
    padding: 30px 30px 120px 30px; /* padding inferior para não ficar atrás do footer fixo */
    overflow-y: auto;
    background-color: transparent;
}

main {
    max-width: 900px;
    margin: 0 auto;
}

/* Estilo das seções de conteúdo */
.content {
    margin-bottom: 40px;
    padding: 24px;
    background-color: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-blue);
}

.content h2 {
    margin-bottom: 20px;
    color: var(--blue-dark);
    text-align: center;
}

.content h3 {
    margin: 20px 0 10px;
    color: var(--text-primary);
}

.content p {
    margin-bottom: 15px;
    text-align: justify;
}

.content ul {
    margin-bottom: 15px;
    padding-left: 20px;
}

.content li {
    margin-bottom: 8px;
}

/* Links */
.content a {
    color: var(--blue-primary);
    text-decoration: none;
}

.content a:hover {
    text-decoration: underline;
}

/* Classe para esconder elementos */
.hidden {
    display: none;
}

/* Rodapé fixo na base da tela */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 18px 0;
    background-color: var(--blue-dark);
    color: white;
    border-top: 3px solid var(--blue-primary);
    width: 100%;
    z-index: 50;
}

footer a {
    color: var(--blue-lighter);
}

/* Botão de menu e elementos para mobile */
.menu-toggle, .close-menu, .menu-overlay {
    display: none;
}

/* Media queries para responsividade */
@media (max-width: 992px) {
    .page-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 2px solid var(--blue-lighter);
    }
    
    .main-content {
        padding: 20px 20px 120px 20px;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        position: fixed;
        top: 10px;
        left: 10px;
        background-color: var(--blue-dark);
        color: white;
        border: none;
        padding: 10px 15px;
        font-size: 18px;
        border-radius: var(--radius);
        z-index: 999;
        cursor: pointer;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        height: 100vh;
        width: 280px;
        z-index: 1000;
        overflow-y: auto;
        transition: left 0.3s ease;
        box-shadow: 4px 0 16px rgba(13, 71, 161, 0.15);
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .close-menu {
        display: block;
        position: absolute;
        top: 10px;
        right: 10px;
        background: none;
        border: none;
        font-size: 20px;
        cursor: pointer;
        color: var(--blue-dark);
    }
    
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .menu-overlay.active {
        display: block;
    }
    
    .main-content {
        padding: 60px 15px 120px 15px;
    }
    
    .content {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 50px 10px 120px 10px;
    }
    
    .official-logos {
        padding: 14px 12px;
        gap: 10px;
    }
    
    .official-logos-label {
        font-size: 10px;
    }
    
    .official-logos-images {
        gap: 14px;
    }
    
    .official-logos img {
        height: 52px;
    }
}

/* Estilos para o sistema de login */
.user-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

#logged-user {
    margin-right: 10px;
    font-weight: bold;
}

.logout-button {
    padding: 5px 10px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.logout-button:hover {
    background-color: #d32f2f;
}

.profile-link {
    display: inline-block;
    padding: 5px 10px;
    background-color: var(--blue-primary);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 14px;
}

.profile-link:hover {
    background-color: var(--blue-dark);
    text-decoration: none;
}

/* Estilos do modal de login */
.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 24px;
    background-color: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-blue);
}

.login-logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-logo img {
    max-width: 150px;
}

.login-form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--blue-lighter);
    border-radius: var(--radius);
}

.login-button {
    width: 100%;
    padding: 10px;
    background-color: var(--blue-primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 16px;
}

.login-button:hover {
    background-color: var(--blue-dark);
}

.error-message {
    color: #f44336;
    margin-top: 10px;
}

/* Estilos para o sistema de registro e confirmação de e-mail */
.register-container {
    max-width: 500px;
    margin: 50px auto;
    padding: 30px;
    background-color: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-blue);
}

.register-form {
    margin-top: 20px;
}

.register-button {
    width: 100%;
    padding: 10px;
    background-color: var(--blue-primary);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 16px;
    margin-top: 15px;
}

.register-button:hover {
    background-color: var(--blue-dark);
}

.password-info {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.message-box {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    display: none;
}

.message-box.error {
    display: block;
    background-color: #ffebee;
    border: 1px solid #f44336;
    color: #b71c1c;
}

.message-box.success {
    display: block;
    background-color: #e8f5e9;
    border: 1px solid #4caf50;
    color: #2e7d32;
}

.login-links {
    margin-top: 20px;
    text-align: center;
}

.login-links a {
    display: block;
    margin-bottom: 10px;
}

/* Atualizar os estilos de login existentes */
.back-link {
    color: var(--blue-primary);
    text-decoration: none;
    display: block;
    margin-top: 15px;
    text-align: center;
}

.back-link:hover {
    text-decoration: underline;
}

/* Estilos para a página de perfil */
.profile-info {
    background-color: var(--blue-light);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 30px;
    border: 1px solid var(--border-blue);
}

.info-group {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-blue);
}

.info-label {
    font-weight: bold;
    display: inline-block;
    width: 120px;
}

/* Utilitários */
.text-center {
    text-align: center;
}