/* 1. VARIÁVEIS E GERAL */
:root {
    --primary: #3f321e;
    --secondary: #73593b;
    --accent: #968165;
    --light: #f4f1ee;
    --white: #ffffff;
    --success: #28a745;
    --danger: #d9534f;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--light);
    color: var(--primary);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

/* 2. HEADER */
header {
    background-color: var(--primary);
    color: var(--white);
    padding: 30px 20px;
    border-bottom: 5px solid var(--secondary);
}

.header-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.logo-ministerio {
    width: 120px;
    height: 190px;
    object-fit: contain;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.header-content h1 {
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: 2px;
    line-height: 1.2;
    text-transform: uppercase;
}

.header-content p {
    margin: 5px 0 15px 0;
    opacity: 0.8;
    font-size: 0.9rem;
}

.logo-acamp {
    width: 250px;
    height: 105px;
    object-fit: contain;
}

/* 3. CONTADOR DE VAGAS */
.contador-vagas {
    background: var(--primary);
    color: var(--white);
    text-align: center;
    padding: 12px;
    font-weight: bold;
    font-size: 1rem;
}

/* 4. FORMULÁRIO E CONTAINER */
.container {
    max-width: 800px;
    margin: 30px auto;
    background: var(--white);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.form-title {
    border-left: 5px solid var(--secondary);
    padding-left: 15px;
    margin-bottom: 25px;
    font-size: 1.4rem;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 0.9rem;
}

input, select, textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px !important; /* CRÍTICO: Evita zoom no iOS/Android */
}

input:focus, select:focus {
    outline: none;
    border-color: var(--secondary);
}

/* 5. AUXILIARES DE LAYOUT (FLEXBOX) */
.row-flex {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.flex-1 { flex: 1; min-width: 80px; }
.flex-2 { flex: 2; min-width: 200px; }

/* 6. SEÇÕES ESPECÍFICAS (RESPONSÁVEL E FAMÍLIA) */
.alert-box {
    background: #fff5f5;
    padding: 20px;
    border-radius: 5px;
    border: 1px solid #f5c6cb;
    margin-bottom: 20px;
}

.alert-title {
    color: #721c24;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 15px;
}

.familia-box {
    background: #f9f7f5;
    padding: 20px;
    border-radius: 8px;
    border: 1px dashed var(--accent);
    margin-bottom: 20px;
}

.familia-title {
    font-weight: bold;
    color: var(--secondary);
    margin-top: 0;
}

.familiar-item {
    border-top: 1px solid #ddd;
    padding-top: 15px;
    margin-top: 15px;
}

.familiar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.btn-add {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
    font-weight: bold;
}

.btn-remove {
    color: var(--danger);
    border: none;
    background: none;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.8rem;
}

.obs-valor {
    font-size: 0.8rem;
    color: #666;
    margin-top: 10px;
}

/* 7. RESUMO E BOTÃO ENVIAR */
.resumo-box {
    background: var(--light);
    padding: 20px;
    border-radius: 5px;
    margin: 20px 0;
    border: 2px solid var(--secondary);
    text-align: center;
}

.resumo-box span {
   /* font-size: 0.8rem; */
    font-weight: bold;
    color: var(--secondary);
}

.valor-grande {
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--primary);
    margin: 5px 0;
}

.btn-submit {
    background-color: var(--secondary);
    color: white;
    padding: 18px;
    border: none;
    border-radius: 5px;
    width: 100%;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-submit:hover {
    background-color: var(--primary);
}

.btn-submit:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 8. MODAL */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-card {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    margin: 20px;
}

.modal-icon {
    background: var(--success);
    color: white;
    width: 60px; height: 60px;
    line-height: 60px;
    border-radius: 50%;
    font-size: 30px;
    margin: 0 auto 20px;
}

.modal-valor-box {
    background: var(--light);
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px dashed var(--accent);
}

.modal-valor-box strong {
    font-size: 1.6rem;
    color: var(--secondary);
    display: block;
}

.btn-modal {
    background: var(--secondary);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    width: 100%;
}

/* 9. FOOTER */
footer {
    background: #e9e4df;
    padding: 40px 20px;
    text-align: center;
    margin-top: 50px;
    border-top: 1px solid var(--accent);
}

.logo-igreja {
    max-width: 60px;
    margin-bottom: 15px;
    opacity: 0.8;
}

footer p {
    font-size: 0.8rem;
    color: var(--accent);
    margin: 0;
}

/* 10. AJUSTES MOBILE */
@media (max-width: 768px) {
    .header-container {
        flex-direction: row; /* Mantém logo e títulos lado a lado */
        gap: 15px;
        align-items: flex-start;
    }
    .logo-ministerio {
        width: 80px;
        height: auto;
    }
    .header-content h1 { font-size: 1.1rem; }
    .logo-acamp {
        max-width: 180px;
    }
    .container {
        margin: 15px;
        padding: 20px;
    }
}

/* UTILITÁRIOS */
.hidden { display: none !important; }
.mg-b-10 { margin-bottom: 10px; }

/* Media Query para Celulares */
@media (max-width: 768px) {
    .header-adm {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    /* Esconde o cabeçalho original da tabela no mobile */
    thead {
        display: none;
    }

    /* Transforma cada linha em um "Card" */
    tr.row-titular, tr.row-dependente {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        background: #fff !important;
        padding: 10px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #eee;
        padding: 8px 5px !important;
        text-align: left;
    }

    /* Adiciona um rótulo antes do conteúdo no mobile */
    td::before {
        content: attr(data-label); /* Pega o texto do atributo data-label */
        font-weight: bold;
        text-transform: uppercase;
        font-size: 0.7rem;
        color: var(--secondary);
        float: left;
    }

    td:last-child {
        border-bottom: none;
        justify-content: center;
        background: #fdfdfd;
    }

    .row-dependente {
        margin-left: 20px; /* Indenta o dependente no mobile */
        border-left: 4px solid var(--accent) !important;
    }
    
    td[colspan="4"]::before {
        content: "TIPO:";
    }
}
/* Badge de dependentes */
.badge-dep {
    background: var(--light);
    color: var(--secondary);
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid var(--accent);
    display: inline-block;
    margin-top: 5px;
}

.badge-dep:hover {
    background: var(--accent);
    color: white;
}
.badge-danger { background: #f8d7da; color: #721c24; padding: 4px 8px; border-radius: 4px; border: 1px solid #f5c6cb; font-size: 0.75rem; }
.badge-warning { background: #fff3cd; color: #856404; padding: 4px 8px; border-radius: 4px; border: 1px solid #ffeeba; font-size: 0.75rem; }
.badge-success { background: #d4edda; color: #155724; padding: 4px 8px; border-radius: 4px; border: 1px solid #c3e6cb; font-size: 0.75rem; }
.btn-pay { color: #28a745; border: none; background: none; cursor: pointer; font-size: 1.1rem; margin-right: 5px; }

/* Tabela Interna de Dependentes */
.table-interna {
    width: 100%;
    background: #fdfdfd;
    border-left: 10px solid var(--accent);
}

/* No Desktop, os dependentes aparecem normal. No Mobile, controlamos via JS */
@media (max-width: 768px) {
    .hidden-mobile {
        display: none !important; /* Esconde por padrão no mobile */
    }
    
    .show-mobile {
        display: block !important; /* Mostra quando o JS ativar */
    }

    .table-interna td {
        display: table-cell !important; /* Mantém formato de linha dentro do card */
        border: none;
        font-size: 0.8rem;
    }
}

.btn-edit { color: var(--secondary); cursor: pointer; border: none; background: none; font-weight: bold; margin-right: 10px; font-size: 1.1rem; }
.btn-edit:hover { color: var(--primary); }

/* Ajuste para os inputs dentro do SweetAlert */
.swal2-input, .swal2-select {
    font-size: 14px !important;
    margin: 10px auto !important;
    width: 90% !important;
    font-family: 'Montserrat', sans-serif !important;
}

.swal-row {
    display: flex;
    gap: 10px;
    width: 90%;
    margin: 0 auto;
}

.swal-row input, .swal-row select {
    flex: 1;
    width: 100% !important;
}

.swal-titulo-secao {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--secondary);
    margin-top: 15px;
    border-top: 1px solid #eee;
    padding-top: 10px;
    text-align: left;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
}

/* FAQ Styling */
.faq-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.faq-title {
    text-align: center;
    color: var(--primary);
    margin-bottom: 25px;
    text-transform: uppercase;
}

.faq-item {
    background: white;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    cursor: pointer;
    overflow: hidden;
    transition: 0.3s;
    border: 1px solid #eee;
}

.faq-question {
    padding: 15px 20px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--secondary);
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease;
    color: #666;
    font-size: 0.9rem;
}

.faq-item.active .faq-answer {
    max-height: 200px;
    padding: 0 20px 15px 20px;
}

.faq-item.active .faq-question span {
    transform: rotate(45deg);
    display: inline-block;
}

/* --- ACCORDION DENTRO DO MODAL --- */
.accordion-item {
    border-bottom: 1px solid #eee;
}

.accordion-header {
    width: 100%;
    background: none;
    border: none;
    padding: 15px 0;
    text-align: left;
    font-size: 1rem;
    font-weight: bold;
    color: var(--secondary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1); /* Animação suave */
    background-color: #fdfaf7;
}

.accordion-content p {
    padding: 15px;
    margin: 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* O SEGREDO: Quando o item pai tem a classe .active, o conteúdo expande */
.accordion-item.active .accordion-content {
    max-height: 500px; /* Valor alto para garantir que o texto apareça */
    transition: max-height 0.4s ease-in-out;
}
.accordion-item.active .accordion-header span {
    transform: rotate(45deg);
    display: inline-block;
    color: var(--accent);
}
/* Ajuste no ícone + para virar X */
.accordion-header span {
    transition: transform 0.3s ease;
    display: inline-block;
}

.accordion-item.active .accordion-header span {
    transform: rotate(45deg);
    color: var(--accent);
}

.accordion-item.active .accordion-header {
    color: var(--accent);
}

/* --- INSTAGRAM MAIS LEGAL --- */
.social-callout {
    text-align: center;
    padding: 40px 20px;
    background: #fff;
    border-radius: 12px;
    margin-top: 30px;
    border: 1px solid #eee;
}

.social-callout p {
    margin-bottom: 20px;
    font-weight: bold;
    color: var(--primary);
}

.btn-insta {
    display: inline-flex;
    align-items: center;
    padding: 12px 30px;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: white !important;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(220, 39, 67, 0.2);
}

.btn-insta:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(220, 39, 67, 0.4);
}

.btn-insta img {
    filter: brightness(0) invert(1); /* Deixa o ícone do insta branco */
    width: 22px;
}
/* Container que agrupa tudo que é fixo */
.sticky-top {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.top-nav {
    background: var(--primary);
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.back-link {
    color: #fff;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
}

.back-link:hover {
    color: var(--accent);
}

/* Estilo do contador quando ele é fixo */
.contador-vagas-sticky {
    background: #e67e22; /* Um laranja vibrante para chamar atenção */
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
}

/* Ajuste para o Header original não colidir */
header {
    margin-top: 0; /* O espaçador já cuida disso */
}

/* Responsividade: Diminuir texto no mobile para caber tudo */
@media (max-width: 480px) {
    .contador-vagas-sticky { font-size: 0.75rem; }
    .back-link { font-size: 0.7rem; }
}