/* EV Charging Cost Calculator (/ev-chargers/charging-cost/calculator/)
 * Everything is scoped under .evcc so it can't leak into the shared sqheader/footer styles.
 * Colours come from the QuotesV3 Tailwind palette (blue-900, orange-400, green-600). */

.evcc {
	--evcc-navy: #2a3762;
	--evcc-navy-soft: #434b74;
	--evcc-orange: #eb750f;
	--evcc-green: #1d854d;
	--evcc-green-dark: #1e6e41;
	--evcc-green-free: #17ac62;
	--evcc-amber: #8e6f43;
	--evcc-ink: #22303c;
	--evcc-ink-soft: #5b6b7a;
	--evcc-line: #dfe4ea;
	--evcc-track: #e7eaed;
	--evcc-panel: #fff;
	--evcc-bg: #f4f6f8;
	--evcc-radius: 8px;
	--evcc-sticky-top: 16px;

	background: var(--evcc-bg);
	color: var(--evcc-ink);
	font: 16px/1.6 "Helvetica Neue", Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	padding-bottom: 80px;
}
/* This page doesn't load a site-wide reset (Tailwind on /energy/, tools/screen.css on the STC calculators),
 * but the shared sqheader/footer CSS assumes one: border-box sizing (the nav overflows narrower screens
 * without it), no default body margin, and the site font on body (the header and footer inherit it and
 * otherwise fall back to Times). Match what /energy/ gives them. */
