:root {
    --primary-color: #1e3a8a; /* Azul escuro moderno */
    --secondary-color: #22d3ee; /* Ciano vibrante */
    --accent-color: #f97316; /* Laranja para destaque */
    --card-background: #ffffff; /* Fundo dos cartões */
    --text-color: #1f2937; /* Cor do texto (cinza escuro para contraste com fundo branco) */
    --light-blue: #3b82f6; /* Azul original para destaques */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: #ffffff; /* Fundo branco */
    color: var(--text-color);
    line-height: 1.6;
}

/* Cabeçalho */
.top-bar {
    min-height: 100px; /* Altura reduzida */
    padding: 0 1rem;
    background: rgba(255, 255, 255, 0.9); /* Fundo branco semi-transparente */
    backdrop-filter: blur(10px); /* Efeito blur */
    -webkit-backdrop-filter: blur(10px); /* Suporte para navegadores WebKit */
    color: var(--text-color);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative; /* Para suportar posicionamento absoluto de .top-links */
}

.top-bar .login-box {
    display: none;
    background: #ffffff;
    padding: 1rem;
    width: 300px;
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 10;
    border-top: none;
}

.top-bar .login-box.active {
    display: block;
}

.top-bar .login-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
}

.top-bar .login-content input {
    padding: 0.15rem;
    border: none;
    border-radius: 0;
    font-size: 0.9rem;
    color: var(--text-color);
    width: 80%;
    background-color: #f1f5f9;
}

.top-bar .login-content .btn-login {
    padding: 0.15rem 0.5rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 40%;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.top-bar .login-content .btn-login:hover {
    background-color: var(--secondary-color);
}

.top-bar .login-content .btn-login::after {
    content: " >";
    margin-left: 0.5rem;
    transition: content 0.3s ease;
}

.top-bar .login-content .btn-login:hover::after {
    content: " →";
}

.top-bar .login-content hr {
    width: 80%;
    border: 0;
    border-bottom: 1px solid var(--primary-color);
    margin: 0.3rem 0;
}

.logo-container {
    height: 100px; /* Altura ajustada */
    display: flex;
    align-items: center;
    padding: 0 1rem;
    background: transparent;
}

.logo-img {
    height: 80px; /* Tamanho reduzido */
    width: auto;
    object-fit: contain;
    margin: 0;
}

.right-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding-right: 1rem;
}

.language-switcher {
    height: 30px;
    display: flex;
    align-items: center;
}

.language-switcher input[type="checkbox"] {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 70px;
    height: 30px;
    background: #ffffff; /* Fundo branco */
    border: 1px solid #d1d5db; /* Borda cinza claro */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Sombra leve */
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
    cursor: pointer;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.toggle-switch .toggle-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); /* Sombra para legibilidade */
    transition: color 0.3s ease;
    z-index: 2;
}

.toggle-switch .toggle-text.pt {
    margin-left: 6px;
}

.toggle-switch .toggle-text.en {
    margin-right: 6px;
}

.toggle-switch .toggle-slider {
    position: absolute;
    width: 28px;
    height: 26px;
    background: #6b7280; /* Cinza médio */
    border-radius: 13px;
    transition: transform 0.3s ease;
    left: 2px;
}

.language-switcher input:checked + .toggle-switch .toggle-slider {
    transform: translateX(40px);
}

.language-switcher input:checked + .toggle-switch .toggle-text.pt {
    color: var(--primary-color);
}

.language-switcher input:checked + .toggle-switch .toggle-text.en {
    color: white;
}

.language-switcher input:not(:checked) + .toggle-switch .toggle-text.pt {
    color: white;
}

.language-switcher input:not(:checked) + .toggle-switch .toggle-text.en {
    color: var(--primary-color);
}

.toggle-switch:hover {
    background: #e5e7eb; /* Cinza claro no hover */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); /* Sombra mais forte no hover */
}

.site-link {
    margin-top: 8px;
}

.site-link a {
    color: var(--text-color); /* Preto */
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600; /* Negrito, igual aos top-links */
    transition: color 0.3s ease;
}

.site-link a:hover {
    color: var(--light-blue); /* Azul */
}

.top-links {
    display: flex;
    gap: 1.2rem; /* Espaçamento reduzido */
    padding: 0.5rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Centralização exata */
}

.top-links a {
    color: var(--text-color); /* Preto */
    text-decoration: none !important;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: color 0.3s ease;
}

