/* Styles specific to the Credit Card Payoff Tier-2 calculator: the two-line balance chart, the
   screen-reader helper, the never-clears warning banner, and the saving-coloured pill. Sits alongside
   calculator.css; loaded only on /uk/calculators/credit-card-payoff.

   The line-chart + sr-only + saving-pill rules mirror mortgage-overpayment.css (the two Tier-2
   comparison-line calcs share the same chart shape). A future refactor could promote the shared
   line-chart base into calculator.css for both pages; kept per-page here to match the established
   Mortgage Overpayment pattern and keep this change self-contained. */

/* Visually-hidden helper for screen readers + crawlers (WAI sr-only pattern, namespaced to the calc
   layout). Stays in the accessibility tree + indexed HTML, renders nothing visually. */
.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 (minimum only + with the extra), 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 (applyCardPayoffChart). 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;
}

.calc-chart {
    width: 100%;
    height: auto;
    font-size: 0.85rem;
}

.calc-chart-bg {
    fill: #f8f9fa;
}

.calc-chart-gridlines line {
    stroke: #dee2e6;
    stroke-width: 1;
}

.calc-chart-line {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Comparison line pair: "minimum only" is the Loser (de-emphasised grey + dash, the baseline),
   "with the extra" is the Winner (green). 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);
}

/* Saving-coloured pill figure: the "Interest saved" pill is the page's headline number, so it stands
   out in green (matches SDLT's FTB-saving pill colour for consistency across the calculator surface). */
.calc-pill-saving {
    color: #1d6a31;
}

/* Never-clears warning banner: shown only when the minimum payment does not cover the interest (only
   reachable when the minimum percentage is set to zero). An honest result state, not a validation
   error, so it sits inside the results area rather than the validation-issues banner above. */
.calc-warning {
    margin: 0.5rem 0 0;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    background: #fff3cd;
    border: 1px solid #ffe69c;
    color: #664d03;
    font-size: 0.95rem;
}
