:root {
    --primary-blue: #2563eb;
    --primary-dark: #1d4ed8;
    --success-green: #059669;
    --warning-amber: #d97706;
    --danger-red: #dc2626;
    --accent-purple: #7c3aed;
    --accent-teal: #0d9488;
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-secondary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --divider: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.08);
    --shadow-lg: rgba(0, 0, 0, 0.12);
    --border-radius: 16px;
    --border-radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    padding-bottom: 100px; /* Aumentado para evitar corte */
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-purple) 50%, var(--accent-teal) 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 4px 20px var(--shadow-lg);
   
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    gap: 20px;
}

.header-left {
    flex-shrink: 0;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.header-right {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.header-content h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* Logo Container */
.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: white;
    padding: 4px;
}

.header-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.logo-text h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.logo-subtitle {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.selic-display {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.15);
    padding: 12px 20px;
    border-radius: 25px;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.selic-display:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.selic-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.selic-rate {
    font-weight: bold;
    font-size: 1.1rem;
}

.update-btn,
.toggle-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: transform 0.2s;
}

.update-btn:hover {
    transform: rotate(180deg);
}

.toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.toggle-btn span {
    white-space: nowrap;
}

.update-btn.loading {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

main {
    padding: 30px 0;
    margin-bottom: 20px;
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.card {
    background: var(--surface);
    border-radius: var(--border-radius);
    padding: 28px;
    box-shadow: 0 4px 20px var(--shadow);
    margin-bottom: 24px;
    border: 1px solid var(--divider);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-purple));
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px var(--shadow-lg);
}

.card h2 {
    margin-bottom: 24px;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.card h3 {
    margin-bottom: 16px;
    color: var(--primary-blue);
    font-size: 1.3rem;
}

.card h4 {
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.legal-disclaimer {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%);
    border: 2px solid var(--warning-amber);
    border-radius: var(--border-radius-sm);
    padding: 20px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    color: var(--warning-amber);
    position: relative;
    overflow: hidden;
}

.legal-disclaimer::before {
    content: '⚖️';
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 3rem;
    opacity: 0.1;
    transform: rotate(15deg);
}

.legal-disclaimer p {
    margin: 0 0 12px 0;
    line-height: 1.6;
    font-weight: 500;
}

.legal-disclaimer p:last-child {
    margin-bottom: 0;
}

.legal-link {
    color: var(--warning-amber);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 2px 6px;
    border-radius: 4px;
}

.legal-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.2);
    text-decoration: underline;
}

/* Estilos para seções de termos e privacidade */
.terms-section {
    margin-bottom: 32px;
    padding: 24px;
    background: var(--surface-secondary);
    border-radius: var(--border-radius-sm);
    border-left: 4px solid var(--accent-teal);
    position: relative;
}

.terms-section:last-child {
    margin-bottom: 0;
}

.terms-section h3 {
    color: var(--accent-teal);
    margin-bottom: 16px;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.terms-section h3::before {
    content: '📋';
    font-size: 1.2rem;
}

.terms-section h4 {
    color: var(--primary-blue);
    margin: 20px 0 12px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.terms-section p {
    margin-bottom: 16px;
    line-height: 1.6;
    color: var(--text-primary);
}

.terms-section ul {
    margin: 16px 0;
    padding-left: 20px;
}

.terms-section li {
    margin-bottom: 8px;
    line-height: 1.5;
    color: var(--text-primary);
}

.terms-section strong {
    color: var(--accent-purple);
    font-weight: 600;
}

/* Estilos específicos para diferentes tipos de seções */
.terms-section:nth-child(odd) {
    border-left-color: var(--primary-blue);
}

.terms-section:nth-child(odd) h3 {
    color: var(--primary-blue);
}

.terms-section:nth-child(3n) {
    border-left-color: var(--accent-purple);
}

.terms-section:nth-child(3n) h3 {
    color: var(--accent-purple);
}

/* Hover effects para seções */
.terms-section:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 15px var(--shadow);
    transition: all 0.3s ease;
}

.legal-disclaimer p {
    margin: 0;
    line-height: 1.5;
}

.calculation-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 100%;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    width: 100%;
}

