/**
 * Calculadora de Financiamento - Estilos
 * Sistema completo com Price, SAC e simulações
 */

.financing-calculator {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Roboto', sans-serif;
}

/* ===== HEADER ===== */
.calculator-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
    position: relative;
    overflow: hidden;
}

.calculator-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZGVmcz48cGF0dGVybiBpZD0iZ3JpZCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQwIiBwYXR0ZXJuVW5pdHM9InVzZXJTcGFjZU9uVXNlIj48cGF0aCBkPSJNIDQwIDAgTCAwIDAgMCA0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJyZ2JhKDI1NSwyNTUsMjU1LDAuMSkiIHN0cm9rZS13aWR0aD0iMSIvPjwvcGF0dGVybj48L2RlZnM+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0idXJsKCNncmlkKSIvPjwvc3ZnPg==') repeat;
    opacity: 0.1;
}

.calculator-header h2 {
    margin: 0 0 10px 0;
    font-size: 2.5rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.calculator-header p {
    margin: 0;
    font-size: 1.2rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* ===== TABS ===== */
.calculator-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 10px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 25px;
    border: 2px solid #e0e6ed;
    background: white;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.tab-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* ===== FORM ===== */
.financing-form {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.form-section h3 {
    color: #2d3748;
    margin: 0 0 25px 0;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.property-icon {
    font-size: 1.2rem;
}

.input-with-currency,
.input-with-symbol {
    position: relative;
    display: flex;
    align-items: center;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
}

.input-with-symbol input {
    border: none !important;
    padding: 15px !important;
    font-size: 1.2rem !important;
    width: 100% !important;
    outline: none !important;
    background: white !important;
    color: #000000 !important;
    font-weight: 700 !important;
    text-align: right !important;
}

.input-with-symbol input::placeholder {
    color: #999999 !important;
    opacity: 1 !important;
}

.input-with-currency:focus-within,
.input-with-symbol:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.currency,
.symbol {
    background: #f7fafc;
    padding: 15px;
    border-right: 1px solid #e2e8f0;
    font-weight: 600;
    color: #4a5568;
    min-width: 60px;
    text-align: center;
}

.currency-input,
.input-with-symbol input {
    border: none;
    padding: 15px;
    font-size: 1.1rem;
    width: 100%;
    outline: none;
    background: white !important;
    color: #000000 !important;
    font-weight: 700 !important;
}

.currency-input::placeholder,
.input-with-symbol input::placeholder {
    color: #999999 !important;
    opacity: 1 !important;
    font-weight: 400 !important;
}

.currency-input:focus,
.input-with-symbol input:focus {
    color: #000000 !important;
    font-weight: 800 !important;
    background: white !important;
}

/* ===== CORREÇÃO ESPECÍFICA PARA VISIBILIDADE DO TEXTO ===== */
#view-financing-calculator .input-group input,
#view-financing-calculator .input-with-symbol input,
#view-financing-calculator input[type="number"],
#financing-calculator .input-group input,
#financing-calculator .input-with-symbol input,
#financing-calculator input[type="number"] {
    color: #000000 !important;
    background: #ffffff !important;
    font-weight: 700 !important;
    font-size: 1.2rem !important;
    text-align: right !important;
    font-family: system-ui, -apple-system, sans-serif !important;
    -webkit-text-fill-color: #000000 !important;
    text-shadow: none !important;
    opacity: 1 !important;
}

#view-financing-calculator .input-group input::placeholder,
#view-financing-calculator .input-with-symbol input::placeholder,
#view-financing-calculator input[type="number"]::placeholder,
#financing-calculator .input-group input::placeholder,
#financing-calculator .input-with-symbol input::placeholder,
#financing-calculator input[type="number"]::placeholder {
    color: #888888 !important;
    opacity: 1 !important;
    -webkit-text-fill-color: #888888 !important;
}

#view-financing-calculator .input-group input:focus,
#view-financing-calculator .input-with-symbol input:focus,
#view-financing-calculator input[type="number"]:focus,
#financing-calculator .input-group input:focus,
#financing-calculator .input-with-symbol input:focus,
#financing-calculator input[type="number"]:focus {
    color: #000000 !important;
    background: #ffffff !important;
    -webkit-text-fill-color: #000000 !important;
    border-color: #667eea !important;
}

/* ===== INPUT SPECIFIC STYLES ===== */
#interest-rate,
#loan-months,
#property-value,
#down-payment {
    color: #000000 !important;
    font-weight: 700 !important;
    text-align: right;
    font-size: 1.2rem !important;
    background: #ffffff !important;
    -webkit-text-fill-color: #000000 !important;
    font-family: system-ui, -apple-system, sans-serif !important;
}

