/* =========================================
   1. RESET E VARIÁVEIS GERAIS
   ========================================= */
:root {
    --primary-green: #1a472a; 
    --primary-dark: #11301c;
    --accent-yellow: #fdd835; 
    --accent-hover: #eebb00;
    --text-dark: #2c3e50;
    --text-light: #64748b;
    --bg-body: #f8f9fa;
    --white: #ffffff;
    --shadow-soft: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overscroll-behavior-y: none;}

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-body);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main { flex: 1 0 auto; width: 100%; }

h1, h2, h3, h4, .nav-links a, .btn-primary, .timeline-year, .date-highlight, .chapter-title, .section-title, .article-header {
    font-family: 'Montserrat', sans-serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* =========================================
   2. HEADER & NAVEGAÇÃO
   ========================================= */
header {
    background-color: var(--primary-green);
    color: white;
    height: 100px;
    position: static; 
    top: 0;
    z-index: 1000;
    border-bottom: 4px solid var(--accent-yellow);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 100%;
}

.header-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
    position: relative;
}

.logo { position: absolute; top: 0; left: 20px; z-index: 1001; display: flex; }

.logo img {
    height: 200px;
    width: auto;
    display: block;
    margin-top: 5px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.4));
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.logo img:hover { transform: scale(1.05); }

.nav-links {
    display: flex; gap: 35px; margin-left: 180px; height: 100%; align-items: center;
}

.nav-links a {
    color: rgba(255,255,255,0.95);
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    padding: 20px 0;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--accent-yellow);
    text-shadow: 0 0 10px rgba(253, 216, 53, 0.4); 
}

.hamburger { display: none; cursor: pointer; font-size: 28px; color: white; }

/* =========================================
   3. HERO SECTION & HOME COMPONENTS
   ========================================= */
.hero {
    background: linear-gradient(rgba(26, 71, 42, 0.2), rgba(26, 71, 42, 0.2)), url('images/background.webp');
    background-size: cover; 
    background-position: center 70%;
    height: 600px;
    display: flex; align-items: center; justify-content: center;
    position: relative; margin-bottom: 0; 
    clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
}

.hero-content {
    color: white; width: 100%; text-align: left; 
    display: flex; flex-direction: column; align-items: flex-start; 
}

.hero-content h1 {
    font-size: 3rem; font-weight: 800; margin-bottom: 25px;
    line-height: 1.1; text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.features-section {
    padding-top: 20px; padding-bottom: 80px; text-align: center;
    position: relative; z-index: 2;
}

.features-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px; margin-top: 50px;
}

.feature-card { padding: 30px; transition: transform 0.3s; }
.feature-card h3 { margin-bottom: 15px; font-size: 1.25rem; }
.feature-card p { color: var(--text-light); font-size: 0.95rem; }

.feature-icon {
    width: 80px; height: 80px;
    background-color: rgba(253, 216, 53, 0.2); color: var(--primary-green);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; margin: 0 auto 25px; transition: all 0.3s;
}

.feature-card:hover .feature-icon {
    background-color: var(--primary-green); color: var(--accent-yellow);
    transform: rotateY(180deg);
}