.form-group label {
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.form-group input,
.form-group select {
    padding: 14px;
    border: 2px solid var(--divider);
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    transition: all 0.3s ease;
    background: var(--surface);
    color: var(--text-primary);
    font-weight: 500;
    width: 100%;
    min-height: 48px;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
    z-index: 1;
    position: relative;
}

.form-group input:hover,
.form-group select:hover {
    border-color: var(--primary-blue);
    background: var(--surface-secondary);
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary-blue);
    color: white;
}

.btn-primary:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(33, 150, 243, 0.3);
}

.btn-secondary {
    background: var(--success-green);
    color: white;
}

.btn-secondary:hover {
    background: #388E3C;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(76, 175, 80, 0.3);
}

.btn-danger {
    background: var(--danger-red);
    color: white;
}

.btn-danger:hover {
    background: #D32F2F;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(244, 67, 54, 0.3);
}

.results-container {
    margin-top: 24px;
    margin-bottom: 20px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    margin: 10px 0;
    background: var(--surface-secondary);
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--divider);
    transition: all 0.3s ease;
}

.result-item:hover {
    background: var(--surface);
    transform: translateX(4px);
    box-shadow: 0 4px 15px var(--shadow);
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.result-value {
    font-weight: bold;
    font-size: 1.1rem;
}

.result-value.positive {
    color: var(--success-green);
}

.result-value.negative {
    color: var(--danger-red);
}

.result-value.warning {
    color: var(--warning-amber);
}

.comparison-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px solid var(--divider);
}

.comparison-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.comparison-item {
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}

.comparison-item.better {
    background: rgba(76, 175, 80, 0.1);
    border: 2px solid var(--success-green);
}

.comparison-item.worse {
    background: rgba(244, 67, 54, 0.1);
    border: 2px solid var(--danger-red);
}

.comparison-title {
    font-weight: bold;
    margin-bottom: 8px;
}

.comparison-value {
    font-size: 1.2rem;
    font-weight: bold;
}

.history-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 16px;
}

.history-list {
    display: grid;
    gap: 16px;
}

.history-item {
    background: var(--surface);
    padding: 20px;
    border-radius: var(--border-radius-sm);
    border-left: 4px solid var(--primary-blue);
    border: 1px solid var(--divider);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.history-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.02), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.history-item:hover::before {
    transform: translateX(100%);
}

.history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow);
    border-color: var(--primary-blue);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.history-title {
    font-weight: bold;
    color: var(--text-primary);
}

.history-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.history-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
    font-size: 0.9rem;
}

.history-detail {
    display: flex;
    justify-content: space-between;
}

.no-data {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 40px;
}

.faq-container {
    display: grid;
    gap: 12px;
}

.faq-item {
    border: 1px solid var(--divider);
    border-radius: 8px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    padding: 20px;
    background: var(--surface-secondary);
    border: none;
    text-align: left;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
}

.faq-question:hover {
    background: var(--surface);
    transform: translateX(4px);
    box-shadow: 0 4px 15px var(--shadow);
}

.faq-question:hover {
    background: var(--divider);
}

.faq-question[aria-expanded="true"] {
    background: var(--primary-blue);
    color: white;
}

.faq-question[aria-expanded="true"] .faq-icon {
    transform: rotate(45deg);
}

.faq-icon {
    transition: transform 0.3s;
    font-weight: bold;
}

.faq-answer {
    padding: 16px;
    background: var(--surface);
    border-top: 1px solid var(--divider);
}

.faq-answer[hidden] {
    display: none;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--divider);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    border-radius: var(--border-radius-sm);
    min-width: 70px;
    position: relative;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid transparent;
}

.nav-item.active {
    color: var(--primary-blue);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(124, 58, 237, 0.2));
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25);
    border: 1px solid rgba(37, 99, 235, 0.3);
}