/* Forçar visibilidade com CSS adicional */
input#interest-rate,
input#loan-months,
input#property-value,
input#down-payment {
    color: #000000 !important;
    background-color: #ffffff !important;
    -webkit-text-fill-color: #000000 !important;
    text-shadow: 0 0 1px #000000 !important;
}

#interest-rate::placeholder,
#loan-months::placeholder,
#property-value::placeholder,
#down-payment::placeholder {
    color: #999999 !important;
    font-weight: 400 !important;
    text-align: right;
}

#interest-rate:focus,
#loan-months:focus,
#property-value:focus,
#down-payment:focus {
    color: #000000 !important;
    font-weight: 800 !important;
    background: rgba(102, 126, 234, 0.1) !important;
    border: 2px solid #667eea !important;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 768px) {
    .input-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

.input-help {
    display: block;
    margin-top: 5px;
    color: #718096;
    font-size: 0.9rem;
}

.percentage-display,
.years-display {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f7fafc;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #4a5568;
    text-align: center;
}

.rate-examples {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.rate-example {
    padding: 4px 10px;
    background: #edf2f7;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #4a5568;
}

.rate-example:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

.financed-amount {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    padding: 20px;
    border-radius: 12px;
    color: white;
    text-align: center;
    margin-top: 20px;
}

.financed-amount label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1rem;
    opacity: 0.9;
}

.amount-display {
    font-size: 2rem;
    font-weight: 700;
}

/* ===== CALCULATE BUTTON ===== */
.calculate-section {
    text-align: center;
    margin-top: 30px;
}

.calculate-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 18px 40px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.calculate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.calculate-btn:active {
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 1.3rem;
}

/* ===== RESULTS ===== */
.results-container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.results-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 10px;
    flex-wrap: wrap;
}

.result-tab {
    padding: 10px 20px;
    border: 2px solid #e0e6ed;
    background: white;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.result-tab:hover {
    border-color: #667eea;
    transform: translateY(-1px);
}

.result-tab.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

/* ===== COMPARISON VIEW ===== */
.comparison-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .comparison-cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.system-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border-left: 5px solid;
    transition: transform 0.3s ease;
}

.system-card:hover {
    transform: translateY(-5px);
}

.price-card {
    border-left-color: #4299e1;
    background: linear-gradient(135deg, rgba(66, 153, 225, 0.05) 0%, rgba(66, 153, 225, 0.02) 100%);
}

.sac-card {
    border-left-color: #48bb78;
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.05) 0%, rgba(72, 187, 120, 0.02) 100%);
}

.system-card h3 {
    margin: 0 0 20px 0;
    color: #2d3748;
    font-size: 1.3rem;
}

.card-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.card-metric:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.metric-label {
    color: #718096;
    font-size: 0.95rem;
}

.metric-value {
    font-weight: 700;
    color: #2d3748;
    font-size: 1.1rem;
}

/* ===== SAVINGS ANALYSIS ===== */
.savings-analysis {
    margin-top: 30px;
}

