:root {
    /* Brand Colors */
    --prime-orange: #F37021;
    --prime-orange-hover: #D95F17;
    
    /* Light Mode Colors */
    --bg-main: #f8fafc; /* Off-white for overall background */
    --bg-card: #ffffff; /* Pure white for cards */
    --text-main: #1e293b; /* Dark slate for main text */
    --text-muted: #64748b; /* Lighter slate for secondary text */
    --border-color: #e2e8f0;
    
    /* UI Elements - Solid Cards */
    --glass-bg: #ffffff;
    --glass-border: #e2e8f0;
    --glass-shadow: 0 4px 16px 0 rgba(30, 41, 59, 0.05);
    
    /* Transitions */
    --transition-fast: 0.2s ease-in-out;
    --transition-med: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #ffffff;
    background-image: url('../assets/Fundo%20de%20imagem%20Prime.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
    /* Correção para navegadores mobile (Safari/Chrome no Android e iOS) */
    min-height: 100dvh;
}
html {
    /* Evita que o site quebre no Safari do iPhone */
    height: -webkit-fill-available;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-main);
}

.highlight {
    color: var(--prime-orange);
}

/* Views Management */
.view {
    display: none;
    opacity: 0;
    transition: opacity var(--transition-med);
    min-height: 100vh;
}

.view.active {
    display: flex;
    flex-direction: column;
    opacity: 1;
}

/* ========================================= */
/* SHARED UI COMPONENTS                      */
/* ========================================= */

.bg-main {
    background-color: var(--bg-main);
}

.glass-effect {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
}

/* Buttons */
button {
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all var(--transition-fast);
    font-weight: 600;
    border-radius: 8px;
}

.btn-primary {
    background-color: var(--prime-orange);
    color: #fff;
    padding: 10px 24px;
    font-size: 1rem;
    box-shadow: 0 4px 6px rgba(243, 112, 33, 0.2);
}

.btn-primary:hover {
    background-color: var(--prime-orange-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(243, 112, 33, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    padding: 8px 16px;
}

.btn-secondary:hover {
    color: var(--text-main);
    background: rgba(30, 41, 59, 0.05);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--prime-orange);
    color: var(--prime-orange);
    padding: 10px 24px;
}

.btn-outline:hover {
    background: var(--prime-orange);
    color: #fff;
}

.btn-large {
    padding: 14px 32px;
    font-size: 1.1rem;
}

.btn-full {
    width: 100%;
    padding: 12px;
}

.btn-link {
    background: transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 16px;
    text-decoration: underline;
}

.btn-link:hover {
    color: var(--prime-orange);
}

/* Animations */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInAnimation 0.8s ease forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }

@keyframes fadeInAnimation {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================= */
/* LANDING PAGE                              */
/* ========================================= */

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 5%;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    transition: all var(--transition-fast);
}

.logo-container .logo {
    height: 40px;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    gap: 32px;
    align-items: center;
}

.nav-link-item {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: color var(--transition-fast);
    position: relative;
    padding: 8px 0;
}

.nav-link-item:hover, .nav-link-item.active {
    color: var(--prime-orange);
}

.nav-link-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--prime-orange);
    transition: width var(--transition-fast);
}

.nav-link-item:hover::after, .nav-link-item.active::after {
    width: 100%;
}

.hero {
    margin-top: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 100px 5%;
    background: #0f172a;
    overflow: hidden;
    min-height: 480px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    z-index: 2;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 100vh;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 1;
    filter: brightness(1.2);
}

.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    max-width: 800px;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 24px;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.hero-content p {
    font-size: 1.2rem;
    color: #e2e8f0;
    margin-bottom: 0;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
}

/* Sections for PDF content */
.section-container {
    padding: 80px 5%;
    text-align: center;
}

.section-container h2 {
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: var(--text-main);
}

