/* Spartan Quote calculators. Inherits the theme's fonts; one accent colour from Settings. */
.spq {
	--spq-accent: #1f3a5f;
	--spq-text: inherit;
	--spq-muted: #5b6473;
	--spq-border: #cfd5dd;
	--spq-surface: #ffffff;
	--spq-soft: #f4f6f9;
	--spq-danger: #b42318;
	--spq-radius: 10px;
	box-sizing: border-box;
	max-width: 1100px;
	margin: 1.5em 0;
	color: var(--spq-text);
	line-height: 1.5;
}
.spq *, .spq *::before, .spq *::after { box-sizing: inherit; }
.spq [hidden] { display: none !important; }

.spq-title { margin: 0 0 .35em; }
.spq-intro { margin: 0 0 1.25em; color: var(--spq-muted); }

.spq-form, .spq-gate-form, .spq-builder-form, .spq-result, .spq-summary {
	background: var(--spq-surface);
	border: 1px solid var(--spq-border);
	border-radius: var(--spq-radius);
	padding: 1.25em 1.25em 1em;
}
.spq-simple { max-width: 560px; }
.spq-gate { max-width: 620px; }

.spq-field { margin: 0 0 1em; }
.spq-label { display: block; font-weight: 600; margin: 0 0 .3em; padding: 0; }
.spq input[type="text"], .spq input[type="email"], .spq input[type="number"], .spq select {
	width: 100%;
	max-width: 100%;
	min-height: 44px;
	padding: .55em .7em;
	border: 1px solid var(--spq-border);
	border-radius: 8px;
	background: #fff;
	color: inherit;
	font: inherit;
}
.spq input:focus-visible, .spq select:focus-visible, .spq button:focus-visible, .spq a:focus-visible {
	outline: 3px solid var(--spq-accent);
	outline-offset: 2px;
}
.spq [aria-invalid="true"], .spq .spq-invalid input, .spq .spq-invalid select { border-color: var(--spq-danger); }
.spq-help { margin: .3em 0 0; font-size: .9em; color: var(--spq-muted); }

.spq-check { display: flex; gap: .6em; align-items: flex-start; cursor: pointer; font-weight: normal; }
.spq-check input { margin-top: .3em; width: 1.1em; height: 1.1em; flex: 0 0 auto; accent-color: var(--spq-accent); }
.spq-radios { border: 0; margin: 0; padding: 0; }
.spq-radios .spq-check { margin: .35em 0; }

.spq-group { border: 0; border-top: 1px solid var(--spq-border); margin: 0 0 .5em; padding: 1em 0 0; min-width: 0; }
.spq-group:first-of-type { border-top: 0; padding-top: 0; }
.spq-group > legend { font-weight: 700; font-size: 1.05em; padding: 0 0 .6em; }

.spq-channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .6em .9em; }
.spq-channel label { display: block; font-size: .95em; margin-bottom: .2em; }

.spq-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: .6em 1.2em;
	border: 2px solid var(--spq-accent);
	border-radius: 8px;
	background: var(--spq-accent);
	color: #fff;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}
