
:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #0f172a;
    --primary: #60a5fa;
    --primary-glow: rgba(96, 165, 250, 0.2);
    --secondary: #3b82f6;
    --accent: #60a5fa;
    --text-main: #f1f5f9;
    --text-dark: #ffffff;
    --text-muted: #94a3b8;
    --glass: rgba(30, 41, 59, 0.9);
    --glass-border: rgba(51, 65, 85, 1);
    --nav-height: 80px;
    --sidebar-width: 260px;
}

/* Inversão de Logo para fundo escuro por padrão */
.site-logo-header,
.sidebar .logo img {
    filter: brightness(0) invert(1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
}

/* =====================
   LAYOUT PRINCIPAL
   ===================== */
.app-container {
    display: flex;
    min-height: 100vh;
    height: 100%;
    width: 100%;
}

/* --- SIDEBAR --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card) !important;
    border-right: 1px solid var(--glass-border);
    position: fixed;
    top: 0;
    left: 0;
    padding: 25px 20px;
    display: flex;
    flex-direction: column;
    z-index: 1001;
    overflow-y: auto;
    transition: transform 0.3s ease;
    /* Esconder scrollbar */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.sidebar::-webkit-scrollbar { display: none; }

.logo {
    margin-bottom: 25px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    transition: 0.3s;
    white-space: nowrap;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: #eff6ff;
    color: #1e40af; /* Azul mais escuro para contraste (Acessibilidade) */
}

.sidebar-link i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* --- CONTEÚDO PRINCIPAL --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 20px 0px;
    background: var(--bg-dark);
    width: calc(100% - var(--sidebar-width));
    transition: all 0.3s ease;
    min-width: 0;
}

/* --- TOP BAR --- */
.top-bar {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px 20px 40px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--glass-border);
}

.user-profile-summary {
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.user-profile-summary:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
    background: rgba(255, 255, 255, 0.8) !important;
}

.notifications-bell:hover i {
    color: var(--primary) !important;
    transform: rotate(15deg);
    transition: 0.3s;
}

/* =====================
   COMPONENTES BASE
   ===================== */
.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.card {
    padding: 30px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card:hover {
    transform: translateY(-10px);
}

/* --- CONTAINER --- */
.container {
    width: 100%;
    margin: 0;
    padding: 20px 0;
}

/* --- GRID --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 30px;
}

/* --- HERO --- */
.hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    padding: 60px 20px;
    background: radial-gradient(circle at top right, rgba(124, 58, 237, 0.15), transparent),
        radial-gradient(circle at bottom left, rgba(0, 212, 255, 0.15), transparent);
}

.hero h1 {
    font-size: clamp(2.5rem, 8vw, 5rem);
    margin-bottom: 20px;
    line-height: 1.1;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 700px;
    margin-bottom: 40px;
}

/* --- BOTÕES --- */
.glow-btn {
    padding: 16px 40px;
    background: var(--primary);
    color: #0f172a; /* Contraste Máximo (Acessibilidade) */
    border: none;
    border-radius: 50px;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 0 20px var(--primary-glow);
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.glow-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 0 40px var(--primary-glow);
}

/* --- CANVAS BG --- */
#canvas-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* =====================
   MOBILE HAMBURGER & REFINEMENTS
   ===================== */
@media (max-width: 1024px) {
    html, body {
        zoom: 1 !important;
        overflow-x: hidden !important;
        position: relative;
        width: 100%;
    }
}

.mobile-menu-toggle {
    display: none;
    background: white;
    border: 1px solid var(--glass-border);
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    color: var(--primary);
    font-size: 1.2rem;
    z-index: 1002;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: 0.3s;
}

.mobile-menu-toggle:hover {
    transform: scale(1.1);
    color: var(--secondary);
}

.sidebar-close-btn {
    display: none;
}

/* =====================
   RESPONSIVIDADE
   ===================== */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 0px;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 260px;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 20px 0 50px rgba(0,0,0,0.15);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 20px;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .sidebar-close-btn {
        display: flex;
        position: absolute;
        top: 20px;
        right: 15px;
        background: #f1f5f9;
        border: 1px solid var(--glass-border);
        color: var(--text-muted);
        border-radius: 8px;
        width: 34px;
        height: 34px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 1rem;
        transition: 0.2s;
    }

    .sidebar-close-btn:hover {
        background: #fee2e2;
        color: #ef4444;
        border-color: #fca5a5;
    }
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }

    .grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .hero h1 {
        font-size: 2.2rem !important;
    }

    .hero p {
        font-size: 1rem !important;
    }

    .top-bar {
        height: auto;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .header-user-actions {
        width: 100%;
        justify-content: space-between;
    }

    .container {
        padding: 0 15px;
    }

    .glass-panel {
        overflow-x: hidden; /* Alterado de auto para hidden para evitar vazar no mobile */
    }

    /* Forçar a grade de notícias a ser 1 coluna no mobile (Desktop fallback) */
    .noticias-grid-responsivo {
        grid-template-columns: 1fr !important;
        width: 100% !important;
    }

    /* Corrigir o container para não vazar */
    .container {
        padding: 0 15px !important;
        max-width: 100% !important;
        width: 100% !important;
        overflow-x: hidden;
    }
}