.nav-item:hover {
    color: var(--primary-blue);
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(37, 99, 235, 0.15);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 25px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-purple));
    border-radius: 2px;
    animation: slideInDown 0.3s ease-out;
    transition: all 0.3s ease;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.nav-item i {
    font-size: 1.3rem;
    margin-bottom: 4px;
    transition: all 0.3s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.nav-item span {
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: all 0.3s ease;
}

.nav-item.active i {
    font-size: 1.4rem;
    filter: drop-shadow(0 2px 4px rgba(37, 99, 235, 0.3));
}

.nav-item.active span {
    font-weight: 700;
    color: var(--primary-blue);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background: var(--primary-blue);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

footer {
    text-align: center;
    padding: 24px 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: var(--surface);
    border-top: 1px solid var(--divider);
    margin-top: 40px;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-main {
    margin-bottom: 16px;
}

.footer-main p {
    margin: 0;
    font-weight: 500;
    color: var(--text-primary);
}

.footer-links {
   
    justify-content: center;
    align-items: center;
    gap: 8px;
   
}

.footer-links a {
    display: inline-block;
    padding: 10px 16px;
    background-color: #b6cbec; /* cor do botão */
    color: #000000;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease, transform 0.2s ease;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 4px 8px;
    border-radius: 4px;
}

.footer-link:hover {
    color: var(--primary-blue);
    background: rgba(37, 99, 235, 0.1);
}

.footer-separator {
    color: var(--divider);
    font-weight: 300;
}

.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius-sm);
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    border-left: 4px solid;
    animation: slideInRight 0.5s ease-out;
}

.alert.success {
    background: rgba(76, 175, 80, 0.1);
    color: var(--success-green);
    border: 1px solid var(--success-green);
}

.alert.error {
    background: rgba(244, 67, 54, 0.1);
    color: var(--danger-red);
    border: 1px solid var(--danger-red);
}

.alert.warning {
    background: rgba(255, 193, 7, 0.1);
    color: #F57C00;
    border: 1px solid var(--warning-amber);
}

.alert.info {
    background: rgba(33, 150, 243, 0.1);
    color: var(--primary-blue);
    border: 1px solid var(--primary-blue);
}

/* Estilos para mensagens de erro nos campos */
.field-error {
    color: var(--danger-red);
    font-size: 0.85rem;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.field-error::before {
    content: "⚠️";
    font-size: 0.8rem;
}

.form-group input.error,
.form-group select.error {
    border-color: var(--danger-red);
    background-color: rgba(244, 67, 54, 0.05);
}

.form-group input.error:focus,
.form-group select.error:focus {
    border-color: var(--danger-red);
    box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.2);
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 16px;
    }

    .logo-container {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .header-logo {
        width: 50px;
        height: 50px;
    }

    .logo-text h1 {
        font-size: 1.4rem;
    }

    .logo-subtitle {
        font-size: 0.8rem;
    }

    .header-content h1 {
        font-size: 1.4rem;
    }

    .header-right {
        gap: 8px;
    }

    .toggle-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .selic-display {
        padding: 10px 16px;
        gap: 8px;
    }

    .comparison-card {
        grid-template-columns: 1fr;
    }

    .history-details {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 20px;
        margin-bottom: 20px;
        border-radius: 12px;
    }

    .form-group {
        margin-bottom: 18px;
    }
    
    .form-group input,
    .form-group select {
        padding: 12px;
        min-height: 44px;
    }

    .btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    main {
        padding: 20px 0;
    }
    
    .legal-disclaimer {
        padding: 16px;
        font-size: 0.85rem;
        margin-bottom: 20px;
    }
    
    .terms-section {
        padding: 20px;
        margin-bottom: 24px;
    }
    
    .terms-section h3 {
        font-size: 1.2rem;
    }
    
    .terms-section h4 {
        font-size: 1rem;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 12px;
    }
    
    .footer-separator {
        display: none;
    }
    
    .container {
        padding: 0 16px;
    }
    
    .result-item {
        padding: 16px;
        margin: 8px 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .result-label {
        font-size: 0.9rem;
    }
    
    .result-value {
        font-size: 1rem;
        align-self: flex-end;
    }
    
    .comparison-section {
        margin-top: 20px;
        padding-top: 20px;
    }
    
    .comparison-item {
        padding: 14px;
    }
    
    .results-container {
        margin-top: 20px;
        margin-bottom: 16px;
    }
    
    .history-controls {
        margin-bottom: 12px;
    }
    
    .history-list {
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }

    .header-content {
        padding: 0 12px;
    }

    .logo-container {
        gap: 0.3rem;
    }

    .header-logo {
        width: 45px;
        height: 45px;
    }

    .logo-text h1 {
        font-size: 1.2rem;
    }

    .logo-subtitle {
        font-size: 0.75rem;
    }

    .header-right {
        gap: 6px;
    }

    .toggle-btn {
        padding: 5px 8px;
        font-size: 0.75rem;
    }

    .toggle-btn span {
        display: none;
    }

    .selic-display {
        gap: 6px;
        text-align: center;
        padding: 10px;
    }

    .nav-item span {
        font-size: 0.75rem;
    }
    
    .nav-item i {
        font-size: 1.2rem;
    }
    
    .bottom-nav {
        padding: 10px 0;
    }
    
    .nav-item {
        padding: 10px 12px;
        min-width: 60px;
    }
    
    .nav-item.active::before {
        width: 18px;
        height: 2px;
    }
    
    .nav-item.active::after {
        width: 4px;
        height: 4px;
        bottom: 4px;
    }
    
    .card {
        padding: 16px;
        border-radius: 10px;
        margin-bottom: 16px;
    }
    
    .legal-disclaimer {
        padding: 14px;
        font-size: 0.8rem;
        margin-bottom: 16px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-group input,
    .form-group select {
        padding: 12px;
        font-size: 14px;
        min-height: 44px;
    }
    
    .form-group label {
        margin-bottom: 6px;
        font-size: 0.85rem;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 14px;
        width: 100%;
    }
    
    .header-content h1 {
        font-size: 1.2rem;
    }
    
    .selic-display {
        font-size: 0.85rem;
    }
    
    .selic-rate {
        font-size: 0.95rem;
    }
    
    .update-btn {
        padding: 6px;
        font-size: 0.85rem;
    }
    
    .card h2 {
        font-size: 1.2rem;
        margin-bottom: 16px;
    }
    
    .card h3 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .card h4 {
        font-size: 0.95rem;
        margin-bottom: 8px;
    }
    
    main {
        padding: 16px 0;
    }
    
    body {
        padding-bottom: 90px;
    }
}

@media (max-width: 360px) {
    .container {
        padding: 0 8px;
    }
    
    .header-content {
        padding: 0 8px;
    }
    
    .card {
        padding: 12px;
        border-radius: 8px;
    }
    
    .legal-disclaimer {
        padding: 12px;
        font-size: 0.75rem;
    }
    
    .form-group {
        margin-bottom: 14px;
    }
    
    .form-group input,
    .form-group select {
        padding: 10px;
        font-size: 13px;
        min-height: 40px;
    }
    
    .form-group label {
        margin-bottom: 5px;
        font-size: 0.8rem;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .header-content h1 {
        font-size: 1.1rem;
    }
    
    .selic-display {
        padding: 8px;
        font-size: 0.8rem;
    }
    
    .selic-rate {
        font-size: 0.9rem;
    }
    
    .nav-item {
        padding: 8px 10px;
        min-width: 55px;
    }
    
    .nav-item span {
        font-size: 0.7rem;
    }
    
    .nav-item i {
        font-size: 1.1rem;
    }
    
    .bottom-nav {
        padding: 8px 0;
    }
    
    body {
        padding-bottom: 85px;
    }
    
    .result-item {
        padding: 12px;
        margin: 6px 0;
        gap: 6px;
    }
    
    .result-label {
        font-size: 0.8rem;
    }
    
    .result-value {
        font-size: 0.9rem;
    }
    
    .results-container {
        margin-top: 16px;
        margin-bottom: 12px;
    }
    
    .comparison-section {
        margin-top: 16px;
        padding-top: 16px;
    }
    
    .comparison-item {
        padding: 10px;
    }
    
    .history-controls {
        margin-bottom: 10px;
    }
    
    .history-list {
        gap: 10px;
    }
    
    .calculation-form {
        gap: 16px;
    }
    
    .card {
        margin-bottom: 12px;
    }
}

@media (max-width: 320px) {
    .container {
        padding: 0 6px;
    }
    
    .header-content {
        padding: 0 6px;
    }
    
    .card {
        padding: 10px;
        border-radius: 6px;
        margin-bottom: 10px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group input,
    .form-group select {
        padding: 8px;
        font-size: 12px;
        min-height: 36px;
    }
    
    .form-group label {
        margin-bottom: 4px;
        font-size: 0.75rem;
    }
    
    .btn {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .legal-disclaimer {
        padding: 10px;
        font-size: 0.75rem;
        margin-bottom: 12px;
    }
    
    .calculation-form {
        gap: 12px;
    }
    
    .header-content h1 {
        font-size: 1rem;
    }
    
    .selic-display {
        padding: 6px;
        font-size: 0.75rem;
    }
    
    .selic-rate {
        font-size: 0.85rem;
    }
    
    .nav-item {
        padding: 6px 8px;
        min-width: 50px;
    }
    
    .nav-item span {
        font-size: 0.65rem;
    }
    
    .nav-item i {
        font-size: 1rem;
    }
    
    .bottom-nav {
        padding: 6px 0;
    }
    
    body {
        padding-bottom: 80px;
    }
    
    .demo-section {
        padding: 16px;
        margin-bottom: 20px;
    }
    
    .demo-section h3 {
        font-size: 1rem;
    }
}

/* Estilos para a página de demo */
.demo-section {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--surface-secondary);
    border-radius: var(--border-radius-sm);
    border-left: 4px solid var(--primary-blue);
}

.demo-section h3 {
    color: var(--primary-blue);
    margin-bottom: 12px;
    font-size: 1.1rem;
}

.demo-section p {
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.demo-section ul,
.demo-section ol {
    margin-left: 20px;
    color: var(--text-secondary);
}

.demo-section li {
    margin-bottom: 6px;
}

.demo-section strong {
    color: var(--text-primary);
}

/* Melhorias para dispositivos móveis */
@media (max-height: 600px) and (orientation: landscape) {
    .card {
        padding: 20px;
        margin-bottom: 16px;
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-group input,
    .form-group select {
        min-height: 40px;
        padding: 10px;
    }
    
    .legal-disclaimer {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    main {
        padding: 20px 0;
    }
    
    .header-content h1 {
        font-size: 1.3rem;
    }
    
    .selic-display {
        padding: 8px 16px;
    }
}

/* Tema Escuro */
.theme-dark {
    --background: #0f172a;
    --surface: #1e293b;
    --surface-secondary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --divider: #475569;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-lg: rgba(0, 0, 0, 0.4);
}

/* Tema Claro - Expandido e Abrangente */
.theme-light {
    --background: #ffffff;
    --surface: #f3f3f3;
    --surface-secondary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --divider: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.05);
    --shadow-lg: rgba(0, 0, 0, 0.08);
}

/* Aplicação do Tema Escuro */
.theme-dark .card {
    border-color: var(--divider);
    background: var(--surface);
    box-shadow: 0 4px 20px var(--shadow-lg);
}

.theme-dark .form-group input,
.theme-dark .form-group select {
    background: var(--surface-secondary);
    color: var(--text-primary);
    border-color: var(--divider);
}

.theme-dark .result-item {
    background: var(--surface-secondary);
    border-color: var(--divider);
}

.theme-dark .legal-disclaimer {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.15) 0%, rgba(255, 193, 7, 0.1) 100%);
    border-color: var(--warning-amber);
}

.theme-dark .bottom-nav {
    background: rgba(30, 41, 59, 0.95);
    border-top-color: var(--divider);
}

.theme-dark .nav-item {
    background: rgba(0, 0, 0, 0.1);
}

.theme-dark .nav-item:hover {
    background: rgba(37, 99, 235, 0.15);
}

.theme-dark .nav-item.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.25), rgba(124, 58, 237, 0.25));
    border-color: rgba(37, 99, 235, 0.4);
}

/* Aplicação do Tema Claro - Expandido */
.theme-light .card {
    background: var(--surface);
    border: 1px solid var(--divider);
    box-shadow: 0 2px 10px var(--shadow);
}

.theme-light .form-group input,
.theme-light .form-group select {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--divider);
    box-shadow: 0 1px 3px var(--shadow);
}

.theme-light .form-group input:focus,
.theme-light .form-group select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.theme-light .form-group label {
    color: var(--text-secondary);
    font-weight: 600;
}

.theme-light .result-item {
    background: var(--surface);
    border: 1px solid var(--divider);
    box-shadow: 0 2px 8px var(--shadow);
}

.theme-light .result-item:hover {
    box-shadow: 0 4px 15px var(--shadow-lg);
    transform: translateY(-2px);
}

.theme-light .legal-disclaimer {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.08) 0%, rgba(255, 193, 7, 0.05) 100%);
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.theme-light .legal-disclaimer p {
    color: var(--text-secondary);
}