.cta-banner {
    background: linear-gradient(135deg, var(--primary-green) 0%, #0d2516 100%);
    color: white; padding: 80px 0; text-align: center;
    position: relative; overflow: hidden;
    border-radius: 20px; margin: 40px 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.cta-banner::before { top: -50%; left: -10%; width: 300px; height: 300px; background-color: rgba(255,255,255,0.05); content:''; position: absolute; border-radius: 50%;}
.cta-banner::after { bottom: -50%; right: -10%; width: 400px; height: 400px; background-color: rgba(253, 216, 53, 0.05); content:''; position: absolute; border-radius: 50%; }

.cta-content { position: relative; z-index: 2; }
.cta-banner h2 { color: white; font-size: 2.5rem; margin-bottom: 20px; }
.cta-banner p { font-size: 1.1rem; opacity: 0.9; margin-bottom: 30px; max-width: 600px; margin: 0 auto; line-height: 1.8; }

/* =========================================
   4. LAYOUT GERAL, CARDS & BOTÕES
   ========================================= */
h2 { color: var(--primary-green); font-size: 2.2rem; margin-bottom: 15px; font-weight: 700; }

.separator { width: 80px; height: 6px; background-color: var(--accent-yellow); margin-bottom: 50px; border-radius: 3px; }

.page-header {
    background: linear-gradient(to bottom, rgba(26, 71, 42, 0.60), rgba(17, 48, 28, 0.65)), url('images/background.webp');
    background-size: cover; 
    background-position: center 65%; 
    background-repeat: no-repeat;
    padding: 100px 0 120px; text-align: center; color: white;
    margin-bottom: 60px; clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%); position: relative;
}
.page-header h1 { font-size: 3rem; margin-bottom: 15px; }
.page-header p { font-size: 1.2rem; opacity: 0.9; font-weight: 300; max-width: 600px; margin: 0 auto; }

.card-box {
    background: var(--white); border-radius: 16px;
    box-shadow: var(--shadow-soft); overflow: hidden;
    transition: all 0.3s ease; border: 1px solid rgba(0,0,0,0.03);
}
.card-box:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }

.btn-primary {
    display: inline-flex; align-items: center; justify-content: center;
    background-color: var(--accent-yellow); color: var(--primary-green);
    padding: 16px 40px; font-weight: 700; border-radius: 50px;
    text-transform: uppercase; transition: all 0.3s ease; letter-spacing: 1px;
    border: none; box-shadow: 0 4px 15px rgba(253, 216, 53, 0.4); cursor: pointer;
}
.btn-primary:hover {
    background-color: var(--white); color: var(--primary-green);
    transform: translateY(-3px); box-shadow: 0 8px 20px rgba(253, 216, 53, 0.6);
}

.btn-inverse {
    background-color: white; color: var(--primary-green);
    padding: 25px 40px; 
    border-radius: 50px; font-weight: 700; margin-top: 30px;
    text-transform: uppercase; display: inline-block; transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.btn-inverse:hover { background-color: var(--accent-yellow); transform: translateY(-3px); }

/* =========================================
   5. EVENTOS
   ========================================= */
.events-grid-modern {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 40px; margin-bottom: 60px;
}

.card-box.event-clean {
    border-top: 6px solid var(--accent-yellow); background: white;
    padding: 40px 35px; display: flex; flex-direction: column; height: 100%;
}

.date-highlight {
    font-weight: 700; color: var(--primary-green); font-size: 1.2rem;
    margin-bottom: 15px; display: block; text-transform: uppercase;
    letter-spacing: 0.5px; border-bottom: 1px solid #eee; padding-bottom: 15px;
}

.event-title { font-size: 1.5rem; margin-bottom: 15px; font-weight: 700; line-height: 1.3; }
.event-meta {
    display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 20px;
    font-size: 0.95rem; color: var(--text-light);
}
.event-desc { color: var(--text-dark); line-height: 1.7; margin-bottom: 30px; flex-grow: 1; }

.card-box.horizontal { display: flex; flex-wrap: wrap; overflow: hidden; }
.card-box.horizontal:hover { transform: none; box-shadow: var(--shadow-soft); }

/* =========================================
   6. PÁGINAS INTERNAS
   ========================================= */

/* Timeline */
.timeline-container { padding: 20px; max-width: 900px; margin: 0 auto; }
.timeline-item {
    display: flex; gap: 30px; padding-bottom: 40px;
    border-left: 3px solid var(--accent-yellow);
    padding-left: 30px; position: relative; margin-left: 20px;
}
.timeline-item::before {
    content: ''; position: absolute; left: -11px; top: 0;
    width: 20px; height: 20px; background: var(--primary-green);
    border-radius: 50%; border: 3px solid white;
}
.timeline-item:last-child { border-left: 3px solid transparent; }
.timeline-year { font-size: 1.8rem; font-weight: 800; color: var(--primary-green); min-width: 100px; }
.timeline-content { flex: 1; }

/* Equipa */
.team-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 30px; margin-bottom: 60px; }
.team-card {
    flex: 0 1 300px; text-align: center; padding: 40px 20px;
    border-top: 5px solid var(--accent-yellow); min-width: 250px; max-width: 350px; width: 100%;
}
.role-badge {
    display: inline-block; background: rgba(26, 71, 42, 0.1); color: var(--primary-green);
    padding: 5px 15px; border-radius: 20px; font-size: 0.85rem; font-weight: 600; margin-bottom: 15px;
}

