/**
 * Calculator Page Styles - MortgageLoans.net
 *
 * Institutional look: clean inputs, no flashy sliders, no gamification.
 * Mobile-first, responsive.
 */

/* =========================================================================
   Page Layout
   ========================================================================= */

.calculator-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 36px 16px 32px;
}

.calculator-page__content {
    margin-bottom: 2rem;
}

.calculator-page__title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.calculator-page__section {
    margin-bottom: 2rem;
}

.calculator-page__wysiwyg {
    font-size: 1rem;
    line-height: 1.7;
    color: #333;
}

.calculator-page__wysiwyg h2,
.calculator-page__wysiwyg h3 {
    color: #1a1a2e;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.calculator-page__wysiwyg p {
    margin-bottom: 1rem;
}

.calculator-page__wysiwyg--disclaimer {
    font-size: 0.875rem;
    color: #666;
    border-top: 1px solid #e0e0e0;
    padding-top: 1rem;
}

.calculator-page__unavailable {
    padding: 2rem;
    text-align: center;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Section headings within article */
.calculator-page__guidance h2,
.calculator-page__disclaimer h2,
.calculator-page__seo-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 0.75rem;
}

/* =========================================================================
   Calculator Form
   ========================================================================= */

.ml-calc-form {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.ml-calc-form__section-label {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #666;
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e8e8e8;
}

.ml-calc-form__section-label:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.ml-calc-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.ml-calc-form__group {
    display: flex;
    flex-direction: column;
}

.ml-calc-form__label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #444;
    margin-bottom: 0.375rem;
}

.ml-calc-form__input-wrap {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.ml-calc-form__input-wrap:focus-within {
    border-color: #2d5a7b;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.ml-calc-form__prefix,
.ml-calc-form__suffix {
    padding: 0.5rem 0.5rem;
    font-size: 0.875rem;
    color: #666;
    white-space: nowrap;
    background: #f0f0f0;
    border: none;
    line-height: 1;
}

.ml-calc-form__prefix {
    border-right: 1px solid #e0e0e0;
}

.ml-calc-form__suffix {
    border-left: 1px solid #e0e0e0;
    font-size: 0.8125rem;
}

.ml-calc-input {
    flex: 1;
    border: none;
    padding: 0.5rem 0.625rem;
    font-size: 1rem;
    color: #1a1a2e;
    background: transparent;
    outline: none;
    min-width: 0;
    -moz-appearance: textfield;
}

.ml-calc-input::-webkit-inner-spin-button,
.ml-calc-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ml-calc-input--error {
    color: #dc2626;
}

.ml-calc-form__error {
    font-size: 0.75rem;
    color: #dc2626;
    margin-top: 0.25rem;
    min-height: 0;
}

.ml-calc-select {
    width: 100%;
    padding: 0.5rem 0.625rem;
    font-size: 1rem;
    color: #1a1a2e;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.ml-calc-select:focus {
    border-color: #2d5a7b;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
    outline: none;
}

/* =========================================================================
   Results
   ========================================================================= */

.ml-calc-results-container {
    margin-bottom: 1.5rem;
}

.ml-calc-results {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.ml-calc-results__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
}

.ml-calc-results__row:last-child {
    border-bottom: none;
}

.ml-calc-results__row--highlight {
    background: #2d5a7b;
    color: #fff;
}

.ml-calc-results__row--highlight .ml-calc-results__label,
.ml-calc-results__row--highlight .ml-calc-results__value {
    color: #fff;
}

.ml-calc-results__label {
    font-size: 0.9375rem;
    color: #444;
    display: flex;
    flex-direction: column;
}

.ml-calc-results__sublabel {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.125rem;
}

.ml-calc-results__row--highlight .ml-calc-results__sublabel {
    color: rgba(255, 255, 255, 0.7);
}

.ml-calc-results__value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a2e;
    white-space: nowrap;
    margin-left: 1rem;
}

.ml-calc-results__row--highlight .ml-calc-results__value {
    font-size: 1.375rem;
}

/* =========================================================================
   Loan Summary
   ========================================================================= */

.ml-calc-summary {
    margin-bottom: 2rem;
}

.ml-calc-summary__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.ml-calc-summary__item {
    text-align: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
}

.ml-calc-summary__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #888;
    margin-bottom: 0.375rem;
}

.ml-calc-summary__value {
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
}

/* =========================================================================
   State Page Links
   ========================================================================= */

.calculator-page__states {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.calculator-page__states h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.calculator-page__states-intro {
    font-size: 0.9375rem;
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* =========================================================================
   Related Pages
   ========================================================================= */

.calculator-page__related {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

.calculator-page__related-section {
    margin-bottom: 1.5rem;
}

.calculator-page__related-section h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 0.75rem;
}

.calculator-page__related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.calculator-page__related-card {
    display: flex;
    flex-direction: column;
    padding: 16px;
    border-top: 1px solid #e0e0e0;
    border-right: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    border-left: 4px solid #2d5a7b;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: border-left-color 0.15s, box-shadow 0.15s;
}

.calculator-page__related-card:hover {
    border-left-color: #1e3f5a;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.calculator-page__related-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #111;
    line-height: 1.3;
    margin-bottom: 4px;
}

.calculator-page__related-card:hover .calculator-page__related-card-title {
    color: #333;
}

.calculator-page__related-card-label {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #999;
}

/* Legacy list styles (keep for backward compat) */
.calculator-page__related-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.calculator-page__related-item {
    margin-bottom: 0.5rem;
}

.calculator-page__related-item a {
    color: #2d5a7b;
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.15s;
}

.calculator-page__related-item a:hover {
    color: #1e3f5a;
    text-decoration: underline;
}

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

/* =========================================================================
   Breadcrumbs
   ========================================================================= */

.breadcrumbs {
    margin-bottom: 1.5rem;
    font-size: 0.8125rem;
}

.breadcrumbs__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.breadcrumbs__item::after {
    content: '>';
    margin-left: 0.375rem;
    color: #999;
}

.breadcrumbs__item:last-child::after {
    display: none;
}

.breadcrumbs__link {
    color: #2d5a7b;
    text-decoration: none;
}

.breadcrumbs__link:hover {
    text-decoration: underline;
}

.breadcrumbs__item--current {
    color: #666;
}

/* =========================================================================
   Amortization Table
   ========================================================================= */

.ml-calc-schedule-container {
    margin-bottom: 2rem;
    overflow-x: auto;
}

.ml-calc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.ml-calc-table thead {
    background: #2d5a7b;
    color: #fff;
}

.ml-calc-table th {
    padding: 0.625rem 1rem;
    text-align: right;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ml-calc-table th:first-child {
    text-align: left;
}

.ml-calc-table td {
    padding: 0.5rem 1rem;
    text-align: right;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}

.ml-calc-table td:first-child {
    text-align: left;
    font-weight: 600;
    color: #1a1a2e;
}

.ml-calc-table tbody tr:hover {
    background: #f8f9fa;
}

.ml-calc-table tbody tr:last-child td {
    border-bottom: none;
}

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 640px) {
    .calculator-page {
        padding: 24px 12px 16px;
    }

    .calculator-page__title {
        font-size: 1.5rem;
    }

    .ml-calc-form {
        padding: 1rem;
    }

    .ml-calc-form__row {
        grid-template-columns: 1fr;
    }

    .ml-calc-results__row {
        padding: 0.75rem 1rem;
    }

    .ml-calc-results__value {
        font-size: 1rem;
    }

    .ml-calc-results__row--highlight .ml-calc-results__value {
        font-size: 1.125rem;
    }

    .ml-calc-summary__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
