/* Paleta de Colores Fintech */
:root {
    --primary: #10b981;        /* Verde Esmeralda (Éxito/Dinero) */
    --primary-hover: #059669;
    --secondary: #3b82f6;      /* Azul (Confianza) */
    --bg-body: #0f172a;        /* Azul Oscuro Profundo */
    --bg-card: #1e293b;        /* Azul Slate */
    --bg-input: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Reset y Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.container {
    width: 100%;
    max-width: 650px;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Publicidad */
.ad-slot {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border);
    padding: 20px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 25px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Encabezado */
header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

header h1 span {
    color: var(--primary);
    background: linear-gradient(to right, #10b981, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 10px;
}

/* Card Principal */
.calculator-card {
    background: var(--bg-card);
    padding: 35px;
    border-radius: 30px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

/* Inputs Estilizados */
.grid-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.input-group:first-child {
    grid-column: span 2;
}

label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.input-with-symbol {
    display: flex;
    background: var(--bg-input);
    border: 2px solid #334155;
    border-radius: 14px;
    transition: all 0.3s ease;
}

.input-with-symbol:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

select {
    background: #334155;
    color: white;
    border: none;
    padding: 12px 15px;
    font-weight: bold;
    cursor: pointer;
    outline: none;
}

input {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: none;
    color: white;
    font-size: 1.1rem;
    outline: none;
}

/* Botón Principal */
#calc-btn {
    width: 100%;
    padding: 18px;
    background: var(--primary);
    color: #064e3b;
    border: none;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.3);
}

#calc-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Resultados */
.results-container {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.main-result {
    text-align: center;
    margin-bottom: 30px;
}

.main-result span {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.main-result h2 {
    font-size: 3.5rem;
    color: var(--primary);
    margin-top: 5px;
}

/* Gráfico Dinámico */
.chart-container {
    margin-bottom: 35px;
}

.chart-bar {
    height: 14px;
    background: var(--secondary);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
}

#bar-capital {
    height: 100%;
    background: var(--primary);
    transition: width 1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.chart-labels {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 15px;
    font-size: 0.85rem;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.cap { background: var(--primary); }
.int { background: var(--secondary); }

/* Grid de Estadísticas */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 30px;
}

.stat {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 18px;
    text-align: center;
    border: 1px solid var(--border);
}

.stat small { color: var(--text-muted); font-size: 0.8rem; }
.stat p { font-size: 1.25rem; font-weight: 700; color: white; margin-top: 5px; }

/* Tabla de Amortización */
.table-wrapper {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 25px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(0,0,0,0.2);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

th {
    background: #334155;
    color: var(--text-main);
    padding: 15px;
    text-align: left;
    position: sticky;
    top: 0;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
    color: white;
}

/* Botón Secundario */
.outline-btn {
    width: 100%;
    padding: 14px;
    background: transparent;
    border: 2px solid #334155;
    color: white;
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.outline-btn:hover {
    background: #334155;
}

/* Responsive */
@media (max-width: 500px) {
    .grid-inputs, .stats-grid {
        grid-template-columns: 1fr;
    }
    .input-group:first-child {
        grid-column: span 1;
    }
    header h1 { font-size: 1.8rem; }
    .main-result h2 { font-size: 2.5rem; }
}