body.evcc-body {
	margin: 0; background: #f4f6f8;
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; line-height: 1.5;
	-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
body.evcc-body *, body.evcc-body *::before, body.evcc-body *::after { box-sizing: border-box; }
/* Tailwind's link/button reset, limited to the shared header and footer. :where() keeps it at the same
 * low specificity as on /energy/, so the header/footer CSS still wins wherever it sets its own values. */
:where(body.evcc-body .sqheader, body.evcc-body #footer_before-v2) a { color: inherit; text-decoration: inherit; }
:where(body.evcc-body .sqheader, body.evcc-body #footer_before-v2) :is(button, input, select, textarea) {
	font-family: inherit; font-size: 100%; font-weight: inherit; line-height: inherit; color: inherit;
}
.evcc [hidden], .evcc .evcc-hidden { display: none !important; }

/* ---------- hero ---------- */
.evcc-hero { background: var(--evcc-navy); color: #fff; padding: 32px 20px 28px; margin-bottom: 28px; }
.evcc-hero-inner { max-width: 1110px; margin: 0 auto; }
.evcc .evcc-hero h1 { font-size: 28px; line-height: 1.25; font-weight: 700; margin: 0 0 6px; color: #fff; }
.evcc .evcc-hero h2 { font-size: 20px; line-height: 1.35; font-weight: 400; margin: 0 0 10px; color: #fff; opacity: .9; }
.evcc .evcc-hero p { margin: 0 0 12px; font-size: 15px; line-height: 1.5; opacity: .85; color: #fff; }
.evcc .evcc-hero p:last-child { margin-bottom: 0; }
/* The desktop site nav overhangs the top of the hero, so give the heading room below it. */
@media (min-width: 768px) {
	.evcc-hero { padding-top: 60px; }
}

/* ---------- layout ---------- */
.evcc-page { max-width: 1150px; margin: 0 auto; padding: 0 20px; }
.evcc-cols { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }

/* ---------- input groups ---------- */
.evcc-group {
	background: var(--evcc-panel); border: 1px solid var(--evcc-line); border-radius: var(--evcc-radius);
	margin: 0 0 18px; box-shadow: 0 1px 4px rgba(42, 55, 98, .06);
}
.evcc .evcc-group > h3 {
	margin: 0; padding: 14px 22px; font-size: 16px; line-height: 1.4; color: var(--evcc-navy); font-weight: 700;
	background: #f8fafc; border-bottom: 1px solid var(--evcc-line);
	border-radius: var(--evcc-radius) var(--evcc-radius) 0 0;
}
.evcc .evcc-grouphint { margin: 0; padding: 10px 22px 0; font-size: 13.5px; color: var(--evcc-ink-soft); }
.evcc-grid { display: grid; gap: 18px 22px; padding: 18px 22px 22px; }
.evcc-grouphint + .evcc-grid { padding-top: 12px; }
.evcc-grid-c1 { grid-template-columns: 1fr; }
.evcc-grid-c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.evcc-grid-c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Side-by-side fields share their label, input and help rows, so the input boxes line up even
 * when one label wraps onto two lines. */
.evcc-grid-c3 > .evcc-field { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 0; align-content: start; }
.evcc-grid-c3 > .evcc-field > :first-child { align-self: end; }

/* ---------- fields ---------- */
.evcc .evcc-field label { display: block; font-weight: 600; font-size: 14px; line-height: 1.4; margin: 0 0 6px; color: var(--evcc-ink); }
.evcc-inputwrap {
	display: flex; align-items: stretch; border: 1px solid #c8d0d8; border-radius: 6px; background: #fff; overflow: hidden;
}
.evcc-inputwrap:focus-within { border-color: var(--evcc-navy-soft); box-shadow: 0 0 0 3px rgba(67, 75, 116, .18); }
.evcc-affix {
	display: flex; align-items: center; padding: 0 11px; background: #f6f8fa; color: var(--evcc-ink-soft);
	font-size: 13px; font-weight: 600; white-space: nowrap;
}
.evcc-affix-pre { border-right: 1px solid var(--evcc-line); }
.evcc-affix-post { border-left: 1px solid var(--evcc-line); }
.evcc .evcc-inputwrap input {
	border: 0; outline: 0; padding: 10px 12px; margin: 0; font: inherit; font-size: 16px; width: 100%; min-width: 0;
	height: auto; background: none; color: var(--evcc-ink); box-shadow: none; border-radius: 0;
}
/* Hide the browser's number spinners; typing and the keyboard arrow keys still work. */
.evcc input[type=number] { -moz-appearance: textfield; appearance: textfield; }
.evcc input[type=number]::-webkit-inner-spin-button,
.evcc input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }
.evcc select {
	width: 100%; height: auto; margin: 0; padding: 10px 34px 10px 12px; font: inherit; font-size: 16px; color: var(--evcc-ink);
	border: 1px solid #c8d0d8; border-radius: 6px;
	background: #fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%235b6b7a' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 12px center / 11px 8px;
	-webkit-appearance: none; appearance: none;
}
.evcc .evcc-grid-c1 select { max-width: 360px; }
.evcc select:focus { outline: 0; border-color: var(--evcc-navy-soft); box-shadow: 0 0 0 3px rgba(67, 75, 116, .18); }
/* "No daily cap" checkbox under the allowance; the allowance box greys out while it's ticked. */
.evcc .evcc-field label.evcc-check {
	display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-weight: 600; font-size: 14px; cursor: pointer;
}
.evcc .evcc-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--evcc-navy); cursor: pointer; }
.evcc .evcc-inputwrap:has(input:disabled) { background: #f6f8fa; }
.evcc .evcc-inputwrap input:disabled { color: var(--evcc-ink-soft); cursor: not-allowed; }
.evcc .evcc-field-off { opacity: .45; }
.evcc .evcc-field-off input[type=range] { cursor: not-allowed; }
/* "Not sure?" examples bubble on the efficiency fields. Same look as the /energy/ tool's tooltips
 * (navy #2b3864, white text, outline info icon); the JS opens it on hover or tap. */
.evcc .evcc-field { position: relative; }
/* The icon follows the label's last word, even when the label wraps onto two lines. */
/* Together with the word joiner in the markup, nowrap on the row keeps the icon on the same line
 * as the label's last word; the label itself still wraps normally. */
.evcc-labelrow { margin: 0 0 6px; white-space: nowrap; line-height: 1.4; }
.evcc .evcc-labelrow label { display: inline; margin: 0 4px 0 0; white-space: normal; }
.evcc .evcc-info {
	display: inline-flex; align-items: center; justify-content: center; vertical-align: -4px;
	width: 22px; height: 22px; margin: 0; padding: 0; border: 0; border-radius: 50%;
	background: none; color: #266787; cursor: pointer; min-height: 0; float: none;
}
.evcc .evcc-info:hover, .evcc .evcc-info[aria-expanded="true"] { color: var(--evcc-navy); }
.evcc .evcc-info:focus-visible { outline: 2px solid var(--evcc-navy-soft); outline-offset: 1px; }
.evcc-tip {
	position: absolute; top: 30px; left: var(--evcc-tip-left, 0); z-index: 30;
	width: 320px; max-width: calc(100vw - 32px);
	background: #2b3864; color: #fff; border-radius: 6px; padding: 12px 14px 8px;
	font-size: 12.5px; line-height: 1.4; box-shadow: 0 8px 20px rgba(0, 0, 0, .2);
}
.evcc-tip::before {
	content: ''; position: absolute; bottom: 100%; left: var(--evcc-tip-arrow, 16px);
	border: 6px solid transparent; border-bottom-color: #2b3864;
}
.evcc .evcc-tip-title { margin: 0 0 2px; font-weight: 700; font-size: 13px; color: #fff; }
.evcc .evcc-tip-sub { margin: 0 0 6px; color: rgba(255, 255, 255, .7); font-size: 11.5px; }
.evcc-tip-table { width: 100%; border-collapse: collapse; }
.evcc-tip-table th, .evcc-tip-table td { padding: 6px 0; border-top: 1px solid rgba(255, 255, 255, .15); vertical-align: baseline; }
.evcc-tip-table th { text-align: left; font-weight: 400; color: rgba(255, 255, 255, .85); padding-right: 12px; }
.evcc-tip-table th strong { color: #fff; }
.evcc-tip-table td { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.evcc .evcc-help { margin: 6px 0 0; font-size: 12.5px; color: var(--evcc-ink-soft); line-height: 1.45; }
.evcc .evcc-derived { margin: 6px 0 0; font-size: 12.5px; color: var(--evcc-navy); font-weight: 600; }

/* ---------- sliders ---------- */
.evcc-sliderhead { display: flex; align-items: baseline; gap: 8px; margin-bottom: 2px; }
.evcc .evcc-sliderhead label { margin: 0; }
.evcc-val {
	font-weight: 700; color: var(--evcc-navy); font-variant-numeric: tabular-nums;
	background: #eef2f6; border-radius: 6px; padding: 1px 8px; font-size: 14px;
}
.evcc input[type=range] {
	-webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: none; margin: 4px 0 0; padding: 0; border: 0; cursor: pointer;
}
.evcc input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: var(--evcc-rangebg, var(--evcc-track)); }
.evcc input[type=range]::-moz-range-track { height: 6px; border-radius: 99px; background: var(--evcc-rangebg, var(--evcc-track)); }
.evcc input[type=range]::-webkit-slider-thumb {
	-webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%;
	background: var(--evcc-navy); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); margin-top: -7px;
}
.evcc input[type=range]::-moz-range-thumb {
	width: 14px; height: 14px; border-radius: 50%; background: var(--evcc-navy); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}
.evcc input[type=range]:focus { outline: 0; }
.evcc input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(67, 75, 116, .3); }
.evcc input[type=range]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(67, 75, 116, .3); }
.evcc-ends { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--evcc-ink-soft); margin-top: -2px; }
.evcc .evcc-gloss {
	margin: 8px 0 0; font-size: 13.5px; font-weight: 600; color: var(--evcc-navy);
	background: #eef2f6; border-radius: 6px; padding: 8px 11px; line-height: 1.4;
}

/* ---------- results ---------- */
.evcc-results { position: sticky; top: var(--evcc-sticky-top); }
.evcc-rescard {
	background: var(--evcc-panel); border: 1px solid var(--evcc-line); border-radius: var(--evcc-radius);
	overflow: hidden; box-shadow: 0 2px 10px rgba(42, 55, 98, .08);
}
.evcc-rescard-header { background: var(--evcc-navy); color: #fff; padding: 16px 22px; }
.evcc .evcc-rescard-header h3 { margin: 0 0 2px; font-size: 17px; line-height: 1.4; font-weight: 700; color: #fff; }
.evcc .evcc-rescard-header p { margin: 0; font-size: 12.5px; opacity: .75; color: #fff; }
.evcc-rescard-body { padding: 20px 22px 18px; }
.evcc-headline {
	background: #f1fcf4; border-left: 4px solid var(--evcc-green); border-radius: 6px;
	padding: 11px 13px; margin: 0 0 18px; font-size: 14px; line-height: 1.45;
}
.evcc-headline strong { color: var(--evcc-green-dark); }
.evcc-bar { margin-bottom: 16px; }
.evcc-bar:last-child { margin-bottom: 6px; }
.evcc-barhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 5px; }
.evcc-barname { font-weight: 600; font-size: 14px; }
.evcc-baramt { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px; white-space: nowrap; }
.evcc-track { height: 9px; border-radius: 99px; background: var(--evcc-track); overflow: hidden; }
.evcc-track-zero {
	background: repeating-linear-gradient(135deg, #d6f6df 0 5px, #f1fcf4 5px 10px);
	box-shadow: inset 3px 0 0 var(--evcc-green);
}
.evcc-fill { height: 100%; border-radius: 99px; transition: width .25s ease; }
.evcc-fill-ev { background: var(--evcc-green); }
.evcc-fill-free { background: var(--evcc-green-free); }
.evcc-fill-petrol { background: var(--evcc-orange); }
.evcc .evcc-detail { margin: 5px 0 0; font-size: 12px; color: var(--evcc-ink-soft); line-height: 1.4; }
.evcc .evcc-detail-warn { color: var(--evcc-amber); }
.evcc-alert { color: var(--evcc-orange); font-weight: 700; }
.evcc-cheapest {
	display: inline-block; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
	color: var(--evcc-green-dark); background: #d6f6df; border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: 2px;
}
.evcc .evcc-caveat {
	margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--evcc-line);
	font-size: 11.5px; color: var(--evcc-ink-soft); line-height: 1.5;
}

/* ---------- footer copy ---------- */
.evcc-footer-copy {
	margin-top: 32px; padding: 28px 26px;
	background: var(--evcc-panel); border: 1px solid var(--evcc-line); border-radius: var(--evcc-radius);
	box-shadow: 0 1px 4px rgba(42, 55, 98, .06);
}
.evcc .evcc-footer-copy p { margin: 0 0 14px; font-size: 15px; line-height: 1.65; color: var(--evcc-ink); }
.evcc .evcc-footer-copy p:last-child { margin-bottom: 0; }
.evcc .evcc-footer-copy a { color: var(--evcc-navy); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.evcc .evcc-footer-copy a:hover { color: var(--evcc-orange); }

/* ---------- mobile sticky summary ---------- */
.evcc-stickybar { display: none; }

/* On desktop the site nav is pinned to the top (0-60px) once the page scrolls (body.down, set by
 * the page script; see sqheader.css), so the sticky results card sits 16px below it. */
@media (min-width: 981px) {
	body.down .evcc { --evcc-sticky-top: 76px; }
}

@media (max-width: 980px) {
	.evcc-cols { grid-template-columns: 1fr; }
	.evcc-results { position: static; }
	.evcc .evcc-stickybar {
		display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
		position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 20;
		background: var(--evcc-navy); color: #fff; text-decoration: none;
		border-radius: 10px; padding: 11px 14px; box-shadow: 0 6px 20px rgba(15, 32, 50, .28); font-size: 13.5px;
	}
	.evcc-sb-main { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
	.evcc-sb-main b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
	.evcc-sb-main em { font-style: normal; font-weight: 700; font-size: 16px; color: #8ce4aa; }
	.evcc-sb-vs { opacity: .75; }
	.evcc-sb-vs b { font-weight: 600; }
	.evcc-sb-go { margin-left: auto; color: #fdc6a2; font-weight: 600; white-space: nowrap; }
	body.evcc-body { padding-bottom: 70px; }
}

@media (max-width: 700px) {
	.evcc-grid-c2, .evcc-grid-c3 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
	.evcc-hero { padding: 24px 16px 22px; margin-bottom: 20px; }
	.evcc .evcc-hero h1 { font-size: 24px; }
	.evcc .evcc-hero h2 { font-size: 18px; }
	.evcc-page { padding: 0 16px; }
	.evcc .evcc-group > h3, .evcc .evcc-grouphint { padding-left: 16px; padding-right: 16px; }
	.evcc-grid { padding-left: 16px; padding-right: 16px; }
	.evcc-rescard-header, .evcc-rescard-body { padding-left: 16px; padding-right: 16px; }
	.evcc-footer-copy { padding: 22px 18px; }
}

@media (prefers-reduced-motion: reduce) {
	.evcc-fill { transition: none; }
}
