.mortgage-page {
    padding: 44px 0 72px;
}

.mortgage-header {
    margin-bottom: 28px;
}

.mortgage-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 14px;
    border-radius: 999px;
    background: #e9f8ef;
    color: #12813d;
    font-size: 14px;
    font-weight: 800;
    margin-bottom: 14px;
}

.mortgage-header h1 {
    margin: 0 0 12px;
    color: #071733;
    font-size: 34px;
    line-height: 1.15;
}

.mortgage-header p {
    margin: 0;
    max-width: 900px;
    color: #465c7a;
    font-size: 16px;
    line-height: 1.65;
}

.mortgage-calculator-grid {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 28px;
    align-items: stretch;
}

.mortgage-form-card,
.mortgage-result-card,
.mortgage-wide-card {
    background: #ffffff;
    border: 1px solid #dbe4f0;
    border-radius: 24px;
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.06);
}

.mortgage-form-card {
    padding: 24px;
}

.mortgage-result-card {
    padding: 28px;
}

.mortgage-form-card h2,
.mortgage-result-card h2 {
    margin: 0 0 22px;
    color: #081832;
    font-size: 28px;
    line-height: 1.2;
}

.mortgage-form-card form {
    display: grid;
    gap: 15px;
}

.mortgage-form-card label {
    display: grid;
    gap: 8px;
    color: #0f1f39;
    font-size: 15px;
    font-weight: 800;
}

.mortgage-form-card input,
.mortgage-form-card select {
    width: 100%;
    min-height: 48px;
    border: 1px solid #ccd8e8;
    border-radius: 14px;
    background: #ffffff;
    color: #071733;
    font-size: 15px;
    font-weight: 700;
    padding: 0 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mortgage-form-card input:focus,
.mortgage-form-card select:focus {
    border-color: #7aa7ff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

.mortgage-info-box {
    margin-top: 4px;
    padding: 16px;
    border: 1px solid #c9dbff;
    border-radius: 18px;
    background: #f4f8ff;
}

.mortgage-info-box strong {
    display: block;
    color: #0f1f39;
    font-size: 16px;
    line-height: 1.25;
    margin-bottom: 10px;
}

.mortgage-info-box ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.mortgage-info-box li {
    color: #445b7a;
    font-size: 14px;
    line-height: 1.35;
}

.mortgage-info-box li::before {
    content: "✓";
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    border-radius: 50%;
    background: #dceaff;
    color: #2563eb;
    font-size: 12px;
    font-weight: 900;
}

.mortgage-primary-button {
    width: 100%;
    min-height: 52px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.mortgage-primary-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

.mortgage-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.mortgage-result-item {
    min-height: 74px;
    padding: 16px;
    border: 1px solid #d7e2f1;
    border-radius: 16px;
    background: #f9fbff;
}

.mortgage-result-item span {
    display: block;
    color: #647895;
    font-size: 13px;
    line-height: 1.3;
    margin-bottom: 8px;
}

.mortgage-result-item strong {
    display: block;
    color: #071733;
    font-size: 17px;
    line-height: 1.25;
}

.mortgage-highlight {
    background: #eef6ff;
    border-color: #b9d4ff;
}

.mortgage-composition-card {
    padding: 22px;
    border: 1px solid #d7e2f1;
    border-radius: 22px;
    background: #ffffff;
    margin-bottom: 20px;
}

.mortgage-composition-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.mortgage-composition-header h3 {
    margin: 0 0 8px;
    color: #071733;
    font-size: 21px;
}

.mortgage-composition-header p {
    margin: 0;
    color: #526987;
    font-size: 14px;
    line-height: 1.55;
}

.mortgage-composition-header span {
    flex: 0 0 auto;
    padding: 8px 14px;
    border-radius: 999px;
    background: #eef6ff;
    color: #2563eb;
    font-size: 13px;
    font-weight: 900;
}

.mortgage-composition-grid {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 22px;
    align-items: center;
}

.mortgage-donut-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
}

.mortgage-donut {
    width: 170px;
    height: 170px;
}

.mortgage-donut-bg,
.mortgage-donut-value {
    fill: none;
    stroke-width: 18;
    transform: rotate(-90deg);
    transform-origin: 60px 60px;
}

.mortgage-donut-bg {
    stroke: #43516a;
}

.mortgage-donut-value {
    stroke: #b8d7ff;
    stroke-linecap: round;
}

.mortgage-donut-number {
    fill: #071733;
    font-size: 18px;
    font-weight: 900;
}

.mortgage-donut-label {
    fill: #526987;
    font-size: 11px;
    font-weight: 800;
}

.mortgage-composition-details {
    display: grid;
    gap: 12px;
}

.mortgage-composition-details div {
    padding: 14px 16px;
    border: 1px solid #d7e2f1;
    border-radius: 16px;
    background: #ffffff;
}

.mortgage-composition-details span {
    display: block;
    color: #647895;
    font-size: 13px;
    margin-bottom: 6px;
}

.mortgage-composition-details strong {
    color: #071733;
    font-size: 16px;
}

.mortgage-composition-details .mortgage-total-line {
    background: #eef6ff;
    border-color: #b9d4ff;
}

.mortgage-toggle-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid #b9d4ff;
    border-radius: 18px;
    background: #f8fbff;
    cursor: pointer;
    text-align: left;
}

.mortgage-toggle-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border-radius: 12px;
    background: #2563eb;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

.mortgage-toggle-copy {
    display: grid;
    gap: 3px;
    flex: 1;
}

.mortgage-toggle-copy strong {
    color: #071733;
    font-size: 15px;
}

.mortgage-toggle-copy small {
    color: #526987;
    font-size: 13px;
}

.mortgage-toggle-period {
    padding: 8px 13px;
    border: 1px solid #b9d4ff;
    border-radius: 999px;
    background: #ffffff;
    color: #2563eb;
    font-size: 13px;
    font-weight: 900;
}

.mortgage-toggle-arrow {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #e8f1ff;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
}

.mortgage-empty-result {
    padding: 18px;
    border: 1px solid #d7e2f1;
    border-radius: 18px;
    background: #f9fbff;
    color: #526987;
    line-height: 1.65;
}

.mortgage-evolution-section {
    margin-top: 32px;
}

.mortgage-evolution-section.is-hidden {
    display: none;
}

.mortgage-wide-card {
    padding: 26px;
}

.mortgage-observation {
    margin: 0 0 20px;
    color: #526987;
    font-size: 14px;
    line-height: 1.65;
}

.mortgage-chart-card,
.mortgage-table-card {
    border: 1px solid #d7e2f1;
    border-radius: 22px;
    background: #ffffff;
}

.mortgage-chart-card {
    padding: 22px;
    margin-bottom: 22px;
}

.mortgage-chart-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.mortgage-chart-header h3,
.mortgage-table-header h3 {
    margin: 0 0 8px;
    color: #071733;
    font-size: 21px;
}

.mortgage-chart-header p,
.mortgage-table-header p {
    margin: 0;
    color: #526987;
    font-size: 14px;
    line-height: 1.55;
}

.mortgage-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: #526987;
    font-size: 13px;
    font-weight: 800;
}