/* =====================
   QUILL EDITOR
   ===================== */
.noticia-content, .servico-content, .ql-editor {
    word-wrap: break-word;
}

.ql-align-center { text-align: center; }
.ql-align-right { text-align: right; }
.ql-align-justify { text-align: justify; }

.ql-indent-1 { padding-left: 3em; }
.ql-indent-2 { padding-left: 6em; }
.ql-indent-3 { padding-left: 9em; }
.ql-indent-4 { padding-left: 12em; }
.ql-indent-5 { padding-left: 15em; }
.ql-indent-6 { padding-left: 18em; }
.ql-indent-7 { padding-left: 21em; }
.ql-indent-8 { padding-left: 24em; }

.noticia-content img, .servico-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 12px;
}

.noticia-content ul, .servico-content ul,
.noticia-content ol, .servico-content ol {
    padding-left: 20px;
    margin-bottom: 25px;
}

.noticia-content li, .servico-content li {
    margin-bottom: 10px;
}

.noticia-content blockquote, .servico-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: var(--text-muted);
}

.noticia-content pre, .servico-content pre {
    background: #1e293b;
    color: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    font-family: monospace;
    margin: 20px 0;
}

/* --- DARK MODE ADJUSTMENTS FOR QUILL & INPUTS --- */
body.dark-mode .ql-toolbar.ql-snow {
    background: #1e293b;
    border-color: var(--glass-border);
}

body.dark-mode .ql-container.ql-snow {
    border-color: var(--glass-border);
    background: #0f172a;
    color: #f1f5f9;
}

body.dark-mode .ql-snow .ql-stroke {
    stroke: #94a3b8;
}

body.dark-mode .ql-snow .ql-fill {
    fill: #94a3b8;
}

body.dark-mode .ql-snow .ql-picker {
    color: #94a3b8;
}

body.dark-mode .ql-snow.ql-toolbar button:hover .ql-stroke,
body.dark-mode .ql-snow.ql-toolbar button:hover .ql-fill,
body.dark-mode .ql-snow.ql-toolbar button.ql-active .ql-stroke,
body.dark-mode .ql-snow.ql-toolbar button.ql-active .ql-fill {
    stroke: var(--primary);
    fill: var(--primary);
}

body.dark-mode input, 
body.dark-mode textarea, 
body.dark-mode select {
    background-color: var(--bg-input) !important;
    color: var(--text-dark) !important;
    border-color: var(--glass-border) !important;
}

body.dark-mode input::placeholder, 
body.dark-mode textarea::placeholder {
    color: #475569;
}

/* =====================
   COOKIE CONSENT BANNER (UX PRO MASTER)
   ===================== */
.cookie-consent {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    width: calc(100% - 40px);
    max-width: 600px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 25px 35px;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    opacity: 0;
}

.cookie-consent.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.cookie-content {
    flex: 1;
}

.cookie-content h4 {
    color: var(--text-dark);
    margin-bottom: 8px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cookie-content h4 i {
    color: #f59e0b;
    filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.5));
}

.cookie-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.cookie-content a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    border-bottom: 1px solid transparent;
    transition: 0.3s;
}

.cookie-content a:hover {
    border-color: var(--primary);
}

.cookie-actions {
    display: flex;
    gap: 12px;
}

.cookie-btn {
    padding: 12px 25px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-accept {
    background: var(--primary);
    color: #0f172a; /* Contraste Máximo (Acessibilidade) */
    border: none;
    box-shadow: 0 8px 15px var(--primary-glow);
}

.btn-accept:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 20px var(--primary-glow), 0 0 15px var(--primary);
}

.btn-decline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
}

.btn-decline:hover {
    background: rgba(239, 68, 68, 0.05);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

@media (max-width: 768px) {
    .cookie-consent {
        flex-direction: column;
        text-align: center;
        padding: 25px;
        bottom: 20px;
        gap: 20px;
    }
    
    .cookie-actions {
        width: 100%;
        justify-content: center;
    }

    .cookie-btn {
        flex: 1;
    }
}
/* =====================
   PREMIUM HOME V2
   ===================== */
.home-featured-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 60px;
}

.featured-main-card {
    position: relative;
    border-radius: 35px;
    overflow: hidden;
    height: 520px;
    border: 1px solid var(--glass-border);
    transition: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.featured-main-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 40px 80px -15px rgba(37, 99, 235, 0.35);
    border-color: var(--primary);
}

.featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 80px 40px 40px 40px;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.98) 0%, rgba(15, 23, 42, 0.6) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.sidebar-news-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-news-item {
    background: var(--glass);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 12px;
    display: flex;
    gap: 15px;
    align-items: center;
    transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    color: inherit;
}

.sidebar-news-item:hover {
    background: var(--bg-card);
    transform: translateX(12px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.mesh-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.5;
    background: radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.12) 0px, transparent 50%),
                radial-gradient(at 100% 100%, rgba(96, 165, 250, 0.12) 0px, transparent 50%),
                radial-gradient(at 0% 100%, rgba(16, 185, 129, 0.05) 0px, transparent 40%);
    pointer-events: none;
}

@media (max-width: 1024px) {
    .home-featured-grid {
        grid-template-columns: 1fr;
    }
    .featured-main-card {
        height: 400px;
    }
}