.spq-button:hover { filter: brightness(1.1); color: #fff; }
.spq-button[disabled] { opacity: .6; cursor: progress; }
.spq-button--secondary { background: transparent; color: var(--spq-accent); }
.spq-button--secondary:hover { color: var(--spq-accent); background: var(--spq-soft); }
.spq-link { background: none; border: 0; padding: 0; color: var(--spq-accent); text-decoration: underline; cursor: pointer; font: inherit; }

.spq-error { margin: .9em 0 0; padding: .7em .9em; border-radius: 8px; background: #fef3f2; color: var(--spq-danger); border: 1px solid #fecdca; }
.spq-is-busy .spq-button[type="submit"] { opacity: .6; }

/* Honeypot: visually hidden, not display:none (some bots skip hidden fields). */
.spq-hp { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Simple result */
.spq-result { margin-top: 1em; background: var(--spq-soft); outline: none; }
.spq-from { font-size: 1.15em; margin: 0 0 .2em; }
.spq-amount { font-size: 1.9em; color: var(--spq-accent); }
.spq-from-monthly { margin: 0 0 .8em; }
.spq-bespoke { font-weight: 600; }
.spq-note { color: var(--spq-muted); font-size: .92em; }
.spq-cta, .spq-actions { display: flex; flex-wrap: wrap; gap: .6em; margin-top: 1em; }

/* Detailed layout: one column with a sticky total bar when space is tight (phones, narrow
   theme content areas); two columns with a sticky summary when the form has room. The switch
   follows the width the calculator actually gets, not the screen width. */
.spq-detailed { container-type: inline-size; container-name: spq; }
.spq-columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25em; align-items: start; }
.spq-totalbar {
	position: sticky;
	bottom: 0;
	z-index: 5;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: .25em .75em;
	padding: .75em 1em;
	border-radius: var(--spq-radius) var(--spq-radius) 0 0;
	background: var(--spq-accent);
	color: #fff;
	box-shadow: 0 -4px 14px rgba(0, 0, 0, .12);
}
.spq-totalbar-amount { font-size: 1.25em; }
.spq-totalbar-link { margin-left: auto; color: #fff; text-decoration: underline; }
.spq-totalbar-link:hover { color: #fff; }
@container spq (min-width: 760px) {
	.spq-columns { grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); }
	.spq-summary { position: sticky; top: 1.25em; }
	.spq-totalbar { display: none !important; }
}
@supports not (container-type: inline-size) {
	@media (min-width: 1000px) {
		.spq-columns { grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); }
		.spq-summary { position: sticky; top: 1.25em; }
		.spq-totalbar { display: none !important; }
	}
}
.spq-summary { background: var(--spq-soft); }
.spq-summary-title { margin: 0 0 .6em; }
.spq-summary-empty, .spq-summary-status { color: var(--spq-muted); }
.spq-summary.spq-is-busy .spq-summary-body { opacity: .55; transition: opacity .15s; }
.spq-lines { width: 100%; border-collapse: collapse; margin: 0 0 .8em; font-size: .95em; }
.spq-lines th, .spq-lines td { padding: .45em 0; border-bottom: 1px solid var(--spq-border); vertical-align: top; text-align: left; font-weight: normal; }
.spq-lines td { text-align: right; white-space: nowrap; padding-left: 1em; }
.spq-neg { color: #067647; }
.spq-badge { display: inline-block; font-size: .78em; padding: .05em .45em; border-radius: 99px; background: #fff; border: 1px solid var(--spq-border); color: var(--spq-muted); }
.spq-totals { margin: 0; }
.spq-total { display: flex; justify-content: space-between; gap: 1em; padding: .25em 0; }
.spq-total dt { margin: 0; }
.spq-total dd { margin: 0; font-variant-numeric: tabular-nums; }
.spq-total--main { flex-wrap: wrap; font-size: 1.2em; font-weight: 700; border-top: 2px solid var(--spq-accent); padding-top: .5em; margin-top: .2em; }
.spq-total--main dd { color: var(--spq-accent); }
.spq-notes { margin: .9em 0 0; padding-left: 1.1em; font-size: .88em; color: var(--spq-muted); }
.spq-notes li { margin: .25em 0; }
.spq-is-bespoke .spq-notes li:first-child { color: inherit; font-weight: 600; }
.spq-request-message { margin: .8em 0 0; font-weight: 600; }
.spq-breakdown-note { margin: .9em 0 0; font-weight: 600; }

/* Instant estimate: what it covers, the breakdown request and the detailed-quote link */
.spq-scope { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .3em .6em; align-items: baseline; margin: .2em 0 .6em; font-size: .95em; }
.spq-scope-row { display: contents; }
.spq-scope-label { font-weight: 600; }
.spq-inline-list { display: inline; margin: 0; padding: 0; list-style: none; overflow-wrap: anywhere; }
.spq-inline-list li { display: inline; }
.spq-inline-list li:not(:last-child)::after { content: "\00a0\00B7"; color: var(--spq-muted); }
.spq-breakdown-form { margin-top: 1em; padding: 1em 1.1em .9em; border: 1px solid var(--spq-border); border-radius: var(--spq-radius); background: var(--spq-surface); }
.spq-breakdown-intro { margin: 0 0 .8em; font-weight: 600; }
.spq-detailed-link { margin: 1em 0 0; font-size: .95em; }
.spq-oneoff-note { margin: .5em 0 0; font-size: .92em; color: var(--spq-muted); }