.mortgage-chart-legend span::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 6px;
    background: #43516a;
}

.mortgage-chart-legend span:nth-child(2)::before {
    background: #b8d7ff;
}

.mortgage-chart-legend span:nth-child(3)::before {
    background: #2563eb;
    border-radius: 999px;
}

.mortgage-svg-wrapper {
    width: 100%;
    overflow-x: auto;
}

.mortgage-chart-svg {
    width: 100%;
    min-width: 760px;
    height: auto;
    display: block;
}

.mortgage-grid-line {
    stroke: #e6edf7;
    stroke-width: 1;
}

.mortgage-axis-line {
    stroke: #cbd7e8;
    stroke-width: 1.3;
}

.mortgage-bar-amortization {
    fill: #43516a;
}

.mortgage-bar-interest {
    fill: #b8d7ff;
}

.mortgage-balance-line {
    fill: none;
    stroke: #2563eb;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mortgage-balance-dot {
    fill: #2563eb;
}

.mortgage-chart-label,
.mortgage-chart-axis-label {
    fill: #526987;
    font-size: 13px;
    font-weight: 800;
}

.mortgage-table-card {
    padding: 0;
    overflow: hidden;
}

.mortgage-table-header {
    padding: 22px 22px 0;
}

.mortgage-table-wrapper {
    overflow-x: auto;
    padding: 18px 22px 22px;
}

.mortgage-table {
    width: 100%;
    min-width: 880px;
    border-collapse: collapse;
}

.mortgage-table th,
.mortgage-table td {
    padding: 13px 12px;
    border-bottom: 1px solid #e3ebf6;
    text-align: left;
    font-size: 14px;
}

.mortgage-table th {
    color: #071733;
    font-weight: 900;
    background: #f7faff;
}

.mortgage-table td {
    color: #465c7a;
}

