/**
 * Quote form and consent banner.
 *
 * Colours come from the theme's custom properties, with safe fallbacks so the
 * form still looks correct if the plugin is used with another theme.
 */

.psc-form-wrap {
	--psc-form-radius: var(--psc-radius, 10px);
	--psc-form-border: var(--psc-border, #d3dce3);
	--psc-form-ink: var(--psc-ink, #10242f);
	--psc-form-muted: var(--psc-muted, #52636f);
	--psc-form-accent: var(--psc-accent, #0073a9);
	--psc-form-error: var(--psc-error, #a4231c);
	--psc-form-surface: var(--psc-surface, #ffffff);

	color: var(--psc-form-ink);
}

.psc-form__title {
	margin: 0 0 0.75rem;
}

.psc-form__alert {
	background: #fdf1f0;
	border: 1px solid var(--psc-form-error);
	border-left-width: 4px;
	border-radius: var(--psc-form-radius);
	color: #6d1713;
	margin-bottom: 1.25rem;
	padding: 0.875rem 1rem;
}

.psc-form__alert p {
	margin: 0;
	font-weight: 600;
}

.psc-form__alert:focus {
	outline: 3px solid var(--psc-form-error);
	outline-offset: 2px;
}

.psc-form__grid {
	display: grid;
	gap: 1rem;
	grid-template-columns: 1fr;
}

@media (min-width: 40em) {
	.psc-form__grid {
		grid-template-columns: repeat(4, 1fr);
	}

	.psc-field {
		grid-column: span 4;
	}

	.psc-field--half {
		grid-column: span 2;
	}

	.psc-field--quarter {
		grid-column: span 1;
	}

	.psc-field--full {
		grid-column: span 4;
	}
}

.psc-field__label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.25rem;
}

.psc-field__help {
	color: var(--psc-form-muted);
	font-size: 0.875rem;
	margin: 0 0 0.375rem;
}

.psc-field__control {
	background: var(--psc-form-surface);
	border: 1px solid var(--psc-form-border);
	border-radius: var(--psc-form-radius);
	color: inherit;
	font: inherit;
	padding: 0.7rem 0.8rem;
	width: 100%;
}

textarea.psc-field__control {
	min-height: 6rem;
	resize: vertical;
}

.psc-field__control:focus-visible,
.psc-consent input:focus-visible {
	outline: 3px solid var(--psc-form-accent);
	outline-offset: 2px;
}

.psc-field--error .psc-field__control {
	border-color: var(--psc-form-error);
	border-width: 2px;
}

.psc-field__error {
	align-items: center;
	color: var(--psc-form-error);
	display: flex;
	font-size: 0.9rem;
	font-weight: 600;
	gap: 0.35rem;
	margin: 0.35rem 0 0;
}

.psc-field__control--file {
	padding: 0.6rem;
}

.psc-upload-unavailable {
	background: #fff6df;
	border-left: 4px solid #b87400;
	margin: 0;
	padding: 0.75rem 0.875rem;
}

.psc-required {
	color: var(--psc-form-error);
	margin-left: 0.15rem;
}

.psc-consent {
	align-items: flex-start;
	display: flex;
	gap: 0.6rem;
}

.psc-consent input[type="checkbox"] {
	flex: 0 0 auto;
	height: 1.25rem;
	margin-top: 0.15rem;
	width: 1.25rem;
}

.psc-consent label {
	font-size: 0.95rem;
	line-height: 1.5;
}

.psc-field--consent {
	margin-top: 1rem;
}

.psc-form__hp {
	height: 0;
	left: -9999px;
	overflow: hidden;
	position: absolute;
	width: 0;
}

.psc-form__actions {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
	margin-top: 1.25rem;
}

.psc-form__note {
	color: var(--psc-form-muted);
	font-size: 0.9rem;
	margin: 0;
	max-width: 42ch;
}

.psc-form__submit[disabled] {
	cursor: progress;
	opacity: 0.7;
}

/* Home-page multi-step estimate --------------------------------------- */

.psc-form-step[hidden] {
	display: none;
}

.psc-form-step h2 {
	font-size: clamp(1.55rem, 4vw, 2.2rem);
	line-height: 1.05;
	margin: 0.4rem 0 1rem;
}

.card-step {
	color: var(--psc-form-muted);
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.service-options {
	display: grid;
	gap: 0.55rem;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.service-option {
	min-width: 0;
}

.service-option .psc-field__control {
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

.service-option label {
	align-items: center;
	background: transparent;
	border: 1px solid var(--psc-form-border);
	border-radius: var(--psc-form-radius);
	cursor: pointer;
	display: flex;
	font-weight: 650;
	min-height: 3.25rem;
	padding: 0.7rem 0.75rem;
}

.service-option input:checked + label {
	background: #e9f7fc;
	border-color: var(--psc-form-accent);
	box-shadow: inset 0 0 0 1px var(--psc-form-accent);
}

.service-option input:focus-visible + label {
	outline: 3px solid var(--psc-form-accent);
	outline-offset: 2px;
}

.price-preview {
	align-items: center;
	background: transparent;
	border-radius: 0;
	border-top: 1px solid var(--psc-form-border);
	color: inherit;
	display: flex;
	gap: 1rem;
	justify-content: space-between;
	margin-top: 1rem;
	padding: 1rem;
}

.price-preview span,
.price-preview p {
	display: block;
	font-size: 0.78rem;
	margin: 0;
	opacity: 0.82;
}

.price-preview strong {
	display: block;
	font-size: 1.45rem;
	line-height: 1.15;
	margin: 0.15rem 0 0.2rem;
}

.arrow-button {
	align-items: center;
	background: var(--psc-form-accent);
	border: 0;
	border-radius: 0;
	color: #fff;
	cursor: pointer;
	display: flex;
	flex: 0 0 3rem;
	font: inherit;
	font-size: 1.5rem;
	height: 3rem;
	justify-content: center;
}

.arrow-button:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

.psc-step-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	justify-content: space-between;
	margin-top: 1.25rem;
}

@media (max-width: 30em) {
	.service-options {
		grid-template-columns: 1fr;
	}

	.price-preview {
		align-items: flex-end;
	}

	.psc-step-actions .psc-btn {
		min-height: 2.75rem;
	}
}

/* Consent banner ------------------------------------------------------- */

.psc-consent-banner {
	background: var(--psc-surface, #ffffff);
	border-top: 3px solid var(--psc-accent, #0073a9);
	bottom: 0;
	box-shadow: 0 -6px 24px rgba(4, 40, 59, 0.18);
	left: 0;
	position: fixed;
	right: 0;
	z-index: 1200;
}

.psc-consent-banner[hidden] {
	display: none;
}

.psc-consent-banner__inner {
	margin: 0 auto;
	max-width: 62rem;
	padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom));
}

.psc-consent-banner__title {
	font-size: 1rem;
	margin: 0 0 0.35rem;
}

.psc-consent-banner__text {
	color: var(--psc-muted, #52636f);
	font-size: 0.9rem;
	margin: 0 0 0.75rem;
}

.psc-consent-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
}

/* Bottom spacing so the sticky mobile bar never covers the banner. */
@media (max-width: 47.99em) {
	.psc-consent-banner {
		bottom: var(--psc-sticky-height, 0px);
	}
}

.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	position: absolute !important;
	white-space: nowrap;
	width: 1px;
}
