/* =========================================
   CALCULADORAS FINANCEIRAS - CSS PRINCIPAL
   ========================================= */

/* Base Styles */
:root {
    --primary-color: #0066cc;
    --secondary-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 0.5rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --transition: all 0.15s ease-in-out;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #fff;
}

/* Focus States for Accessibility */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, 
.form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--primary-color);
}

/* Home Page Styles */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #004499 100%);
    color: white;
    padding: 4rem 0;
    margin-bottom: 3rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.25rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
}

/* Calculator Cards */
.calculators-section {
    padding: 3rem 0;
}

.calculator-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    height: 100%;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border: 1px solid #e9ecef;
}

.calculator-card:hover {
    transform: translateY(-0.25rem);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.calculator-card .card-icon {
    background: linear-gradient(45deg, var(--primary-color), #0052a3);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.calculator-card h3 {
    color: var(--dark-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.calculator-card p {
    color: #6c757d;
    margin-bottom: 1.5rem;
}

.card-features ul {
    list-style: none;
    padding: 0;
    margin-bottom: 1.5rem;
}

.card-features li {
    padding: 0.25rem 0;
    color: #6c757d;
    font-size: 0.95rem;
}

.card-features li::before {
    content: '✓';
    color: var(--secondary-color);
    font-weight: bold;
    margin-right: 0.5rem;
}

/* Benefits Section */
.benefits-section {
    background-color: var(--light-color);
    padding: 4rem 0;
}

.benefit-item {
    text-align: center;
    padding: 1.5rem;
}

.benefit-item i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.benefit-item h4 {
    margin-bottom: 1rem;
    color: var(--dark-color);
}

/* FAQ Section */
.faq-section {
    padding: 4rem 0;
}

.faq-item {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-left: 4px solid var(--primary-color);
    background-color: #f8f9fa;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.faq-item h4 {
    color: var(--dark-color);
    margin-bottom: 0.75rem;
}

/* Calculator Form Styles */
.calculator-container {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-control {
    border-radius: var(--border-radius);
    border: 1px solid #ced4da;
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.25);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: var(--border-radius);
    padding: 0.75rem 2rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #004085;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    transition: var(--transition);
}

/* Results Table */
.results-section {
    margin-top: 3rem;
}

.table-responsive {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.table th {
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
    padding: 1rem 0.75rem;
}

.table td {
    padding: 0.875rem 0.75rem;
    border-top: 1px solid #dee2e6;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 102, 204, 0.03);
}

/* Summary Cards */
.summary-cards {
    margin-bottom: 2rem;
}

.summary-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--box-shadow);
    border-left: 4px solid var(--primary-color);
}

.summary-card.success {
    border-left-color: var(--secondary-color);
}

.summary-card.warning {
    border-left-color: var(--warning-color);
}

.summary-card.info {
    border-left-color: var(--info-color);
}

.summary-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.summary-label {
    color: #6c757d;
    font-size: 0.95rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Alerts and Notifications */
.alert {
    border-radius: var(--border-radius);
    border: none;
    margin-bottom: 1.5rem;
}

.alert-info {
    background-color: #e3f2fd;
    color: #0d47a1;
    border-left: 4px solid var(--info-color);
}

.alert-warning {
    background-color: #fff3e0;
    color: #e65100;
    border-left: 4px solid var(--warning-color);
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2rem;
    height: 2rem;
    border: 0.2rem solid #f3f3f3;
    border-top: 0.2rem solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0;
    }
    
    .calculator-card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .benefits-section,
    .faq-section {
        padding: 3rem 0;
    }
    
    .summary-cards .col-md-3 {
        margin-bottom: 1rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .breadcrumb,
    footer,
    .btn {
        display: none !important;
    }
    
    .calculator-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Core Web Vitals Optimizations */
.hero-section-small {
    background: linear-gradient(135deg, var(--primary-color) 0%, #004499 100%);
    color: white;
    padding: 2.5rem 0;
    margin-bottom: 2rem;
}

.hero-section-small .display-5 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .hero-section-small .display-5 {
        font-size: 2rem;
    }
}

/* Performance Optimizations */
.info-section {
    background-color: var(--light-color);
    padding: 2rem 0;
    margin-top: 2rem;
}

.info-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
    height: 100%;
    margin-bottom: 1.5rem;
}

.info-card h5 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.info-card ul {
    list-style: none;
    padding: 0;
}

.info-card li {
    padding: 0.25rem 0;
    color: #6c757d;
}

.info-card li::before {
    content: '→';
    color: var(--primary-color);
    font-weight: bold;
    margin-right: 0.5rem;
}

/* Enhanced Responsive Grid */
@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .calculator-container {
        padding: 1.5rem 1rem;
    }
    
    .summary-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .summary-value {
        font-size: 1.5rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
}

/* Enhanced Focus States */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 102, 204, 0.15);
    outline: none;
}

.btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Smooth Animations */
.calculator-card,
.summary-card,
.info-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.calculator-card:hover,
.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.15);
}

/* Chart Container Optimization */
#rendaChart {
    max-height: 400px;
    width: 100%;
}

/* Progress Bars Enhancement */
.progress {
    height: 0.75rem;
    border-radius: var(--border-radius);
    overflow: hidden;
    background-color: #e9ecef;
}

.progress-bar {
    transition: width 0.6s ease;
    border-radius: var(--border-radius);
}

/* Enhanced Badge Styles */
.badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.5rem;
    border-radius: var(--border-radius);
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Dark Mode Support (Disabled - keeping light theme only) */
/* 
@media (prefers-color-scheme: dark) {
    // Dark mode styles removed to prevent layout issues
    // Can be re-enabled later when properly tested
}
*/

/* Utility Classes */
.text-gradient {
    background: linear-gradient(45deg, var(--primary-color), #0052a3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-sm {
    box-shadow: var(--box-shadow) !important;
}

.rounded-custom {
    border-radius: var(--border-radius) !important;
}

.required::after {
    content: " *";
    color: var(--danger-color);
}

/* Performance: Reduce repaints */
.container,
.row,
.col {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Navbar Dropdown Z-index Fix */
.navbar .dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
}

.navbar .dropdown-menu.show {
    z-index: 9999 !important;
}

/* Garantir que o navbar tenha contexto de empilhamento adequado */
.navbar {
    position: relative;
    z-index: 1030;
}

/* Garante que dropdowns do Bootstrap sempre apareçam por cima */
.dropdown-menu {
    z-index: 9999 !important;
}