@media (max-width: 1100px) {
    .mortgage-calculator-grid {
        grid-template-columns: 1fr;
    }

    .mortgage-form-card {
        max-width: 420px;
    }
}

@media (max-width: 760px) {
    .mortgage-page {
        padding-top: 28px;
    }

    .mortgage-header h1 {
        font-size: 28px;
    }

    .mortgage-summary-grid {
        grid-template-columns: 1fr;
    }

    .mortgage-composition-header,
    .mortgage-chart-header {
        flex-direction: column;
    }

    .mortgage-composition-grid {
        grid-template-columns: 1fr;
    }

    .mortgage-toggle-button {
        flex-wrap: wrap;
    }

    .mortgage-toggle-copy {
        flex-basis: calc(100% - 54px);
    }
}

/* Gráfico comparativo da amortização antecipada */

.mortgage-base-line {
    fill: none;
    stroke: #94a3b8;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 10 8;
    opacity: 0.95;
}

.mortgage-selected-line {
    fill: none;
    stroke: #2563eb;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mortgage-extra-dot {
    fill: #2563eb;
    stroke: #ffffff;
    stroke-width: 3;
    filter: drop-shadow(0 4px 8px rgba(37, 99, 235, 0.28));
}

.mortgage-chart-legend-comparison span:nth-child(1)::before {
    background: #94a3b8;
}

.mortgage-chart-legend-comparison span:nth-child(2)::before {
    background: #2563eb;
    border-radius: 999px;
}

.mortgage-chart-legend-comparison span:nth-child(3)::before {
    background: #2563eb;
    border-radius: 999px;
    box-shadow: 0 0 0 3px #ffffff, 0 0 0 4px #2563eb;
}

.mortgage-chart-card .mortgage-chart-svg {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border-radius: 18px;
}

/* Gráfico profissional da amortização antecipada */

.mortgage-svg-wrapper-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 8px;
    border-radius: 18px;
    scroll-behavior: smooth;
}

.mortgage-chart-svg-scroll {
    width: auto;
    max-width: none;
    min-width: 100%;
    display: block;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border-radius: 18px;
}

.mortgage-chart-scroll-hint {
    display: inline-flex;
    align-items: center;
    margin: 4px 0 12px;
    padding: 7px 12px;
    border-radius: 999px;
    background: #eef6ff;
    color: #2563eb;
    font-size: 12px;
    font-weight: 800;
}

.mortgage-legend-pro {
    display: grid;
    gap: 10px;
    min-width: 280px;
    padding: 12px;
    border: 1px solid #d7e2f1;
    border-radius: 16px;
    background: #f8fbff;
}

.mortgage-legend-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.mortgage-legend-group strong {
    width: 100%;
    color: #071733;
    font-size: 12px;
    font-weight: 900;
}

.mortgage-legend-group span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #465c7a;
    font-size: 12px;
    font-weight: 800;
}

.legend-box {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    display: inline-block;
}

.legend-regular {
    background: #43536e;
}

.legend-extra {
    background: #8ec5ff;
}

.legend-line {
    width: 24px;
    height: 0;
    display: inline-block;
}

.legend-line-base {
    border-top: 3px dashed #9aa9bf;
}

.legend-line-initial {
    border-top: 3px dashed #6f8fda;
}

.legend-line-full {
    border-top: 4px solid #2563eb;
}

.mortgage-bar-extra {
    fill: #8ec5ff;
}

.mortgage-line-base,
.mortgage-line-initial,
.mortgage-line-full {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mortgage-line-base {
    stroke: #9aa9bf;
    stroke-width: 3;
    stroke-dasharray: 8 7;
}

.mortgage-line-initial {
    stroke: #6f8fda;
    stroke-width: 3;
    stroke-dasharray: 5 6;
}

.mortgage-line-full {
    stroke: #2563eb;
    stroke-width: 4;
}

.mortgage-extra-dot {
    fill: #8ec5ff;
    stroke: #ffffff;
    stroke-width: 2.5;
}

@media (max-width: 760px) {
    .mortgage-legend-pro {
        width: 100%;
    }

    .mortgage-chart-scroll-hint {
        width: 100%;
        justify-content: center;
    }
}

/* Juros no gráfico de amortização antecipada */

.legend-interest {
    background: #f6c863;
}

.mortgage-bar-interest {
    fill: #f6c863;
}

.mortgage-legend-pro {
    align-self: flex-start;
}

.mortgage-chart-header {
    align-items: flex-start;
}

.mortgage-chart-card p {
    max-width: 620px;
}