.theme-light .legal-disclaimer strong {
    color: var(--text-primary);
}

.theme-light .legal-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
}

.theme-light .legal-link:hover {
    text-decoration: underline;
}

.theme-light .bottom-nav {
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid var(--divider);
    backdrop-filter: blur(20px);
}

.theme-light .nav-item {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.theme-light .nav-item:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--text-primary);
    border-color: rgba(37, 99, 235, 0.2);
}

.theme-light .nav-item.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(124, 58, 237, 0.15));
    color: var(--primary-blue);
    border-color: rgba(37, 99, 235, 0.3);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.theme-light .nav-item i {
    color: var(--text-secondary);
}

.theme-light .nav-item.active i {
    color: var(--primary-blue);
}

.theme-light .btn {
    box-shadow: 0 2px 4px var(--shadow);
}

.theme-light .btn:hover {
    box-shadow: 0 4px 12px var(--shadow-lg);
    transform: translateY(-1px);
}

.theme-light .btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-dark));
    border: none;
    color: white;
}

.theme-light .btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-blue));
}

.theme-light .btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--divider);
}

.theme-light .btn-secondary:hover {
    background: var(--surface-secondary);
    border-color: var(--primary-blue);
}

.theme-light .faq-item {
    background: var(--surface);
    border: 1px solid var(--divider);
    box-shadow: 0 2px 6px var(--shadow);
}

