/* --- PALETA DE CORES OFICIAL IGUAPÉ --- */
:root {
    --azul-intenso: #004854;
    --agua: #35B2C7;
    --vegetacao: #54B482;
    --terra: #E5735E;
    --azulado: #A9D8E4;
    --fosco: #404040;
    --light-bg: #F4FAF8;
    --card-bg: #ffffff;
}

/* RESET E BASE GLOBAL */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
}

html {
    font-size: 16px;
    overflow-y: scroll; /* Mantém a barra de rolagem sempre presente para nada pular */
}

body {
    background-color: var(--light-bg);
    color: var(--fosco);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* CABEÇALHO GLOBAL IDÊNTICO */
header {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 72, 84, 0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    height: 85px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.navbar {
    position: relative; /* Âncora para o dropdown mobile descer perfeitamente */
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo-iguape {
    display: inline-flex;
    align-items: center;
    height: 60px;
    min-width: 0;
    text-decoration: none;
}

.logo-iguape img {
    height: 60px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    display: block;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--fosco);
    font-weight: 600;
    transition: color 0.3s;
}

.nav-links a:hover, 
.nav-links a.active {
    color: var(--agua);
}

/* ESTRUTURA GERAL DAS PÁGINAS */
.main-wrapper {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
}

/* BOTÕES PADRÃO */
.btn-primary {
    background-color: var(--vegetacao);
    color: white;
    padding: 0.9rem 2.2rem;
    font-size: 1.1rem;
    font-weight: 700;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(84, 180, 130, 0.35);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(84, 180, 130, 0.45);
}

/* RODAPÉ GLOBAL IDÊNTICO */
footer {
    text-align: center;
    padding: 20px;
    font-size: 0.85rem;
    color: #666;
    background-color: #ffffff;
    border-top: 1px solid rgba(169, 216, 228, 0.4);
    width: 100%;
}

/* --- MENU MOBILE NATIVO (SEM JAVASCRIPT - CHECKBOX HACK) --- */
#menu-toggle-checkbox {
    display: none !important;
}

.menu-toggle-label {
    display: none;
    cursor: pointer;
    padding: 8px 12px;
    font-size: 1.8rem;
    color: var(--azul-intenso);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* COMPORTAMENTO EXCLUSIVO PARA CELULARES (ATÉ 768px) */
@media (max-width: 768px) {
    /* Exibe o ícone hambúrguer apenas no mobile */
    .menu-toggle-label {
        display: block !important;
    }

    /* Oculta os links por padrão na barra horizontal */
    .navbar .nav-links {
        display: none !important;
        flex-direction: column !important;
        position: absolute !important;
        top: 85px !important; /* Desce logo abaixo da navbar */
        left: 0 !important;
        width: 100% !important;
        background-color: #ffffff !important;
        box-shadow: 0 14px 28px rgba(0, 72, 84, 0.18) !important;
        padding: 1.5rem 2rem !important;
        gap: 1.2rem !important;
        border-top: 1px solid rgba(169, 216, 228, 0.4) !important;
        z-index: 1100 !important;
    }

    /* Ao clicar/tocar na label, o checkbox marca e força o menu a abrir */
    #menu-toggle-checkbox:checked ~ .nav-links {
        display: flex !important;
    }

    .navbar .nav-links li {
        width: 100% !important;
    }

    .navbar .nav-links a {
        display: block !important;
        padding: 8px 0 !important;
        font-size: 1.15rem !important;
        border-bottom: 1px solid #f0f5f7 !important;
    }
}

/* PREVENÇÃO CONTRA QUEBRA DE LARGURA */
.main-wrapper > *,
.hero > *,
.dashboard-preview > *,
.card > *,
.cadastro-layout > * {
    min-width: 0;
}

.main-wrapper {
    overflow-wrap: anywhere;
}

/* AJUSTE RESPONSIVO PARA TELAS INTERMEDIÁRIAS (TABLETS E NOTEBOOKS PEQUENOS) */
@media (min-width: 769px) and (max-width: 1000px) {
    .nav-links {
        gap: 0.75rem 1rem;
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .navbar {
        gap: 1.5rem;
    }
}