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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f0f4f8 0%, #e3f2fd 100%);
    min-height: 100vh;
    color: #1a2332;
    padding: 20px;
}

.amort-app {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px 30px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(1,87,155,.06), 0 24px 48px rgba(1,87,155,.10);
}

/* --- Cabecera --- */
.app-header {
    text-align: center;
    margin-bottom: 25px;
}

.app-header h1 {
    color: #01579b;
    font-size: 2rem;
    margin-bottom: 5px;
}

.subtitle {
    color: #5a6c7d;
    font-size: 0.95rem;
}

/* --- Mensaje informativo del método --- */
.info-metodo {
    background: #e3f2fd;
    border-left: 4px solid #01579b;
    color: #1a3a52;
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 30px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.info-metodo em {
    font-style: italic;
    color: #01579b;
    font-weight: 600;
}

/* --- Formulario --- */
.formulario {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.campo label {
    display: block;
    color: #1a2332;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.campo input,
.campo select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cfd8dc;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s;
}

.campo input:focus,
.campo select:focus {
    outline: none;
    border-color: #01579b;
}

.btn-calcular {
    grid-column: 1 / -1;
    padding: 14px;
    background: #01579b;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.btn-calcular:hover {
    background: #014075;
}

/* --- Resultado --- */
.resultado.oculto {
    display: none;
}

/* --- Totales --- */
.totales {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.total-card {
    background: #f5f9fc;
    border: 1px solid #e0e8ed;
    border-radius: 8px;
    padding: 18px;
    text-align: center;
}

.total-card.destacada {
    background: #01579b;
    border-color: #01579b;
}

.total-card.destacada .total-label,
.total-card.destacada .total-valor {
    color: #fff;
}

.total-label {
    display: block;
    font-size: 0.8rem;
    color: #5a6c7d;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.total-valor {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #01579b;
}

/* --- Gráfico --- */
.grafico-zona {
    margin-bottom: 30px;
}

.grafico-zona h3 {
    color: #01579b;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.barras {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 180px;
    background: #f5f9fc;
    border-radius: 8px;
    padding: 15px;
    gap: 10px;
}

.barra-grupo {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    max-width: 80px;
}

.barra {
    width: 100%;
    border-radius: 4px 4px 0 0;
    transition: height 0.6s ease;
    position: relative;
}

.barra.azul    { background: #01579b; }
.barra.naranja { background: #f57c00; }

.barra-valor {
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 6px;
    color: #1a2332;
}

.leyenda {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 12px;
    font-size: 0.9rem;
    color: #5a6c7d;
}

.punto {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
}

.punto.azul    { background: #01579b; }
.punto.naranja { background: #f57c00; }

/* --- Tabla --- */
.tabla-zona h3 {
    color: #01579b;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.tabla-scroll {
    overflow-x: auto;
    border: 1px solid #e0e8ed;
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

thead {
    background: #01579b;
    color: #fff;
}

th, td {
    padding: 10px 14px;
    text-align: right;
}

th:first-child, td:first-child {
    text-align: center;
}

th {
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody tr {
    border-bottom: 1px solid #f0f4f7;
}

tbody tr:nth-child(even) {
    background: #f5f9fc;
}

tbody tr:hover {
    background: #e3f2fd;
}

td.destacar-amort {
    color: #01579b;
    font-weight: 600;
}

td.destacar-int {
    color: #f57c00;
    font-weight: 600;
}

/* --- Móvil --- */
@media (max-width: 600px) {
    .amort-app {
        padding: 25px 18px;
    }

    .formulario {
        grid-template-columns: 1fr;
    }

    .totales {
        grid-template-columns: 1fr;
    }

    .total-valor {
        font-size: 1.3rem;
    }

    table {
        font-size: 0.85rem;
    }

    th, td {
        padding: 8px 10px;
    }
}