.theme-light .faq-item:hover {
    box-shadow: 0 4px 12px var(--shadow-lg);
    border-color: var(--primary-blue);
}

.theme-light .faq-question {
    color: var(--text-primary);
    background: var(--surface-secondary);
}

.theme-light .faq-answer {
    background: var(--surface);
    color: var(--text-secondary);
}

.theme-light .history-item {
    background: var(--surface);
    border: 1px solid var(--divider);
    box-shadow: 0 2px 6px var(--shadow);
}

.theme-light .history-item:hover {
    box-shadow: 0 4px 12px var(--shadow-lg);
    border-color: var(--primary-blue);
}

.theme-light .history-date {
    color: var(--text-muted);
}

.theme-light .history-amount {
    color: var(--text-primary);
    font-weight: 600;
}

.theme-light .history-details {
    color: var(--text-secondary);
}

.theme-light .footer-content {
    background: var(--surface);
    border-top: 1px solid var(--divider);
}

.theme-light .footer-main p {
    color: var(--text-secondary);
}

.theme-light .footer-link {
    color: var(--text-secondary);
}

.theme-light .footer-link:hover {
    color: var(--primary-blue);
}

.theme-light .toggle-btn {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    border: 1px solid var(--divider);
    box-shadow: 0 2px 6px var(--shadow);
}

