﻿:root {
    --ink: #337ab7;
    --paper: #f2f0e6;
    --panel: #ffffff;
    --line: #d9d4c4;
    --teal: #00688A;
    --teal-deep: #004f65;
    --gold: #b8863a;
    --green-soft: #5c8a6b;
    --red-soft: #a1483f;
    font-size: 16px;
}

* {
    box-sizing: border-box;
}

.body {
    margin: 0;
    color: var(--ink);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 24px;
}

.header {
    /*border-bottom: 2px solid var(--teal);*/
    padding-bottom: 12px;
    margin-bottom: 18px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
}

h1 {
    font-size: 1.25rem;
    margin: 0;
    color: var(--teal-deep);
}

.layout {
    display: grid;
    grid-template-columns: 1.1fr 1.4fr;
    gap: 28px;
}

@media (max-width:820px) {
    .layout {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 2px;
    padding: 20px;
    position: relative;
}

    .card::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: var(--teal);
    }

    .card h2 {
        font-family: "Helvetica Neue", Arial, sans-serif;
        font-size: 0.78rem;
        text-transform: uppercase;
        color: var(--teal-deep);
        margin: 0 0 14px;
        font-weight: 700;
    }

label {
    display: block;
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 0.76rem;
    color: #4a493f;
    margin: 12px 0 6px;
    font-weight: 600;
}

select, input[type="number"], input[type="range"], input[type="text"] {
    width: 100%;
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 0.95rem;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 3px;
    background: var(--paper);
    color: var(--ink);
}

.radio-row {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

    .radio-row button {
        flex: 1;
        padding: 9px 6px;
        border: 1px solid var(--line);
        background: var(--paper);
        color: var(--ink);
        border-radius: 3px;
        cursor: pointer;
        font-weight: 600;
    }

        .radio-row button.active {
            background: var(--teal);
            border-color: var(--teal);
            color: #fff;
        }

.amount-display {
    font-family: "Iowan Old Style", "Georgia", serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--teal-deep);
    margin: 6px 0;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 0.72rem;
    color: #8a8874;
    margin-top: 6px;
}

.cuotas-display {
    font-family: "Iowan Old Style", "Georgia", serif;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--teal-deep);
}

.tag {
    display: inline-block;
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    margin-top: 10px;
}

    .tag.fija {
        background: #e4ede4;
        color: var(--green-soft);
    }

    .tag.variable {
        background: #f3e6dd;
        color: var(--red-soft);
    }

ul {
    list-style-type: none; /* Elimina la viñeta por defecto */
    padding-left: 0;
}

    ul li {
        position: relative; /* Permite posicionar el guion de forma absoluta */
        padding-left: 0.8em; /* Espacio para el guion y sangría */
    }

.guiones {
    list-style-type: '-';
}

.note {
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 0.72rem;
    color: #8a8874;
    line-height: 1.5;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
}

.result-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.stat {
    background: var(--teal-deep);
    color: var(--paper);
    padding: 14px 16px;
    border-radius: 3px;
}

    .stat.alt {
        background: var(--teal);
    }

    .stat .stat-label {
        font-family: "Helvetica Neue", Arial, sans-serif;
        font-size: 0.68rem;
        text-transform: uppercase;
        opacity: 0.85;
        margin-bottom: 6px;
    }

    .stat .stat-value {
        font-family: "Iowan Old Style", "Georgia", serif;
        font-size: 1.3rem;
        font-weight: 600;
    }

.breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

    .breakdown div {
        display: flex;
        justify-content: space-between;
        padding: 6px 0;
        border-bottom: 1px solid var(--line);
    }

.table-scroll {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: 3px;
    margin-top: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 0.85rem;
}

thead th {
    text-align: right;
    padding: 8px 6px;
    border-bottom: 2px solid var(--teal);
    color: var(--teal-deep);
    font-size: 0.68rem;
    text-transform: uppercase;
}

    thead th:first-child {
        text-align: left;
    }

tbody td {
    text-align: right;
    padding: 6px 6px;
    border-bottom: 1px solid var(--line);
}

    tbody td:first-child {
        text-align: left;
        color: #6b6a5f;
    }

.warn {
    background: #f7ede3;
    border: 1px solid #e6cfae;
    color: #7a5320;
    padding: 10px;
    border-radius: 3px;
    margin-bottom: 12px;
}

.footer {
    margin-top: 20px;
    font-family: "Helvetica Neue", Arial, sans-serif;
    font-size: 0.68rem;
    color: #8a8874;
    text-align: center;
}

/* Evitar saltos de layout cuando cambian los números */
/*.amount-display,
.cuotas-display,*/
/*.stat-value,
.slider-labels span,*/
.breakdown span,
/*#CapitalMin,
#CapitalMax,
#CantidadCuotasMin,
#CantidadCuotasMax,*/
#rCapital,
#rTna,
#rGastos,
#rSeguro,
#rNeto,
#rIntereses,
#rTotal,
#rTea {
    /* Digitos de ancho fijo para evitar reflow al cambiar cifras */
    font-variant-numeric: tabular-nums;
    -webkit-font-feature-settings: "tnum" 1;
    font-feature-settings: "tnum";
    /* ancho mínimo estimado (ajusta si hace falta) */
    min-width: 12ch;
    display: inline-block;
    text-align: right;
    white-space: nowrap;
}

/* Evitar cambios de altura */
.amount-display,
.stat-value {
    min-height: 1.6rem;
    line-height: 1.6rem;
}

/* No permitir que las celdas de tabla reflowen por wrapping */
tbody td {
    white-space: nowrap;
}

/* Promover elementos a capa de composición para reducir repaints */
.amount-display,
.slider-labels,
.cuotas-display {
    will-change: transform, contents;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Evitar selección accidental mientras se desliza */
input[type="range"] {
    -webkit-user-select: none;
    user-select: none;
    touch-action: pan-y;
}