.top-links a:hover, .top-links a.active {
    color: var(--light-blue); /* Azul */
}

/* Carrossel */
.hero {
    height: 500px; /* Altura ajustada */
    position: relative;
    overflow: hidden;
}

.image-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    z-index: 0;
    transition: opacity 0.8s ease-in-out; /* Transição suave de fade */
}

.background-image.active {
    opacity: 1;
    z-index: 1;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #ffffff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease;
    z-index: 10;
}

.carousel-btn.prev {
    left: 20px;
}

.carousel-btn.next {
    right: 20px;
}

.carousel-btn i {
    font-size: 1.2rem;
    color: var(--text-color);
}

.carousel-btn:hover {
    background: var(--light-blue);
}

.carousel-btn:hover i {
    color: white;
}

.image-container:hover .carousel-btn {
    opacity: 1;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    padding: 2rem;
    z-index: 2; /* Garante que a overlay fique acima das imagens */
}

.overlay h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.overlay p {
    font-size: 1.2rem;
    max-width: 600px;
}

/* Departamentos e Chamados */
.departamentos-container {
    padding: 4rem 2rem;
    background: #ffffff;
    text-align: center;
}

.subtitle {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 3rem;
}

.content-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.departamentos-column {
    flex: 1;
    min-width: 300px;
    max-width: 600px;
}

.departamentos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    justify-items: center;
}

.card {
    background: var(--card-background);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    color: #1f2937;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 280px;
    animation: cardFadeIn 0.5s ease-in-out;
}

@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary-color) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover::before {
    opacity: 0.3;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.card.disabled {
    pointer-events: auto;
    cursor: not-allowed;
    opacity: 0.6;
}

.card-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    height: 80px;
}