.theme-light .toggle-btn:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 4px 12px var(--shadow-lg);
    transform: translateY(-1px);
}

.theme-light .selic-display {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.theme-light .selic-display:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
}

.theme-light .update-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.theme-light .update-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Estilos adicionais para o tema claro */
.theme-light .demo-section {
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: var(--border-radius-sm);
    padding: 20px;
    margin-bottom: 20px;
}

.theme-light .demo-section h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
}

.theme-light .demo-section p {
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.theme-light .demo-section ul,
.theme-light .demo-section ol {
    color: var(--text-secondary);
    margin-left: 20px;
}

.theme-light .demo-section li {
    margin-bottom: 5px;
}

.theme-light .demo-section strong {
    color: var(--text-primary);
    font-weight: 600;
}

.theme-light .comparison-section {
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: var(--border-radius-sm);
    padding: 20px;
    margin-top: 20px;
}

.theme-light .comparison-section h4 {
    color: var(--text-primary);
    margin-bottom: 15px;
}

.theme-light .comparison-section p {
    color: var(--text-secondary);
}

.theme-light .comparison-section .highlight {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-blue);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.theme-light .form-section {
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px var(--shadow);
}

.theme-light .form-section h2 {
    color: var(--text-primary);
    margin-bottom: 25px;
}

.theme-light .form-section .form-row {
    border-bottom: 1px solid var(--divider);
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.theme-light .form-section .form-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.theme-light .alert {
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: var(--border-radius-sm);
    padding: 15px;
    margin: 15px 0;
    box-shadow: 0 2px 6px var(--shadow);
}

.theme-light .alert-success {
    background: rgba(5, 150, 105, 0.1);
    border-color: var(--success-green);
    color: var(--success-green);
}

.theme-light .alert-error {
    background: rgba(220, 38, 38, 0.1);
    border-color: var(--danger-red);
    color: var(--danger-red);
}

.theme-light .alert-warning {
    background: rgba(217, 119, 6, 0.1);
    border-color: var(--warning-amber);
    color: var(--warning-amber);
}

.theme-light .alert-info {
    background: rgba(37, 99, 235, 0.1);
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.theme-light .table {
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    box-shadow: 0 2px 6px var(--shadow);
}

.theme-light .table th {
    background: var(--surface-secondary);
    color: var(--text-primary);
    border-bottom: 1px solid var(--divider);
}

.theme-light .table td {
    color: var(--text-secondary);
    border-bottom: 1px solid var(--divider);
}

.theme-light .table tr:hover {
    background: var(--surface-secondary);
}

.theme-light .badge {
    background: var(--surface-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--divider);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.theme-light .badge-primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.theme-light .badge-success {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success-green);
    border-color: var(--success-green);
}

.theme-light .badge-warning {
    background: rgba(217, 119, 6, 0.1);
    color: var(--warning-amber);
    border-color: var(--warning-amber);
}

.theme-light .badge-danger {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger-red);
    border-color: var(--danger-red);
}

.theme-light .tooltip {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--divider);
    box-shadow: 0 4px 12px var(--shadow-lg);
}

.theme-light .modal {
    background: var(--surface);
    border: 1px solid var(--divider);
    box-shadow: 0 10px 30px var(--shadow-lg);
}

.theme-light .modal-header {
    background: var(--surface-secondary);
    border-bottom: 1px solid var(--divider);
}

.theme-light .modal-title {
    color: var(--text-primary);
}

.theme-light .modal-body {
    color: var(--text-secondary);
}

.theme-light .modal-footer {
    background: var(--surface-secondary);
    border-top: 1px solid var(--divider);
}

.theme-light .dropdown {
    background: var(--surface);
    border: 1px solid var(--divider);
    box-shadow: 0 4px 12px var(--shadow-lg);
}

.theme-light .dropdown-item {
    color: var(--text-secondary);
}

.theme-light .dropdown-item:hover {
    background: var(--surface-secondary);
    color: var(--text-primary);
}

.theme-light .progress {
    background: var(--surface-secondary);
    border: 1px solid var(--divider);
}

.theme-light .progress-bar {
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-purple));
}

