/* PoolLoom Estimator — front-end styles */

.pl-estimator {
	--pl-est-ink: var(--wp--preset--color--navy, #061f2b);
	--pl-est-ink-deep: var(--wp--preset--color--ink, #03151e);
	--pl-est-cream: var(--wp--preset--color--cream, #f7f5ef);
	--pl-est-mist: var(--wp--preset--color--mist, #e8f3f1);
	--pl-est-teal: var(--wp--preset--color--teal, #006f6a);
	--pl-est-aqua: var(--wp--preset--color--aqua, #50e3d2);
	--pl-est-line: var(--wp--preset--color--line, #d7e0dd);
	--pl-est-slate: var(--wp--preset--color--slate, #51656b);
	--pl-est-radius: 16px;
	--pl-est-control: 8px;
	color: var(--pl-est-ink);
	font-family: var(--wp--preset--font-family--sans, Manrope, system-ui, sans-serif);
	font-size: 1rem;
	line-height: 1.6;
}

.pl-estimator *,
.pl-estimator *::before,
.pl-estimator *::after {
	box-sizing: border-box;
}

.pl-estimator__form {
	display: grid;
	gap: 24px;
}

.pl-estimator__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
	gap: 24px;
	align-items: start;
}

.pl-estimator__choices {
	display: grid;
	gap: 20px;
}

.pl-estimator__fieldset {
	margin: 0;
	padding: 0;
	border: 0;
}

.pl-estimator legend,
.pl-estimator__row label {
	display: block;
	margin-bottom: 6px;
	font-size: .82rem;
	font-weight: 600;
	line-height: 1.4;
	color: var(--pl-est-ink);
}

.pl-estimator__radio-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.pl-estimator__radio {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 10px 12px;
	border: 1px solid var(--pl-est-line);
	border-radius: var(--pl-est-control);
	background: #fff;
	cursor: pointer;
	transition: border-color 160ms ease, background-color 160ms ease;
}

.pl-estimator__radio input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.pl-estimator__radio span {
	font-size: .9rem;
	font-weight: 500;
	color: var(--pl-est-slate);
}

.pl-estimator__radio:has(input:checked) {
	border-color: var(--pl-est-teal);
	background: var(--pl-est-mist);
}

.pl-estimator__radio:has(input:focus-visible) {
	outline: 2px solid var(--pl-est-teal);
	outline-offset: 2px;
}

.pl-estimator__radio:has(input:checked) span {
	color: var(--pl-est-ink);
	font-weight: 600;
}

.pl-estimator__row {
	display: grid;
	gap: 6px;
}

.pl-estimator__row--full {
	grid-column: 1 / -1;
}

.pl-estimator select,
.pl-estimator input[type="text"],
.pl-estimator input[type="email"],
.pl-estimator input[type="tel"],
.pl-estimator textarea {
	width: 100%;
	min-height: 44px;
	padding: 10px 12px;
	border: 1px solid var(--pl-est-line);
	border-radius: var(--pl-est-control);
	background: #fff;
	color: var(--pl-est-ink);
	font: inherit;
	font-size: .92rem;
	line-height: 1.4;
}

.pl-estimator textarea {
	min-height: 104px;
	resize: vertical;
}

.pl-estimator select {
	padding-right: 36px;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2351656b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
}

.pl-estimator select:focus,
.pl-estimator input:focus,
.pl-estimator textarea:focus {
	outline: 2px solid var(--pl-est-teal);
	outline-offset: 1px;
	border-color: var(--pl-est-teal);
}

.pl-estimator select:hover,
.pl-estimator input:hover,
.pl-estimator textarea:hover {
	border-color: #b8c7c3;
}

.pl-estimator__checks {
	display: grid;
	gap: 8px;
}

.pl-estimator__check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: .9rem;
	line-height: 1.45;
	color: var(--pl-est-slate);
	cursor: pointer;
}

.pl-estimator__check input {
	width: 18px;
	height: 18px;
	margin: 1px 0 0;
	accent-color: var(--pl-est-teal);
}

.pl-estimator__summary {
	position: sticky;
	top: 96px;
	padding: 24px;
	border: 1px solid rgba(247, 245, 239, .14);
	border-radius: 12px;
	background: var(--pl-est-ink);
	color: var(--pl-est-cream);
}

.pl-estimator__summary-label {
	margin: 0 0 8px;
	font-size: .8rem;
	font-weight: 500;
	color: rgba(247, 245, 239, .62);
}

.pl-estimator__amount {
	margin: 0;
	font-family: var(--wp--preset--font-family--display, Georgia, serif);
	font-size: clamp(2.25rem, 4vw, 3.4rem);
	font-weight: 400;
	line-height: 1;
	letter-spacing: -.025em;
	color: var(--pl-est-cream);
	font-variant-numeric: tabular-nums;
}

.pl-estimator__amount.is-quote-only {
	font-family: var(--wp--preset--font-family--sans, sans-serif);
	font-size: 1.35rem;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: 0;
}

.pl-estimator__summary-note {
	margin: 14px 0 0;
	font-size: .84rem;
	line-height: 1.5;
	color: rgba(247, 245, 239, .72);
}

.pl-estimator__disclaimer {
	margin: 20px 0 0;
	padding-top: 16px;
	border-top: 1px solid rgba(247, 245, 239, .16);
	font-size: .72rem;
	line-height: 1.5;
	color: rgba(247, 245, 239, .5);
}

.pl-estimator__summary-small {
	margin: 12px 0 0;
	font-size: .72rem;
	line-height: 1.45;
	color: rgba(247, 245, 239, .58);
}

.pl-estimator__contact {
	padding-top: 24px;
	border-top: 1px solid var(--pl-est-line);
}

.pl-estimator__contact h3 {
	margin: 0 0 16px;
	font-family: var(--wp--preset--font-family--display, Georgia, serif);
	font-size: 1.5rem;
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: -.02em;
	color: var(--pl-est-ink);
}

.pl-estimator__contact-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.pl-estimator__consent {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-top: 18px;
	font-size: .8rem;
	line-height: 1.5;
	color: var(--pl-est-slate);
	cursor: pointer;
}

.pl-estimator__consent input {
	width: 18px;
	height: 18px;
	margin: 1px 0 0;
	flex: 0 0 auto;
	accent-color: var(--pl-est-teal);
}

.pl-estimator__consent a {
	color: var(--pl-est-teal);
	text-underline-offset: .16em;
}

.pl-estimator__submit-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
	margin-top: 20px;
}

.pl-estimator__submit {
	min-height: 48px;
	padding: 12px 22px;
	border: 1px solid var(--pl-est-ink);
	border-radius: 8px;
	background: var(--pl-est-ink);
	color: var(--pl-est-cream);
	font: inherit;
	font-size: .9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.pl-estimator__submit:hover {
	background: var(--pl-est-teal);
	border-color: var(--pl-est-teal);
	color: #fff;
}

.pl-estimator__submit:focus-visible {
	outline: 2px solid var(--pl-est-teal);
	outline-offset: 3px;
}

.pl-estimator__privacy-note {
	margin: 0;
	font-size: .72rem;
	color: var(--pl-est-slate);
}

.pl-estimator__hp {
	position: absolute !important;
	left: -9999px !important;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.pl-estimator__notice {
	padding: 12px 14px;
	border: 1px solid #d9a3a1;
	border-radius: 8px;
	background: #fff5f4;
	color: #6e1f1b;
	font-size: .86rem;
}

.pl-estimator__notice--error {
	margin-bottom: 16px;
}

.pl-estimator__noscript {
	margin: 12px 0 0;
	font-size: .8rem;
	color: var(--pl-est-slate);
}

/* Confirmation */
.pl-estimator--success {
	padding: 32px;
	border: 1px solid var(--pl-est-line);
	border-radius: var(--pl-est-radius);
	background: #fff;
}

.pl-estimator__success-mark {
	display: inline-grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border: 1px solid var(--pl-est-teal);
	border-radius: 50%;
	color: var(--pl-est-teal);
	font-size: 1rem;
	font-weight: 700;
}

.pl-estimator--success h3 {
	margin: 16px 0 8px;
	font-family: var(--wp--preset--font-family--display, Georgia, serif);
	font-size: clamp(1.75rem, 3vw, 2.4rem);
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: -.02em;
}

.pl-estimator--success p {
	margin: 0 0 12px;
	color: var(--pl-est-slate);
}

.pl-estimator__result {
	margin: 20px 0;
	padding: 20px;
	border: 1px solid var(--pl-est-line);
	border-radius: 12px;
	background: var(--pl-est-mist);
}

.pl-estimator__result-label {
	margin: 0 0 6px;
	font-size: .78rem;
	font-weight: 600;
	color: var(--pl-est-slate);
}

.pl-estimator__result-amount {
	margin: 0;
	font-family: var(--wp--preset--font-family--display, Georgia, serif);
	font-size: clamp(1.8rem, 3.5vw, 2.8rem);
	line-height: 1;
	letter-spacing: -.02em;
	color: var(--pl-est-ink);
	font-variant-numeric: tabular-nums;
}

.pl-estimator__result-service {
	margin: 8px 0 0;
	font-size: .8rem;
	color: var(--pl-est-slate);
}

.pl-estimator__again {
	color: var(--pl-est-teal);
	font-size: .84rem;
	font-weight: 600;
	text-underline-offset: .16em;
}

/* Fallback when the plugin block is present but the plugin is inactive */
.pl-estimator-fallback {
	padding: 24px;
	border: 1px solid var(--pl-est-line, #d7e0dd);
	border-radius: 16px;
	background: var(--pl-est-mist, #e8f3f1);
}

.pl-estimator-fallback h3 {
	margin: 0 0 8px;
	font-family: var(--wp--preset--font-family--display, Georgia, serif);
	font-size: clamp(1.6rem, 3vw, 2.2rem);
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: -.02em;
	color: var(--pl-est-ink, #061f2b);
}

.pl-estimator-fallback p {
	margin: 0 0 16px;
	color: var(--pl-est-slate, #51656b);
}

.pl-estimator-embed:has(.wp-block-poolloom-estimator) .pl-estimator-fallback {
	display: none;
}

.wp-block-poolloom-estimator {
	width: 100%;
}

/* Editor placeholder */
.pl-estimator-editor {
	padding: 24px;
	border: 1px dashed #8b9b97;
	border-radius: 12px;
	background: #f7f5ef;
}

.pl-estimator-editor__inner {
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-items: flex-start;
}

.pl-estimator-editor__icon {
	display: inline-grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #061f2b;
	color: #50e3d2;
	font-weight: 600;
}

.pl-estimator-editor p {
	margin: 0;
	color: #51656b;
	font-size: .85rem;
}

@media (max-width: 900px) {
	.pl-estimator__grid {
		grid-template-columns: 1fr;
	}

	.pl-estimator__summary {
		position: static;
		order: -1;
	}
}

@media (max-width: 600px) {
	.pl-estimator__radio-grid,
	.pl-estimator__contact-grid {
		grid-template-columns: 1fr;
	}

	.pl-estimator__summary,
	.pl-estimator--success {
		padding: 20px;
	}

	.pl-estimator__submit {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pl-estimator *,
	.pl-estimator *::before,
	.pl-estimator *::after {
		transition-duration: .01ms !important;
	}
}
