/* ==========================================================================
   VIEW PÚBLICA DE DOCUMENTOS (MODERN UI & RESPONSIVE) documentos.css
   ========================================================================== */

   /* Cabeçalho Interno Padrão (Reaproveitado do Institucional) */
.page-header {
    position: relative;
    background-size: cover;
    background-position: center;
    padding: 80px 20px;
    text-align: center;
    color: white;
}

.page-header-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.655); /* Verde escuro */
    z-index: 1;
}

.page-header-content {
    position: relative;
    z-index: 2;
    max-width: var(--container-width);
    margin: 0 auto;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 16px;
}

.page-header p {
    font-size: 1.1rem;
    color: #e8f2ef;
}
.docs-section {
    padding: 60px 0;
    background-color: #f8fafc;
}

/* Novo: Container que puxa a largura máxima do seu site e centraliza */
.docs-container {
    max-width: var(--container-width, 1200px);
    margin: 0 auto;
    padding: 0 20px;
}

.docs-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 40px;
    align-items: start;
}

/* ==========================================
   BOTÃO MOBILE (INVISÍVEL NO DESKTOP)
   ========================================== */
.mobile-filter-btn {
    display: none;
    width: 100%;
    background-color: #184938;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 14px;
    font-size: 1rem;
    font-weight: 600;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(24, 73, 56, 0.2);
}

/* ==========================================
   ASIDE (FILTROS)
   ========================================== */