.savings-card {
    background: linear-gradient(135deg, #f6e05e 0%, #ecc94b 100%);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    color: #744210;
}

.savings-card h4 {
    margin: 0 0 15px 0;
    font-size: 1.3rem;
}

.savings-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.savings-value {
    font-weight: 700;
    font-size: 1.3rem;
}

.savings-percentage {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.recommendation {
    padding: 15px;
    border-radius: 8px;
    font-size: 1rem;
}

.recommendation.positive {
    background: rgba(72, 187, 120, 0.2);
    color: #22543d;
}

.recommendation.neutral {
    background: rgba(74, 85, 104, 0.2);
    color: #2d3748;
}

/* ===== DETAILED VIEWS ===== */
.system-summary {
    margin-bottom: 30px;
}

.system-summary h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.system-summary p {
    color: #718096;
    margin-bottom: 25px;
    line-height: 1.6;
}

.price-metrics,
.sac-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-box {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.metric-box:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.metric-title {
    display: block;
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-amount {
    display: block;
    color: #2d3748;
    font-size: 1.5rem;
    font-weight: 700;
}

/* ===== AMORTIZATION TABLE ===== */
.amortization-preview h4 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.amortization-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.amortization-table th {
    background: #667eea;
    color: white;
    padding: 15px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
}

.amortization-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9rem;
}

.amortization-table tr:hover {
    background: #f7fafc;
}

.show-full-table {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.show-full-table:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

/* ===== SIMULATION ===== */
.simulation-tools h3 {
    color: #2d3748;
    margin-bottom: 25px;
    font-size: 1.5rem;
}

.simulation-controls {
    background: #f7fafc;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.slider-group {
    margin-bottom: 25px;
}

.slider-group:last-child {
    margin-bottom: 0;
}

.slider-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #4a5568;
}

.slider-group input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
    outline: none;
    margin-bottom: 10px;
    appearance: none;
}

.slider-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.slider-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #718096;
}

.simulation-results {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.sim-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .sim-comparison {
        grid-template-columns: 1fr;
    }
}

.sim-card {
    background: #f7fafc;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.sim-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.sim-card h4 {
    margin: 0 0 15px 0;
    color: #4a5568;
    font-size: 1.1rem;
}

.sim-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 5px;
}

.sim-card small {
    color: #718096;
    font-size: 0.9rem;
}

.affordability-analysis {
    border-top: 2px solid #e2e8f0;
    padding-top: 25px;
}

.affordability-analysis h4 {
    color: #2d3748;
    margin-bottom: 20px;
}

.affordability-input {
    margin-bottom: 20px;
}

.affordability-input label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

.affordability-result {
    padding: 20px;
    border-radius: 10px;
    background: #f7fafc;
    border-left: 5px solid #667eea;
    line-height: 1.6;
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 12px 25px;
    border: 2px solid;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.save-btn {
    background: #48bb78;
    border-color: #48bb78;
    color: white;
}

.save-btn:hover {
    background: #38a169;
    border-color: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(72, 187, 120, 0.3);
}

.export-btn {
    background: #ed8936;
    border-color: #ed8936;
    color: white;
}

.export-btn:hover {
    background: #dd6b20;
    border-color: #dd6b20;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(237, 137, 54, 0.3);
}

.share-btn {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

.share-btn:hover {
    background: #5a67d8;
    border-color: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* ===== CALCULATOR TIPS ===== */
.calculator-tips {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.calculator-tips h3 {
    color: #2d3748;
    margin-bottom: 25px;
    font-size: 1.5rem;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.tip-card {
    background: #f7fafc;
    border-radius: 12px;
    padding: 25px;
    border-left: 5px solid #667eea;
}

.tip-card h4 {
    color: #2d3748;
    margin: 0 0 15px 0;
    font-size: 1.2rem;
}

.tip-card ul {
    margin: 0;
    padding-left: 20px;
    color: #4a5568;
    line-height: 1.6;
}

.tip-card li {
    margin-bottom: 8px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .financing-calculator {
        padding: 15px;
    }
    
    .calculator-header {
        padding: 20px 15px;
    }
    
    .calculator-header h2 {
        font-size: 2rem;
    }
    
    .calculator-header p {
        font-size: 1rem;
    }
    
    .financing-form,
    .results-container,
    .calculator-tips {
        padding: 20px;
    }
    
    .calculator-tabs,
    .results-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .tab-btn,
    .result-tab {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
    
    .amount-display {
        font-size: 1.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .action-btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .calculator-header h2 {
        font-size: 1.5rem;
    }
    
    .calculator-header p {
        font-size: 0.9rem;
    }
    
    .table-container {
        font-size: 0.8rem;
    }
    
    .amortization-table th,
    .amortization-table td {
        padding: 8px 5px;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-container {
    animation: slideInUp 0.5s ease-out;
}

/* ===== LOADING STATES ===== */
.calculate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.calculate-btn.loading {
    position: relative;
}

.calculate-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
