/* ColoGPU money pages: disclosure, provider cards, price tables, calculator.
   Loaded after style.css. Uses style.css variables only.
   Readable text uses --text or --text-muted (>= 4.5:1 on --cool-1 and on
   --surface-elevated); --text-dim and --text-dark are not used for text. */

/* ── Disclosure (no "Quick Answer" label) ── */
.disclosure {
    margin: 0 0 2rem;
    padding: 1rem 1.25rem;
    border: 1px solid rgba(138, 155, 181, 0.35);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
    background: var(--surface-elevated);
}
.disclosure p { margin: 0; color: var(--text); font-size: 0.92rem; line-height: 1.65; }
.disclosure a { color: var(--primary-light); text-decoration: underline; text-underline-offset: 2px; }

/* ── Meta line ── */
.article-meta .byline,
.article-meta .reviewed {
    display: inline-block;
    margin-right: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.article-meta .reviewed time { color: var(--text-muted); font-size: inherit; }

/* ── Outbound links ── */
.out-wrap { white-space: normal; }
.out-link { font-weight: 600; }
.ref-label {
    display: inline-block;
    margin-left: 0.35em;
    padding: 0 0.35em;
    font-size: 0.7em;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    border: 1px solid var(--text-dim);
    border-radius: 3px;
    vertical-align: 0.15em;
    white-space: nowrap;
    cursor: help;
}
.ref-label[hidden] { display: none; }
a[data-ref="referral"] + .ref-label,
a[data-ref]:not([data-ref="none"]) + .ref-label { display: inline-block; }

/* ── Provider cards ── */
.provider-card {
    margin: 1.25rem 0;
    padding: 1.25rem 1.5rem;
    background: var(--surface-elevated);
    border: 1px solid rgba(138, 155, 181, 0.18);
    border-radius: 12px;
}
article .provider-card h3 { margin-top: 0; }
.provider-card p { margin-bottom: 0.75rem; }
.provider-card p:last-child { margin-bottom: 0; }
article .provider-type { font-size: 0.85rem; color: var(--text-muted); }
article .provider-price { color: var(--text); font-size: 0.92rem; }
.provider-go { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; align-items: center; }
.provider-go .out-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 1rem;
    border: 1px solid rgba(58, 141, 196, 0.6);
    border-radius: 8px;
}
.src { font-size: 0.85rem; color: var(--text-muted); }
.provider-warning { font-size: 0.9rem; }
.provider-rows { font-size: 0.9rem; }

/* ── Tables ── */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
    border: 1px solid rgba(138, 155, 181, 0.18);
    border-radius: 8px;
}
article .table-scroll table { margin: 0; }
.price-table { min-width: 640px; }
.price-table caption {
    text-align: left;
    padding: 0.75rem 1rem 0.25rem;
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
}
article .price-table th, article .price-table td { vertical-align: top; }
article .price-table td { color: var(--text); }
article .price-table .group-row th {
    background: rgba(39, 116, 174, 0.12);
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.85rem;
}
.price-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-table th button {
    font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit;
    background: none; border: 0; padding: 0.25rem 0; min-height: 44px; cursor: pointer;
    text-decoration: underline; text-underline-offset: 3px;
}
article p.table-note, .table-note { font-size: 0.85rem; color: var(--text-muted); margin: 0.5rem 0 1rem; }
.headline-prices li { color: var(--text); }
.breakeven-steps li { color: var(--text-muted); }
.sources { font-size: 0.88rem; word-break: break-word; }
.price-filter { margin: 1rem 0; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.price-filter label { color: var(--text); font-weight: 600; font-size: 0.9rem; }

/* ── Related list and verdict ── */
.related { list-style: none; padding-left: 0; }
article .related li { padding: 0.35rem 0; border-bottom: 1px solid rgba(138, 155, 181, 0.12); }
.verdict {
    margin: 1rem 0 1.5rem;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--primary-light);
    background: var(--surface-elevated);
    border-radius: 0 8px 8px 0;
}