.card-icon img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.card-icon i {
    font-size: 40px;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.card:hover .card-icon img {
    transform: scale(1.1);
}

.card:hover .card-icon i {
    color: var(--secondary-color);
}

.card h3 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card p {
    color: #6b7280;
    font-size: 0.95rem;
}

/* Estilos Específicos para Caixinhas de Unidades */
.card.unidade {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.card.unidade .card-icon i {
    font-size: 36px;
}

/* Tabela de Chamados */
.chamados-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem auto;
    background: var(--card-background);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden;
    max-width: 1200px;
}

.chamados-table th, .chamados-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.chamados-table th {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.chamados-table tr:hover {
    background: #f8fafc;
}

.chamados-table .toggle-descricao {
    cursor: pointer;
    color: var(--secondary-color);
    font-weight: 500;
    transition: color 0.3s ease;
}

.chamados-table .toggle-descricao:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.descricao {
    display: none;
    background: #f1f5f9;
}

.descricao.show {
    display: table-row;
}

.descricao td {
    padding: 1.5rem;
    color: #1f2937;
    font-size: 1rem;
    line-height: 1.8;
}

/* Botão Voltar */
.btn-back {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.3s ease, transform 0.3s ease;
    margin: 1rem 0;
}

.btn-back:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
}

.btn-back i {
    margin-right: 0.5rem;
}

/* Rodapé */
.rodape {
    background: #1f2937; /* Cinza mais escuro */
    color: white;
    padding: 4rem 2rem;
}

.rodape-conteudo {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto 2rem;
}

.contatos, .mapa {
    flex: 1;
    min-width: 300px;
    margin: 1rem;
}

.contatos h3, .mapa h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.contatos p {
    font-size: 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.contatos i {
    color: var(--secondary-color);
}

.mapa iframe {
    height: 300px;
}

.rodape-copy {
    text-align: center;
    font-size: 0.9rem;
    border-top: 1px solid #4b5563; /* Cinza claro */
    padding-top: 1rem;
}

/* Mensagem de Login Necessário */
.login-message {
    display: none;
    position: fixed;
    top: 140px; /* Ajustado para a altura da top-bar */
    left: 50%;
    transform: translateX(-50%);
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    z-index: 1000;
    max-width: 400px;
}

/* Flash Messages */
.flash-message {
    position: fixed;
    top: 140px; /* Ajustado para a altura da top-bar */
    left: 50%;
    transform: translateX(-50%);
    background: #d4edda;
    color: #155724;
    padding: 1rem 2.5rem 1rem 1rem;
    margin: 1rem 0;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    z-index: 1000;
}

.flash-message.flash-logout {
    background: #f8d7da;
    color: #721c24;
}

.flash-message.flash-success {
    background: #d4edda;
    color: #155724;
}

.flash-content {
    flex-grow: 1;
}

.flash-close {
    background: none;
    border: none;
    color: #155724;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.5rem;
}

.flash-message.flash-logout .flash-close {
    color: #721c24;
}

.flash-close:hover {
    color: #0c3c16;
}

.flash-message.flash-logout .flash-close:hover {
    color: #4d1619;
}

.flash-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: #28a745;
    width: 0;
}

.flash-message.flash-logout .flash-progress {
    background: #dc3545;
}

@keyframes progress {
    0% { width: 0; }
    100% { width: 100%; }
}

/* Responsividade */
@media (max-width: 1024px) {
    .hero {
        height: 400px;
    }

    .content-row {
        flex-direction: column;
        align-items: center;
    }

    .departamentos-column {
        width: 100%;
    }

    .departamentos {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    body {
        background-color: #ffffff; /* Fundo branco */
    }

    .top-bar {
        min-height: 80px; /* Altura reduzida */
        padding: 0 0.5rem;
        background: rgba(255, 255, 255, 0.9); /* Fundo branco semi-transparente */
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .top-bar .login-box {
        padding: 0.8rem;
        width: 250px;
        top: 100%;
        right: 0;
        background: #ffffff;
    }

    .top-bar .login-content input {
        padding: 0.1rem;
        font-size: 0.7rem;
        width: 80%;
    }

    .top-bar .login-content .btn-login {
        padding: 0.1rem 0.3rem;
        font-size: 0.7rem;
        width: 40%;
    }

    .logo-container {
        height: 80px;
        background: transparent;
    }

    .logo-img {
        height: 60px;
    }

    .right-container {
        padding-right: 0.5rem;
    }

    .language-switcher {
        height: 26px;
    }

    .toggle-switch {
        width: 60px;
        height: 26px;
        background: #ffffff; /* Fundo branco */
        border: 1px solid #d1d5db; /* Borda cinza claro */
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Sombra leve */
        border-radius: 13px;
    }

    .toggle-switch .toggle-text {
        font-size: 0.7rem;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); /* Sombra para legibilidade */
    }

    .toggle-switch .toggle-slider {
        width: 24px;
        height: 22px;
        background: #6b7280; /* Cinza médio */
        border-radius: 11px;
    }

    .language-switcher input:checked + .toggle-switch .toggle-slider {
        transform: translateX(34px);
    }

    .toggle-switch:hover {
        background: #e5e7eb; /* Cinza claro no hover */
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); /* Sombra mais forte no hover */
    }

    .site-link {
        margin-top: 6px;
    }

    .site-link a {
        font-size: 0.8rem;
        font-weight: 600; /* Negrito, igual aos top-links */
    }

    .top-links {
        gap: 0.8rem; /* Espaçamento reduzido */
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%); /* Centralização exata */
    }

    .top-links a {
        font-size: 0.7rem;
    }

    .carousel-btn {
        width: 36px;
        height: 36px;
    }

    .carousel-btn i {
        font-size: 1rem;
    }

    .hero {
        height: 300px;
    }

    .overlay h2 {
        font-size: 1.8rem;
    }

    .overlay p {
        font-size: 1rem;
    }

    .departamentos-container {
        padding: 2rem 1rem;
    }

    .departamentos {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1rem;
    }

    .card {
        width: 220px;
        padding: 1.5rem;
    }

    .card h3 {
        font-size: 1.4rem;
    }

    .card p {
        font-size: 0.9rem;
    }

    .card-icon i {
        font-size: 32px;
    }

    .card.unidade .card-icon i {
        font-size: 28px;
    }

    .chamados-table th, .chamados-table td {
        font-size: 0.85rem;
        padding: 0.8rem;
    }

    .btn-back {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .login-message {
        max-width: 90%;
        padding: 1rem;
        top: 100px;
    }

    .login-message p {
        font-size: 0.9rem;
    }

    .btn-login {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .flash-message {
        font-size: 0.8rem;
        padding: 0.8rem 2rem 0.8rem 0.8rem;
        max-width: 90%;
        top: 100px;
    }

    .flash-close {
        font-size: 0.9rem;
    }

    .rodape {
        padding: 2rem 1rem;
        background: #1f2937; /* Cinza mais escuro */
    }

    .mapa iframe {
        height: 200px;
    }
}