/* Formulários Modernos */
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 4px; font-family: inherit;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.form-row.thirds { grid-template-columns: 1fr 1fr 1fr; }

/* Estilo para Menores de Idade (Bloco do Encarregado) */
#guardian-section {
    display: none; /* Escondido por defeito */
    background-color: #fff9db; /* Fundo amarelo claro */
    border: 2px dashed var(--accent-hover);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}
#guardian-section h3 { margin-top: 0; font-size: 1.2rem; margin-bottom: 15px; color: var(--text-dark); }

/* Estatutos / Documentos Legais */
.legal-document {
    background: white; padding: 60px 80px; border-radius: 4px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05); border: 1px solid #e0e0e0;
}
.chapter-title {
    color: var(--primary-green); font-size: 1.8rem; font-weight: 800;
    margin-top: 60px; margin-bottom: 30px; text-transform: uppercase;
    text-align: center; border-bottom: 2px solid var(--accent-yellow); padding-bottom: 15px;
}
.chapter-block:first-child .chapter-title { margin-top: 0; }
.section-title {
    color: var(--text-dark); font-size: 1.3rem; font-weight: 700;
    margin-top: 40px; margin-bottom: 20px; padding-left: 20px;
    border-left: 5px solid var(--accent-yellow); background: #fffcf0; padding: 10px 20px;
}
.article-box { margin-bottom: 25px; }
.article-header { font-size: 1.1rem; font-weight: 800; color: var(--primary-green); display: block; margin-bottom: 8px; }
.article-content { color: #444; text-align: justify; line-height: 1.8; font-size: 1rem; }

/* Contactos Maps */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; margin-top: 50px; }
.map-container { height: 400px; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-soft); }

/* =========================================
   7. FOOTER
   ========================================= */