/* ── Calculator ── */
.calc-form { margin: 1.5rem 0; }
.calc-intro-note { font-size: 0.9rem; }
.calc-notice {
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    color: var(--text);
    background: rgba(245, 158, 11, 0.08);
}
.calc-fieldset {
    border: 1px solid rgba(138, 155, 181, 0.25);
    border-radius: 12px;
    padding: 1rem 1.25rem 1.25rem;
    margin: 0 0 1.25rem;
    background: var(--surface-elevated);
    min-width: 0;
}
.calc-fieldset legend {
    padding: 0 0.5rem;
    font-weight: 700;
    color: var(--text);
}
.calc-field { margin: 0.9rem 0 0; }
.calc-field label, .calc-radio legend {
    display: block;
    font-weight: 600;
    color: var(--text);
    font-size: 0.92rem;
    margin-bottom: 0.3rem;
}
.calc-field input[type="number"], .calc-field select {
    width: 100%;
    max-width: 18rem;
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    font: inherit;
    color: var(--text);
    background: var(--cool-1);
    border: 1px solid rgba(138, 155, 181, 0.5);
    border-radius: 8px;
}
.calc-field input[aria-invalid="true"] { border-color: #f87171; }
.calc-help, .calc-note { font-size: 0.85rem; color: var(--text-muted); margin: 0.3rem 0 0; line-height: 1.5; }
.calc-note a { color: var(--primary-light); }
.calc-error { font-size: 0.85rem; color: #fca5a5; margin: 0.3rem 0 0; }
.calc-error:empty { display: none; }
.calc-radio { border: 0; padding: 0; margin: 0.9rem 0 0; min-width: 0; }
.calc-radio label {
    display: inline-flex; align-items: center; gap: 0.4rem;
    min-height: 44px; margin-right: 1.25rem; color: var(--text); font-weight: 500;
}
.calc-radio input { width: 1.2rem; height: 1.2rem; }
.calc-form details { margin-top: 1rem; }
.calc-form summary {
    cursor: pointer; color: var(--primary-light); font-weight: 600;
    min-height: 44px; display: flex; align-items: center;
}
.calc-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0.75rem 0 0; }
.calc-btn, .calc-btn-secondary {
    min-height: 44px;
    padding: 0.5rem 1rem;
    font: inherit;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
}
.calc-btn { background: var(--primary); color: #fff; border: 1px solid var(--primary); }
.calc-btn-secondary { background: transparent; color: var(--text); border: 1px solid rgba(138, 155, 181, 0.6); }
.calc-results {
    margin: 1.5rem 0;
    padding: 1.25rem 1.5rem;
    border: 1px solid rgba(58, 141, 196, 0.45);
    border-radius: 12px;
    background: var(--surface-elevated);
}
article .calc-results h2 { margin-top: 0; }
article p.calc-verdict, .calc-verdict { color: var(--text); font-size: 1.05rem; }
.calc-cautions { font-size: 0.9rem; }
.calc-table { min-width: 560px; }
.calc-table .calc-best { font-weight: 700; color: var(--accent-light); }
.calc-bars { margin: 1rem 0; }
.calc-bar-row { display: grid; grid-template-columns: 7rem 1fr; gap: 0.5rem; align-items: center; margin: 0.35rem 0; font-size: 0.85rem; color: var(--text); }
.calc-bar-track { background: rgba(138, 155, 181, 0.12); border-radius: 4px; height: 0.9rem; }
.calc-bar { height: 100%; border-radius: 4px; background: var(--primary-light); width: 0; transition: width 0.3s ease; }
.calc-breakevens li { color: var(--text-muted); }
.calc-cta { margin-top: 1.25rem; }
article .calc-cta h3 { margin-top: 1rem; }
.calc-cta .cta-btn { min-height: 44px; }

/* ── Site-wide fixes, applied only on pages that load money.css ──
   style.css's footer link row does not wrap (it widens the page to ~1000px on
   phones) and uses --text-dim (below 4.5:1). The cookie banner's buttons do
   not wrap either. Fixed here without editing style.css or cookies.js. */
body .footer-links { flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.25rem; }
body .footer-links a { color: var(--text-muted); display: inline-block; padding: 0.35rem 0; }
body .footer-links a:hover { color: var(--text); }
body .footer .legal-identity { color: var(--text-muted); }
body .cb-actions { flex-wrap: wrap; flex-shrink: 1; }
body .cb-text { min-width: 0; }

/* ── Focus and motion ── */
.page a:focus-visible, .page button:focus-visible, .page input:focus-visible,
.page select:focus-visible, .page summary:focus-visible, .table-scroll:focus-visible,
.footer a:focus-visible, .nav a:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

@media (max-width: 640px) {
    .provider-card, .calc-fieldset, .calc-results { padding: 1rem; }
    .calc-field input[type="number"], .calc-field select { max-width: none; }
    .calc-bar-row { grid-template-columns: 5.5rem 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    .calc-bar, .page a, .cta-btn, .faq-item { transition: none !important; }
    .page-tag::before { animation: none !important; }
}

/* ── Currency switch (assets/js/currency.js builds the buttons) ──
   Pressed state shows a tick and an underline as well as a colour change.
   Text uses --text / --text-muted only (>= 4.5:1). */
.cur-switch {
    margin: 1rem 0 1.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(138, 155, 181, 0.35);
    border-radius: 8px;
    background: var(--surface-elevated);
}
.cur-switch p { margin: 0; color: var(--text); font-size: 0.9rem; line-height: 1.6; }
.cur-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.cur-label { color: var(--text); font-weight: 600; font-size: 0.9rem; margin-right: 0.25rem; }
.cur-switch button {
    min-height: 44px;
    min-width: 44px;
    padding: 0.5rem 0.9rem;
    border: 1px solid rgba(138, 155, 181, 0.5);
    border-radius: 6px;
    background: var(--cool-1);
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}
.cur-switch button:hover { border-color: var(--primary-light); }
.cur-switch button:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }
.cur-btn[aria-pressed="true"] {
    border-color: var(--accent);
    background: var(--cool-3);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.cur-btn[aria-pressed="true"]::before { content: "\2713\00a0"; }
.cur-offer { margin: 0 0 0.6rem !important; }
.cur-offer button { margin-left: 0.25rem; }
.cur-status { margin-top: 0.5rem !important; color: var(--text-muted) !important; font-size: 0.85rem !important; }
.cur-status:empty { display: none; }
@media (max-width: 400px) {
    .cur-buttons { flex-direction: column; align-items: stretch; }
    .cur-switch button { width: 100%; }
}
