: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 */
}

.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 */
}

/* Formulário de Login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 100px - 300px); /* Ajustado para top-bar e rodapé */
    background-color: #ffffff; /* Fundo branco */
    padding: 2rem 0;
    z-index: 1;
}

.login-card {
    background: var(--card-background);
    border-radius: 16px;
    padding: 3rem;
    border: 1px solid #e5e7eb; /* Borda sutil */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 450px; /* Ligeiramente maior */
    text-align: center;
    animation: cardFadeIn 0.5s ease-in-out;
    transition: background 0.3s ease;
}

.login-card:hover {
    background: linear-gradient(135deg, #f8fafc, #e5e7eb); /* Gradiente leve no hover */
}

@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-title {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 2rem;
    position: relative;
}

.login-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--light-blue)); /* Gradiente azul */
    border-radius: 2px;
}

.login-content {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-group i {
    position: absolute;
    left: 0.8rem;
    color: #6b7280; /* Cinza médio */
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

.login-content input {
    width: 100%;
    padding: 0.9rem 0.9rem 0.9rem 2.5rem; /* Espaço para ícone */
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    color: #1f2937;
    background-color: #f8fafc;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.login-content input:focus {
    border-color: var(--light-blue);
    box-shadow: inset 0 0 5px rgba(59, 130, 246, 0.3); /* Sombra interna */
}

.login-content input:focus + i {
    color: var(--light-blue); /* Ícone azul no foco */
}

.login-content .btn-login {
    padding: 0.9rem;
    background: linear-gradient(90deg, var(--primary-color), var(--light-blue)); /* Gradiente */
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.3s ease, transform 0.3s ease;
}

.login-content .btn-login:hover {
    background: linear-gradient(90deg, var(--light-blue), var(--secondary-color)); /* Gradiente no hover */
    transform: scale(1.02); /* Leve escala */
}

.login-content .btn-login i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.login-content .btn-login:hover i {
    transform: translateX(3px); /* Deslocamento do ícone */
}

.forgot-password {
    color: var(--light-blue);
    font-size: 0.9rem;
    font-weight: 400;
    text-decoration: none;
    margin-top: 0.5rem;
    display: inline-block;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

.forgot-password:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* 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;
}

/* Flash Messages */
.flash-message {
    position: fixed;
    top: 140px;
    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-message.flash-error {
    background: #f8d7da;
    color: #721c24;
}

.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-message.flash-error .flash-close {
    color: #721c24;
}

.flash-close:hover {
    color: #0c3c16;
}

.flash-message.flash-logout .flash-close:hover {
    color: #4d1619;
}

.flash-message.flash-error .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;
}

.flash-message.flash-error .flash-progress {
    background: #dc3545;
}

@keyframes progress {
    0% { width: 0; }
    100% { width: 100%; }
}

/* Responsividade */
@media (max-width: 1024px) {
    .login-container {
        min-height: calc(100vh - 80px - 300px);
    }
}

@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);
    }

    .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;
    }

    .login-container {
        padding: 1rem 0;
        min-height: calc(100vh - 80px - 200px); /* Ajustado para top-bar e rodapé */
    }

    .login-card {
        padding: 2rem;
        max-width: 90%;
    }

    .login-title {
        font-size: 1.8rem;
    }

    .login-title::after {
        width: 50px;
        height: 3px;
    }

    .input-group i {
        font-size: 1rem;
        left: 0.7rem;
    }

    .login-content input {
        padding: 0.7rem 0.7rem 0.7rem 2.2rem;
        font-size: 0.9rem;
    }

    .login-content .btn-login {
        padding: 0.8rem;
        font-size: 1rem;
    }

    .forgot-password {
        font-size: 0.85rem;
    }

    .rodape {
        padding: 2rem 1rem;
        background: #1f2937; /* Cinza mais escuro */
    }

    .rodape-conteudo {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }

    .contatos, .mapa {
        width: 100%;
        text-align: center;
    }

    .contatos h3, .mapa h3 {
        font-size: 1.4rem;
    }

    .contatos p {
        font-size: 0.9rem;
    }

    .mapa iframe {
        height: 200px;
    }

    .rodape-copy {
        font-size: 0.85rem;
    }

    .flash-message {
        top: 100px;
        font-size: 0.8rem;
        padding: 0.8rem 2rem 0.8rem 0.8rem;
        max-width: 90%;
    }

    .flash-close {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .login-title {
        font-size: 1.6rem;
    }

    .login-content input {
        font-size: 0.85rem;
        padding: 0.6rem 0.6rem 0.6rem 2rem;
    }

    .input-group i {
        font-size: 0.9rem;
        left: 0.6rem;
    }

    .login-content .btn-login {
        padding: 0.7rem;
        font-size: 0.9rem;
    }

    .forgot-password {
        font-size: 0.8rem;
    }
}