footer { background-color: var(--primary-green); color: rgba(255, 255, 255, 0.85); margin-top: auto; font-size: 0.95rem; }
.footer-top-border { height: 5px; background: linear-gradient(90deg, var(--accent-yellow) 0%, #f7c325 100%); width: 100%; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 50px; padding: 60px 0 40px; }

.footer-col h3 {
    color: white; font-size: 1.3rem; margin-bottom: 25px; font-weight: 700; position: relative; display: inline-block;
}
.footer-col h3::after { content: ''; position: absolute; left: 0; bottom: -8px; width: 30px; height: 3px; background-color: var(--accent-yellow); }

.footer-col.links a:hover { color: var(--accent-yellow); margin-left: 5px; }
.social-icons { display: flex; gap: 15px; margin-top: 20px; }
.social-icons a {
    width: 40px; height: 40px; background-color: rgba(255, 255, 255, 0.1);
    color: white; display: inline-flex; justify-content: center; align-items: center;
    border-radius: 50%; transition: all 0.3s ease;
}
.social-icons a:hover { background-color: var(--accent-yellow); color: var(--primary-green); transform: translateY(-3px); }

.footer-bottom {
    background-color: rgba(0, 0, 0, 0.2); padding: 20px 0; text-align: center;
    font-size: 0.85rem; border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* =========================================
   8. RESPONSIVIDADE (MOBILE)
   ========================================= */
 @media (max-width: 900px) {
    .nav-links {
		position: fixed;
        top: 50px;
        right: 0;
        width: auto;      /* Largura ajustada ao conteúdo */
        min-width: 180px; /* Mínimo para não ficar muito estreito */
        height: auto;     /* Altura ajustada ao conteúdo */
        
        /* VISUAL */
        background: var(--primary-green);
        padding: 5px 0;   /* Espaço mínimo nas pontas da caixa verde */
        box-shadow: -5px 5px 15px rgba(0,0,0,0.2);
        border-bottom-left-radius: 10px;
        
        /* FLEXBOX */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 0; /* Remove espaços extra entre elementos */

        /* ANIMAÇÃO */
        transform: translateX(100%); 
        transition: transform 0.3s ease;
    }
    .nav-links.active { transform: translateX(0); }
    .hamburger { display: block; margin-right: 20px; }
    .logo img { height: 140px; }
	.main-grid, .contact-grid, .footer-grid { grid-template-columns: 1fr; gap: 40px; text-align: center; }
    .footer-col h3::after { left: 50%; transform: translateX(-50%); }
    .social-icons { justify-content: center; }
    .timeline-item { flex-direction: column; gap: 10px; }
	.hero-content h1 { font-size: 2.5rem; }
    .form-row, .form-row.thirds { grid-template-columns: 1fr; }
    .legal-document { padding: 30px 20px; }
    .chapter-title { font-size: 1.4rem; }
    .section-title { font-size: 1.1rem; padding: 10px; }
    .cta-banner {
        /* Antes devia ter 0 nas laterais. Agora forçamos 20px */
        padding: 60px 20px; 
    }
    
    .cta-banner h2 {
        font-size: 1.8rem; /* Opcional: ajusta o tamanho do título para não quebrar tanto */
        line-height: 1.2;
    }
} 

/* =========================================
   9. ADMIN DASHBOARD 
   ========================================= */

/* Fundo do Login com a tua imagem de capa */
.admin-login-body {
    background: linear-gradient(rgba(26, 71, 42, 0.85), rgba(20, 54, 32, 0.95)), url('images/background.webp');
    background-size: cover;
    background-position: center;
    height: 100vh;
    display: flex; align-items: center; justify-content: center;
}

/* Cartão de Login reutilizando .card-box */
.login-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(5px);
    width: 100%; max-width: 400px;
    padding: 40px; border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    text-align: center;
}

/* Botões de Navegação (Tabs) do Admin */
.nav-pills-custom {
    background: var(--white);
    padding: 10px; border-radius: 12px;
    box-shadow: var(--shadow-soft);
    display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 30px;
    justify-content: center;
}

/* Estilo dos Botões das Abas */
.nav-pills-custom .nav-link {
    color: var(--text-dark);
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.2s;
    border: none; background: transparent;
}

.nav-pills-custom .nav-link:hover {
    background-color: var(--bg-body);
    color: var(--primary-green);
}

.nav-pills-custom .nav-link.active {
    background-color: var(--primary-green);
    color: var(--accent-yellow);
    box-shadow: 0 4px 10px rgba(26, 71, 42, 0.3);
}

/* Ajustes para o conteúdo do Admin */
.admin-header {
    background: var(--primary-green);
    padding: 15px 0;
    box-shadow: var(--shadow-soft);
    margin-bottom: 30px;
}

/* Tabelas e Paineis */
.admin-table th {
    background-color: var(--bg-body);
    color: var(--primary-green);
    font-weight: 700; text-transform: uppercase; font-size: 0.8rem;
    padding: 15px; border-bottom: 2px solid #e0e0e0;
}
.admin-table td { padding: 15px; vertical-align: middle; border-bottom: 1px solid #eee; }

/* Subcapítulos dos Estatutos */
.subchapter-block {
    background-color: #fffcf0; /* Amarelo muito clarinho */
    border-left: 4px solid var(--accent-yellow);
    padding: 20px; margin-bottom: 15px; border-radius: 6px;
}

/* Alerts Flutuantes */
.alert-floating {
    position: fixed; top: 20px; right: 20px; z-index: 9999;
    box-shadow: var(--shadow-hover); border: none; border-radius: 10px;
}

/* =========================================
   10. TRANSIÇÃO SUAVE (MODERNO & LIMPO)
   ========================================= */

body {
    /* Removido o opacity: 0 para o site não desaparecer */
    transition: opacity 0.4s ease-in-out;
}