/* Styles specific to the Mortgage Overpayment Tier-2 calculator - line chart + a11y partial +
   the extra input affordances (rate-% suffix, term-months subtext). Sits alongside calculator.css;
   loaded only on /uk/calculators/mortgage-overpayment. */

/* Mirror of .calc-input-prefix but anchored to the right edge, for unit suffixes like %.
   The suffix sits inset from the right edge so the glyph doesn't crowd the input border;
   the input itself gets matching right padding so the typed digits don't overlap the glyph. */
.calc-input-suffix {
    position: absolute;
    right: 0.5rem;
    top: 0;
    bottom: 0;
    width: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    pointer-events: none;
}

.calc-page .calc-input-wrap input[type="number"] {
    padding-right: 2rem;
}

/* Small grey note under a field - used for the "20 years and 0 months" subtitle below the term input. */
.calc-field-note {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0.25rem 0 0;
    line-height: 1.3;
}

/* Visually-hidden helper for screen readers + crawlers. Stays in the accessibility tree and is
   indexed by search engines, but doesn't render visually. Matches the WAI standard sr-only
   pattern but namespaced to the calc layout so it can't conflict with anything in the main app. */
.calc-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ── Line chart ─────────────────────────────────────────────────────────────────────────────────
   Inline-SVG line chart: two polylines (baseline + scenario), 4-tick Y grid, 5-year X ticks.
   No external chart library. The server renders the polylines + tick labels at first paint and
   calculator.js redraws them on AJAX recompute (applyOverpaymentChart in calculator.js).
   Geometry is mirrored between Razor and JS so the two paths produce identical pixel output. */

.calc-chart-wrap {
    margin: 1rem 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}

/* Fill the full width of the results column (no 600px cap): the column is wider than 600px on
   desktop, so capping wasted space and shrank the in-SVG axis labels. The viewBox keeps the
   aspect ratio, so a wider render makes the whole chart, labels included, physically larger. */
.calc-chart {
    width: 100%;
    height: auto;
    font-size: 0.85rem;
}

.calc-chart-bg {
    fill: #f8f9fa;
}

.calc-chart-gridlines line {
    stroke: #dee2e6;
    stroke-width: 1;
}

/* Axis labels - sized in viewBox units (the chart's viewBox is 600×320, scaled to the chart's
   rendered width). 20 viewBox-units reads clearly once the chart fills the results column, and
   stays legible on narrower mobile screens where the chart scales down. The Y-axis left padding
   (padL = 78 in the geometry) gives £-labels like "£1.25m" room so they don't clip at the edge. */
.calc-chart-yticks text,
.calc-chart-xticks text {
    fill: #6c757d;
    font-size: 20px;
}

.calc-chart-line {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Comparison line pair (Mortgage Overpayment): the "without overpayment" line is the Loser
   (de-emphasised grey + dash so it reads as the baseline), "with overpayment" is the Winner
   (green). Per Calculators.md §"Chart colour rules" - comparison charts override the series'
   own category colour with the Winner/Loser pair. Colours from the :root vars in _HeadTags. */
.calc-chart-line-loser {
    stroke: var(--chart-loser);
    stroke-dasharray: 4 4;
}

.calc-chart-line-winner {
    stroke: var(--chart-winner);
}

.calc-chart-legend {
    display: flex;
    gap: 1.2rem;
    color: #555;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: center;
    font-size: 0.95rem;
}

.calc-chart-swatch {
    display: inline-block;
    width: 1.2rem;
    height: 0.25rem;
    margin-right: 0.4rem;
    border-radius: 1px;
    vertical-align: middle;
}

.calc-chart-swatch-loser {
    background: var(--chart-loser);
}

.calc-chart-swatch-winner {
    background: var(--chart-winner);
}

/* Stacked-area-chart polygons (used by the Mortgage Payment amortisation chart). Capital is
   Neutral (your own debt principal - grey), interest paid is Money Out (red). Stroke matches
   the fill so a thin outline keeps adjacent polygons visually distinct against the plot
   background. Colours from the :root vars in _HeadTags. */
.calc-chart-area {
    stroke-width: 1;
    stroke-linejoin: round;
}
.calc-chart-area-neutral {
    fill: var(--chart-neutral);
    stroke: var(--chart-neutral);
}
.calc-chart-area-money-out {
    fill: var(--chart-money-out);
    stroke: var(--chart-money-out);
}

.calc-chart-swatch-neutral {
    background: var(--chart-neutral);
}
.calc-chart-swatch-money-out {
    background: var(--chart-money-out);
}

/* Saving-coloured pill figure - matches SDLT's FTB-saving pill colour for visual consistency
   across the calculator surface. The "Interest saved" pill is the page's headline number, so
   it stands out in green. */
.calc-pill-saving {
    color: #1d6a31;
}
