/* ========================================
   SIMULADOR DE CRÉDITO - CSS COMPLETO
   ======================================== */

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
}

/* ========================================
   LAYOUT BASE
   ======================================== */

.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

.calculator-wrapper {
    width: 100%;
}

/* ========================================
   BREADCRUMB
   ======================================== */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.breadcrumb-link {
    color: var(--gray-600);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-link:hover {
    color: var(--primary);
}

.breadcrumb-separator {
    color: var(--gray-300);
}

.breadcrumb-current {
    color: var(--gray-900);
    font-weight: 500;
}

/* ========================================
   HEADER
   ======================================== */

.calculator-header {
    text-align: center;
    margin-bottom: 40px;
}

.calculator-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.title-icon {
    font-size: 2.2rem;
}

.calculator-description {
    font-size: 1.1rem;
    color: var(--gray-600);
    max-width: 750px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ========================================
   CALCULATOR LAYOUT
   ======================================== */

.calculator-layout {
    display: grid;
    grid-template-columns: 450px 1fr;
    gap: 30px;
    margin-bottom: 50px;
    align-items: start;
}

/* ========================================
   FORM SECTION
   ======================================== */

.form-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
    margin-bottom: 20px;
}

.form-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-icon {
    font-size: 1.4rem;
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.95rem;
}

.label-text {
    flex: 1;
}

.label-icon {
    font-size: 1.1rem;
    opacity: 0.7;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    transition: all 0.3s;
    font-family: inherit;
    color: var(--gray-900);
    font-weight: 500;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-prefix {
    position: absolute;
    left: 16px;
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.95rem;
    pointer-events: none;
}

.input-suffix {
    position: absolute;
    right: 16px;
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.95rem;
    pointer-events: none;
}

.form-input:has(~ .input-prefix) {
    padding-left: 35px;
}

.form-input:has(~ .input-suffix) {
    padding-right: 75px;
}

.form-help {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--gray-600);
}

/* ========================================
   BUTTONS
   ======================================== */

.btn-calculate {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    margin-bottom: 12px;
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-arrow {
    font-size: 1.3rem;
    transition: transform 0.3s;
}

.btn-calculate:hover .btn-arrow {
    transform: translateX(5px);
}

.btn-reset {
    width: 100%;
    padding: 12px 24px;
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-reset:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

/* ========================================
   RESULTS SECTION
   ======================================== */

.results-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
}

.results-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-icon {
    font-size: 1.4rem;
}

.result-main {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 16px;
    margin-bottom: 25px;
    color: white;
}

.result-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 10px;
}

.result-value {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.result-note {
    font-size: 0.9rem;
    opacity: 0.85;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.result-item {
    background: var(--gray-50);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    gap: 12px;
    border: 1px solid var(--gray-200);
}

.result-item-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

.result-item-content {
    flex: 1;
}

.result-item-label {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.result-item-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
}

.result-chart {
    margin-bottom: 20px;
}

.chart-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 12px;
}

.chart-bars {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.chart-bar {
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    transition: width 0.6s ease;
}

.chart-bar.capital {
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.chart-bar.interest {
    background: linear-gradient(90deg, var(--danger) 0%, #dc2626 100%);
}

.chart-legend {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.recommendation {
    background: #fef3c7;
    border-left: 4px solid var(--warning);
    border-radius: 8px;
    padding: 18px;
}

.recommendation h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 10px;
}

.recommendation p {
    color: var(--gray-700);
    line-height: 1.6;
    margin: 0;
    font-size: 0.95rem;
}

/* Empty State */
.empty-state {
    background: white;
    border-radius: 20px;
    padding: 50px 30px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 2px dashed var(--gray-200);
}

.empty-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 10px;
}

.empty-text {
    color: var(--gray-600);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ========================================
   TABLA AMORTIZACIÓN
   ======================================== */

.amortization-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--gray-200);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.btn-download {
    padding: 10px 20px;
    background: var(--success);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-download:hover {
    background: #059669;
    transform: translateY(-2px);
}

.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
}

.amortization-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.amortization-table thead {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.amortization-table th {
    padding: 14px 12px;
    text-align: left;
    font-weight: 700;
    white-space: nowrap;
}

.amortization-table td {
    padding: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.amortization-table tbody tr:hover {
    background: var(--gray-50);
}

.amortization-table tbody tr:last-child td {
    border-bottom: none;
}

/* ========================================
   CONTENT SECTIONS
   ======================================== */

.content-section {
    margin-bottom: 50px;
}

.content-section h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 20px;
}

.content-section p {
    color: var(--gray-600);
    line-height: 1.8;
    font-size: 1rem;
    margin-bottom: 18px;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.info-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-200);
    transition: all 0.3s;
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.info-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.info-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.info-card p {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin: 0;
    line-height: 1.5;
}

/* Steps Grid */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.step-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-200);
}

.step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 auto 15px;
}

.step-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 10px;
}

.step-card p {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin: 0;
    line-height: 1.5;
}

/* Credit Types Grid */
.credit-types-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.credit-type-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-200);
}

.credit-type-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 15px;
}

.credit-type-card p {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Tips Grid */
.tips-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.tip-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-200);
    transition: all 0.3s;
}

.tip-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.tip-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
}

.tip-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 10px;
}

.tip-card p {
    font-size: 0.95rem;
    color: var(--gray-600);
    margin: 0;
    line-height: 1.6;
}

/* Related Grid */
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.related-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-200);
    transition: all 0.3s;
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.related-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
}

.related-card h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.related-card p {
    color: var(--gray-600);
    font-size: 0.9rem;
    margin: 0;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 1024px) {
    .calculator-layout {
        grid-template-columns: 1fr;
    }
    
    .info-grid,
    .steps-grid,
    .credit-types-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .calculator-title {
        font-size: 1.8rem;
    }
    
    .info-grid,
    .steps-grid,
    .credit-types-grid,
    .tips-grid,
    .results-grid,
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .page-container {
        padding: 20px 15px 60px;
    }
    
    .result-value {
        font-size: 2.2rem;
    }
    
    .amortization-table {
        font-size: 0.8rem;
    }
}