.section-container h2 span {
    color: var(--prime-orange);
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.info-card {
    background: var(--bg-card);
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    transition: transform var(--transition-fast);
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.info-card h3 {
    font-size: 1.25rem;
    margin-bottom: 16px;
    color: var(--prime-orange);
}

.info-card p {
    color: var(--text-muted);
    line-height: 1.6;
}

/* Numbers Section */
.numbers-section {
    background: var(--prime-orange);
    color: white;
    padding: 20px 5%;
}

.numbers-section h2 {
    color: white;
    font-size: 1.6rem;
    margin-bottom: 12px;
    text-align: center;
}

.numbers-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.number-item {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.number-item h3 {
    font-size: 2rem;
    margin-bottom: 4px;
    color: white;
}

.number-item p {
    font-size: 0.9rem;
    font-weight: 500;
}

footer {
    text-align: center;
    padding: 40px 24px;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
}

/* ========================================= */
/* LOGIN PORTAL                              */
/* ========================================= */

.login-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    text-align: center;
    background: var(--bg-card);
}

.logo-large {
    height: 60px;
    margin-bottom: 24px;
}

.login-card h2 {
    margin-bottom: 8px;
    font-size: 1.5rem;
}

.login-card .subtitle {
    color: var(--text-muted);
    margin-bottom: 32px;
    font-size: 0.9rem;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 1rem;
    transition: border-color var(--transition-fast);
}

.input-group input:focus {
    outline: none;
    border-color: var(--prime-orange);
    background: #fff;
}

.error-message {
    color: #ef4444;
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: none;
    text-align: left;
}

/* ========================================= */
/* DASHBOARD                                 */
/* ========================================= */

.dashboard-layout {
    display: flex;
    height: 100vh;
    background-color: var(--bg-main);
}

.sidebar {
    width: 280px;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    z-index: 10;
}

.sidebar-header {
    padding: 32px 24px;
}

.logo-small {
    height: 32px;
}

.nav-links {
    list-style: none;
    flex: 1;
    padding: 0 16px;
}

.nav-links li {
    margin-bottom: 8px;
}

.nav-links a {
    display: block;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.nav-links a:hover, .nav-links li.active a {
    background: rgba(243, 112, 33, 0.1);
    color: var(--prime-orange);
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid var(--border-color);
}

.dashboard-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 40px;
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 5;
}

.dashboard-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--prime-orange);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.dashboard-content {
    padding: 40px;
    flex: 1;
}

.welcome-card {
    padding: 32px;
    max-width: 600px;
    background: var(--bg-card);
}

.welcome-card h3 {
    margin-bottom: 12px;
    font-size: 1.5rem;
}

.welcome-card p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* Responsiveness */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .dashboard-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-links {
        display: flex;
        overflow-x: auto;
        padding: 16px;
        gap: 8px;
    }
    
    .sidebar-footer {
        display: none;
    }
    
    /* Navbar responsive */
    .navbar {
        padding: 12px 5% !important;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
    }
    .nav-menu {
        order: 3;
        width: 100%;
        justify-content: center;
        gap: 16px;
        margin-top: 8px;
    }
    .logo-container {
        flex: 1;
        text-align: left;
    }
    .nav-actions {
        flex: 0;
        text-align: right;
    }
    .hero {
        margin-top: 130px;
    }
    
    /* Contact grid responsive */
    .contact-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
}

/* Calculator Responsive Grids */
.calc-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.calc-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.calc-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

@media (max-width: 900px) {
    .calc-grid-5 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .calc-grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }
    .calc-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .calc-grid-3 {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header {
        padding: 16px 20px;
    }
    
    .dashboard-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .calc-grid-5 {
        grid-template-columns: 1fr;
    }
    .calc-grid-4 {
        grid-template-columns: 1fr;
    }
}

.print-only-header {
    display: none;
}

/* ========================================= */
/* PRINT & EXPORT STYLES                     */
/* ========================================= */
@media print {
    @page { size: landscape; margin: 5mm; }
    
    body { background: #fff !important; background-image: none !important; color: #000 !important; }
    .sidebar, .dashboard-header, .navbar, .hero, .section-container, footer, .print-btn, .export-btn, .btn-primary, #calc-breakdown-btn-container { display: none !important; }
    .dashboard-layout, .dashboard-main, .dashboard-content { display: block !important; height: auto !important; overflow: visible !important; padding: 0 !important; margin: 0 !important; }
    .glass-effect { box-shadow: none !important; border: none !important; background: transparent !important; padding: 0 !important; }
    .print-only-header { grid-column: 1 / 3; display: flex !important; justify-content: space-between; align-items: center; margin-bottom: 10px; border-bottom: 2px solid var(--prime-orange); padding-bottom: 5px; }
    
    #calc-content {
        display: grid !important;
        grid-template-columns: 4fr 6fr; /* 40% left, 60% right */
        column-gap: 20px;
        row-gap: 15px;
        page-break-inside: avoid;
    }
    
    #calc-results {
        display: contents !important; /* Makes children participate in the #calc-content grid */
    }
    
    #calc-inputs { grid-column: 1; grid-row: 2; }
    #calc-main-result { grid-column: 1; grid-row: 3; margin-bottom: 0 !important; font-size: 0.8rem !important; padding: 10px !important; }
    #print-other-periods-group { grid-column: 1; grid-row: 4; }
    
    #calc-breakdown-container { grid-column: 2; grid-row: 2 / 4; display: block !important; background: transparent !important; box-shadow: none !important; border: 1px solid #ccc !important; padding: 10px !important; margin-bottom: 0 !important; font-size: 0.75rem !important; height: 100%; }
    #print-chart-group { grid-column: 2; grid-row: 4; }

    #calc-chart-wrapper { height: 150px !important; margin-top: 5px; page-break-inside: avoid; }
    .calc-grid-5 { grid-template-columns: repeat(2, 1fr) !important; gap: 5px !important; margin-bottom: 5px !important; }
    .calc-grid-4 { grid-template-columns: repeat(2, 1fr) !important; gap: 5px !important; margin-bottom: 5px !important; }
    h4 { margin-bottom: 5px !important; padding-bottom: 2px !important; font-size: 0.85rem !important; }
    .info-card { padding: 5px !important; }
}

}
