/* CSS Moderno para Calculadora Financeira */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette - Blue/Emerald Financial Theme */
    --primary-h: 210;
    --primary-s: 100%;
    --primary-l: 45%;
    --primary: hsl(var(--primary-h), var(--primary-s), var(--primary-l));
    --primary-dark: hsl(var(--primary-h), var(--primary-s), 35%);
    --primary-light: hsl(var(--primary-h), var(--primary-s), 95%);

    --secondary: #10b981;
    /* Emerald */
    --accent: #f59e0b;
    /* Amber */

    --bg-main: #f8fafc;
    --bg-card: #ffffff;

    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-on-primary: #ffffff;

    --border: #e2e8f0;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

    --max-width: 1100px;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

ul {
    list-style: none;
}

/* Common Layout */
.container {
    width: 90%;
    max-width: var(--max-width);
    margin: 0 auto;
}

header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a:hover {
    color: var(--primary);
}

main {
    flex: 1;
    padding: 3rem 0;
}

footer {
    background: #0f172a;
    color: #f1f5f9;
    padding: 3rem 0 1.5rem;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-col h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #fff;
}

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col ul li a {
    color: #cbd5e1;
}

.footer-col ul li a:hover {
    color: #fff;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid #1e293b;
    font-size: 0.875rem;
    color: #94a3b8;
}

/* Reusable Components */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    background: var(--primary);
    color: var(--text-on-primary);
}

.btn:hover {
    background: var(--primary-dark);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.grid-calculators {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate {
    animation: fadeIn 0.5s ease forwards;
}

/* Explanation & FAQ Sections */
.content-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.content-section h2 {
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.explanation-text {
    color: var(--text-main);
    font-size: 1.05rem;
    max-width: 800px;
}

.explanation-text p {
    margin-bottom: 1rem;
}

.faq-container {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.faq-item {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.faq-item h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--primary);
}

.faq-item p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Enhancements */
.chart-container {
    margin-top: 3rem;
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.table-responsive {
    margin-top: 2rem;
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    max-height: 500px;
    /* Enable vertical scroll for long tables */
    position: relative;
    background: white;
}

.table-responsive table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-responsive th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8fafc;
    color: var(--text-main);
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--primary);
}

.table-responsive td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    color: var(--text-main);
}

.table-responsive tr:last-child td {
    border-bottom: none;
}

.table-responsive tr:hover {
    background: #f1f5f9;
}

.table-responsive td:not(:first-child),
.table-responsive th:not(:first-child) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Specific styling for the index column */
.table-responsive td:first-child {
    font-weight: 600;
    color: var(--text-muted);
    width: 60px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .grid-calculators {
        grid-template-columns: 1fr;
    }

    .content-section {
        margin-top: 2.5rem;
    }
}