/* CSS Reset & Variables */
:root {
    --bg-color: #ffffff;
    --card-bg: #f2fcf5;
    /* Mint cream for cards */
    --text-primary: #1f2328;
    --text-secondary: #57606a;
    --accent-primary: #1a7f37;
    /* Stronger green for text */
    --accent-secondary: #4ac26b;
    /* Vibrant green for accents */
    --gradient-brand: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    --border-color: #d8dee4;
    --font-main: 'Outfit', sans-serif;
    --header-height: 80px;
    --header-height-mobile: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
#main-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: #ffffff;
    backdrop-filter: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
}

#main-header.scrolled {
    height: 70px;
}

@media (max-width: 768px) {
    #main-header {
        height: var(--header-height-mobile);
    }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    padding: 5px 0;
}

.logo img {
    height: 50px;
    /* Ajuste de altura */
    width: auto;
    /* Blend mode ajuda a "sumir" com o fundo branco da imagem se o header também for branco */
    mix-blend-mode: multiply;
    transition: transform 0.3s;
}

.logo img:hover {
    transform: scale(1.05);
}

nav ul {
    display: flex;
    gap: 30px;
}

nav a {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Hamburger Menu Icon */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1100;
}

.mobile-menu-btn span {
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 10px;
    transition: all 0.3s ease;
}

nav a:hover {
    color: var(--text-primary);
}

.btn-login {
    background: var(--gradient-brand);
    padding: 10px 24px;
    border-radius: 50px;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(88, 166, 255, 0.3);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(88, 166, 255, 0.4);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding-top: var(--header-height);
    background: url('assets/hero_bg.png') no-repeat center center/cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(13, 17, 23, 0.7), var(--bg-color));
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
}

.gradient-text {
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-color);
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 600;
}

.btn-primary:hover {
    background: white;
    transform: translateY(-2px);
}

.btn-outline {
    border: 2px solid var(--border-color);
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
}

.btn-outline:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Sections General */
.section {
    padding: 100px 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 60px;
    text-align: center;
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.service-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-5px);
}

.card-image {
    height: 60px;
    margin-bottom: 20px;
}

.card-image img {
    height: 100%;
    width: auto;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.service-card p {
    color: var(--text-secondary);
    margin-bottom: 25px;
    flex-grow: 1;
}

.link-arrow {
    color: var(--accent-primary);
    font-weight: 600;
}

.link-arrow:hover {
    color: var(--accent-secondary);
}

/* News Section */
.section-dark {
    background-color: #eafbf0;
    /* Very light green background */
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 50px;
}

.view-all {
    color: var(--accent-primary);
    font-weight: 600;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.news-card {
    background: var(--bg-color);
    /* Slightly lighter than section-dark */
    padding: 25px;
    border-radius: 12px;
    border-left: 4px solid var(--accent-secondary);
}

.news-date {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.news-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.news-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Footer */
footer {
    padding: 80px 0 30px;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 50px;
    margin-bottom: 60px;
}

.footer-brand h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.footer-brand p {
    color: var(--text-secondary);
}

.footer-links h4,
.footer-social h4 {
    margin-bottom: 20px;
    color: white;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-secondary);
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.social-icons {
    display: flex;
    gap: 20px;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    #main-header {
        padding: 0 10px;
    }

    .mobile-menu-btn {
        display: flex;
    }

    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: #fff;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: 0.4s ease;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        z-index: 1050;
    }

    nav.active {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        gap: 40px;
        text-align: center;
    }

    nav a {
        font-size: 1.2rem;
    }

    .btn-login {
        margin-top: 20px;
    }

    /* Hamburger Animation */
    .mobile-menu-btn.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn-primary,
    .btn-outline {
        width: 100%;
        max-width: 300px;
    }

    .section {
        padding: 60px 0;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 40px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }

    .social-icons {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .services-grid,
    .news-grid {
        grid-template-columns: 1fr;
    }
}

/* Password Toggle Styles */
.password-container {
    position: relative;
    width: 100%;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.6;
    transition: 0.3s;
    user-select: none;
}

.password-toggle:hover {
    opacity: 1;
    color: var(--accent-primary);
}

/* Login Page Styles */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('assets/hero_bg.png') no-repeat center center/cover;
    position: relative;
    padding: 20px;
}

.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    /* Overlay para suavizar o fundo */
    backdrop-filter: blur(5px);
}

.login-wrapper {
    background: var(--bg-color);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
    border: 1px solid var(--border-color);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-link img {
    height: 60px;
    margin-bottom: 10px;
    mix-blend-mode: multiply;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: var(--font-main);
    font-size: 1rem;
    transition: 0.3s;
    background: var(--card-bg);
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 3px rgba(74, 194, 107, 0.1);
    background: #fff;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 25px;
}

.forgot-password {
    font-size: 0.85rem;
    color: var(--accent-primary);
}

.btn-login-submit {
    width: 100%;
    padding: 14px;
    background: var(--gradient-brand);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
}

.btn-login-submit:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(74, 194, 107, 0.3);
}

.login-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.login-footer a {
    color: var(--text-secondary);
}

.login-footer a:hover {
    color: var(--accent-primary);
}

/* Dashboard Styles */
.dashboard-body {
    background-color: var(--card-bg);
    overflow: hidden;
    /* Evita scroll duplo se o sidebar for full height */
}

.dashboard-container {
    display: flex;
    height: 100vh;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: #ffffff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    z-index: 1000;
}

/* Dashboard Table Styles (Moved out of sidebar) */
.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--accent-primary);
    padding-bottom: 10px;
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.data-grid-container table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9rem;
}

.data-grid-container th,
.data-grid-container td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

.data-grid-container th {
    background-color: #f2f2f2;
    color: #333;
    font-weight: 600;
}

.data-grid-container tr:nth-child(even) {
    background-color: #f9f9f9;
}

.data-grid-container tr:hover {
    background-color: #f1f1f1;
}

.sidebar-header {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
}

.sidebar-header img {
    height: 40px;
    width: auto;
}

.sidebar-nav ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-btn {
    width: 100%;
    text-align: left;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 8px;
    transition: 0.3s;
}

.nav-btn:hover {
    background-color: var(--card-bg);
    color: var(--accent-primary);
}

.nav-btn.active {
    background-color: rgba(35, 134, 54, 0.1);
    color: var(--accent-primary);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.btn-logout {
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px;
    color: var(--text-secondary);
    font-weight: 600;
    transition: 0.3s;
}

.btn-logout:hover {
    color: #cf222e;
    /* User alert color */
}

/* Main Content */
.main-content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Dashboard Mobile Header (New) */
.db-mobile-header {
    display: none;
    height: 60px;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 999;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.content-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

.current-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Dashboard Sections */
.dashboard-section {
    display: none;
    flex-grow: 1;
    animation: fadeIn 0.3s ease;
}

.dashboard-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    height: 100%;
    min-height: 400px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.section-card h3 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: var(--accent-primary);
}

.placeholder-text {
    color: var(--text-secondary);
    font-style: italic;
}

/* Dashboard Dashboard Specific Responsive */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .db-mobile-header {
        display: flex;
    }

    .main-content {
        padding: 20px;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .section-card {
        padding: 20px;
    }

    .kpi-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    /* Overlay when sidebar is open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }

    .sidebar-overlay.active {
        display: block;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 15px;
    }

    .kpi-value {
        font-size: 1.4rem;
    }

    .content-header h2 {
        font-size: 1.5rem;
    }
}