.docs-filter-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 28px;
    position: sticky;
    top: 100px; 
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.filter-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-title h3 { margin: 0; font-size: 1.25rem; color: #0f172a; }
.filter-title i { color: #10b981; font-size: 1.2rem; }

.close-filter-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #94a3b8;
    cursor: pointer;
}

.filter-group { margin-bottom: 28px; }
.filter-group label {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    color: #334155;
    margin-bottom: 12px;
}

/* Input Busca */
.search-input-wrapper { position: relative; display: flex; align-items: center; }
.search-input-wrapper i { position: absolute; left: 16px; color: #94a3b8; }
.search-input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 44px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    background-color: #f8fafc;
    transition: all 0.2s;
}
.search-input-wrapper input:focus {
    outline: none;
    border-color: #10b981;
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* ==========================================
   UX MELHORADA: PILLS EM VEZ DE RADIOS
   ========================================== */
.pills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pill-item input[type="radio"] {
    display: none;
}

.pill-item span {
    display: block;
    padding: 8px 16px;
    background-color: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.pill-item input[type="radio"]:checked + span {
    background-color: #184938;
    color: white;
    border-color: #184938;
    box-shadow: 0 4px 6px rgba(24, 73, 56, 0.2);
}

.pill-item span:hover { background-color: #e2e8f0; }

/* Select Base */
.filter-select {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    color: #334155;
    background-color: #f8fafc;
    cursor: pointer;
}

/* Botões Ação */
.filter-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 24px; }
.btn-filter-apply { background-color: #184938; color: #fff; border: none; border-radius: 10px; padding: 14px; font-weight: 700; font-size: 1rem; cursor: pointer; transition: background-color 0.2s; }
.btn-filter-apply:hover { background-color: #123629; }
.btn-filter-clear { text-align: center; color: #64748b; text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.btn-filter-clear:hover { color: #ef4444; }

/* ==========================================
   MAIN CONTENT & CARDS
   ========================================== */
.docs-results-header { margin-bottom: 28px; }
.docs-results-header h2 { color: #0f172a; font-size: 1.8rem; margin-bottom: 4px; font-weight: 800; }
.results-count { color: #64748b; font-size: 0.95rem; }

.docs-grid { display: flex; flex-direction: column; gap: 20px; }

.doc-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.doc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

.doc-icon {
    width: 64px;
    height: 64px;
    background: #fef2f2;
    color: #ef4444;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.doc-info { flex: 1; }
.doc-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }

.doc-badge { padding: 4px 12px; border-radius: 20px; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-construcao { background-color: #e0f2fe; color: #0369a1; }
.badge-mobiliario { background-color: #ffedd5; color: #c2410c; }
.badge-premoldados { background-color: #f1f5f9; color: #475569; }
.badge-geral { background-color: #dcfce7; color: #15803d; }

.doc-date { font-size: 0.85rem; color: #94a3b8; font-weight: 500; }
.doc-title { font-size: 1.25rem; color: #0f172a; margin-bottom: 8px; font-weight: 700; }
.doc-desc { color: #475569; font-size: 0.95rem; line-height: 1.5; margin: 0; }

.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: #f8fafc;
    border: 2px solid #e2e8f0;
    color: #184938;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-download:hover { background-color: #184938; color: #ffffff; border-color: #184938; }

.docs-empty-state { text-align: center; padding: 60px 20px; background: #fff; border-radius: 16px; border: 2px dashed #cbd5e1; }
.docs-empty-state i { font-size: 3rem; color: #cbd5e1; margin-bottom: 16px; }

@media (max-width: 992px) {
    .docs-layout { grid-template-columns: 1fr; }
    .mobile-filter-btn { display: flex; }
    
    /* Overlay e container principal */
    .docs-sidebar {
        position: fixed;
        inset: 0;
        background-color: transparent; 
        z-index: 9999;
        visibility: hidden; 
        pointer-events: none;
        transition: visibility 0.3s, background-color 0.3s ease-out; 
        display: flex;
        align-items: flex-end;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        /* Bloqueia qualquer evento de scroll no overlay transparente/escuro */
        touch-action: none; 
        overscroll-behavior: none;
    }

    .docs-sidebar.active { 
        visibility: visible; 
        pointer-events: auto;
        background-color: rgba(15, 23, 42, 0.6); 
    }

    /* Cartão de conteúdo */
    .docs-filter-card {
        width: 100%;
        border-radius: 24px 24px 0 0;
        margin: 0;
        /* max-height: 90vh; */
        overflow: hidden;
        /* Isola o scroll interno para não repassar para o body */
        overscroll-behavior: contain; 
        /* Restaura a capacidade de toque/scroll apenas dentro do card */
        touch-action: none; 
        transform: translateY(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        will-change: transform;
    }

    .docs-sidebar.active .docs-filter-card { transform: translateY(0); }
    .close-filter-btn { display: block; }

    .doc-card { flex-direction: column; align-items: flex-start; gap: 16px; padding: 20px; }
    .doc-icon { display: none; }
    .doc-action { width: 100%; }
    .btn-download { width: 100%; }
}

.badge-geral {
    background-color: #f1f5f9;
    color: #475569;
}

.modal-auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-auth-overlay.active { display: flex; }

.modal-auth-card {
    background: #ffffff;
    width: 100%;
    max-width: 420px;
    padding: 40px;
    border-radius: 16px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

.btn-close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #94a3b8;
    cursor: pointer;
}

.modal-auth-header { text-align: center; margin-bottom: 25px; }
.modal-auth-header i { font-size: 2.5rem; color: #184938; margin-bottom: 15px; }
.modal-auth-header h3 { font-size: 1.4rem; color: #1e293b; margin-bottom: 5px; }

.auth-group { margin-bottom: 20px; }
.auth-group label { display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 8px; }

.input-password-modal {
    width: 100%;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 5px;
    text-transform: uppercase;
}

.check-container { display: flex; gap: 10px; cursor: pointer; align-items: flex-start; }
.check-text { font-size: 0.8rem; color: #64748b; line-height: 1.4; }

.btn-auth-submit {
    width: 100%;
    padding: 16px;
    background: #184938;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
}

.auth-error-msg { color: #ef4444; font-size: 0.85rem; text-align: center; margin: 10px 0; font-weight: 600; }

/* Estilo para o aviso de sessão expirada no modal */
        .auth-session-alert {
            background: #fff5f5;
            border-left: 4px solid #ef4444;
            color: #b91c1c;
            padding: 12px;
            margin-bottom: 20px;
            border-radius: 4px;
            font-size: 0.85rem;
            display: flex;
            align-items: center;
            gap: 10px;
            animation: shake 0.5s ease-in-out;
        }

        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-5px); }
            75% { transform: translateX(5px); }
        }

/* Anula o padding global da tag main apenas nesta view para alinhar com o aside */
main.docs-main-content {
    padding-top: 0 !important;
}

/* Bloqueia o scroll geral de forma estrita em todos os dispositivos */
.no-scroll {
    overflow: hidden !important;
    touch-action: none; 
}

/* Garante rolagem interna do sidebar e impede que o movimento propague para o fundo */
#mobile-sidebar.active {
    overflow-y: auto; 
    overscroll-behavior: contain; 
}