.theme-light .spinner {
    border-color: var(--divider);
    border-top-color: var(--primary-blue);
}

/* Suporte para modo escuro (opcional) */
@media (prefers-color-scheme: dark) {
    :root {
        --background: #0f172a;
        --surface: #1e293b;
        --surface-secondary: #334155;
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-muted: #94a3b8;
        --divider: #475569;
    }
    
    .card {
        border-color: var(--divider);
    }
    
    .form-group input,
    .form-group select {
        background: var(--surface-secondary);
        color: var(--text-primary);
        border-color: var(--divider);
    }
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

.scale-in {
    animation: scaleIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animações para os resultados */
.result-item {
    animation: slideInRight 0.5s ease-out;
    animation-fill-mode: both;
}

.result-item:nth-child(1) { animation-delay: 0.1s; }
.result-item:nth-child(2) { animation-delay: 0.2s; }
.result-item:nth-child(3) { animation-delay: 0.3s; }
.result-item:nth-child(4) { animation-delay: 0.4s; }
.result-item:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.installment-details {
    margin-top: 24px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(124, 58, 237, 0.05) 100%);
    border-radius: var(--border-radius-sm);
    border-left: 4px solid var(--primary-blue);
    position: relative;
    overflow: hidden;
}

.installment-details::before {
    content: '💳';
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2rem;
    opacity: 0.1;
}

.installment-details h4 {
    color: var(--primary-blue);
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 600;
}

.installment-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}

.installment-table th,
.installment-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--divider);
}

.installment-table th {
    background: var(--background);
    font-weight: 600;
    color: var(--text-primary);
}

.installment-table td {
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .installment-table {
        font-size: 0.8rem;
    }
    
    .installment-table th,
    .installment-table td {
        padding: 6px 8px;
    }
}
