/* Estimate Flow: styles. Accent colour comes from --ef-accent (set inline from Settings). */

.ef-root,
.ef-modal {
	--ef-accent: #434343CC;
	--ef-ink: #222;
	--ef-muted: #787b7f;
	--ef-line: #dcdee0;
	--ef-error: #b3261e;
	font-family: Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--ef-ink);
	-webkit-font-smoothing: antialiased;
	line-height: 1.4;
}

.ef-root *,
.ef-modal * {
	box-sizing: border-box;
	font-family: inherit;
}

.ef-root {
	max-width: 940px;
	margin: 0 auto;
	padding: 8px 12px 24px;
}

/* ---- Heading ---- */

.ef-root .ef-head {
	text-align: center;
	margin-bottom: 18px;
}

.ef-root .ef-title {
	margin: 0 0 4px;
	font-size: 24px;
	font-weight: 400;
	line-height: 1.3;
	color: var(--ef-ink);
	letter-spacing: 0;
}

.ef-root .ef-title strong {
	font-weight: 700;
	color: var(--ef-accent);
}

.ef-root .ef-sub {
	margin: 0 0 14px;
	font-size: 15px;
	color: var(--ef-muted);
}

.ef-root .ef-step,
.ef-modal .ef-step {
	margin: 0;
	font-size: 14px;
	letter-spacing: 0.02em;
	color: var(--ef-ink);
}

.ef-root .ef-step b,
.ef-modal .ef-step b {
	font-weight: 700;
	color: var(--ef-accent);
}

/* ---- Card ---- */

.ef-root .ef-card {
	display: grid;
	grid-template-columns: 1fr 1fr;
	background: #fff;
	border: 1px solid var(--ef-line);
	border-radius: 8px;
	overflow: hidden;
	min-height: 380px;
}

.ef-root .ef-left {
	display: flex;
	flex-direction: column;
	padding: 24px 26px;
}

.ef-root .ef-group + .ef-group {
	margin-top: 26px;
}

.ef-root .ef-label {
	margin: 0 0 12px;
	font-size: 16px;
	font-weight: 400;
	color: var(--ef-ink);
}

.ef-root .ef-chips {
	display: grid;
	gap: 10px;
}

.ef-root .ef-chips-plan {
	grid-template-columns: repeat(4, 1fr);
}

.ef-root .ef-chips-purpose {
	grid-template-columns: repeat(3, 1fr);
}

/* Chips: written with extra specificity so the active theme's button styles cannot override them. */

.ef-root button.ef-chip {
	appearance: none;
	-webkit-appearance: none;
	min-height: 38px;
	margin: 0;
	padding: 0 8px;
	font-size: 14px;
	font-weight: 400;
	line-height: 1;
	text-transform: none;
	letter-spacing: 0;
	text-align: center;
	color: var(--ef-accent);
	background: #fff;
	border: 1px solid var(--ef-accent);
	border-radius: 4px;
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.ef-root button.ef-chip:hover {
	color: var(--ef-accent);
	background: rgba(0, 0, 0, 0.05);
	border-color: var(--ef-accent);
}

.ef-root button.ef-chip:focus-visible {
	outline: 2px solid var(--ef-accent);
	outline-offset: 2px;
}

.ef-root button.ef-chip[aria-pressed="true"],
.ef-root button.ef-chip[aria-pressed="true"]:hover,
.ef-root button.ef-chip[aria-pressed="true"]:focus {
	color: #fff;
	background: var(--ef-accent);
	border-color: var(--ef-accent);
}

/* ---- Primary buttons (Next, Get estimate, Close) ---- */

.ef-root button.ef-next,
.ef-modal button.ef-submit {
	appearance: none;
	-webkit-appearance: none;
	display: block;
	width: 100%;
	height: 46px;
	margin: 0;
	padding: 0 16px;
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-align: center;
	color: #fff;
	background: var(--ef-accent);
	border: 0;
	border-radius: 3px;
	box-shadow: none;
	cursor: pointer;
}

.ef-root button.ef-next:hover,
.ef-root button.ef-next:focus,
.ef-modal button.ef-submit:hover,
.ef-modal button.ef-submit:focus {
	color: #fff;
	background: var(--ef-accent);
	filter: brightness(0.9);
}

.ef-root button.ef-next:focus-visible,
.ef-modal button.ef-submit:focus-visible {
	outline: 2px solid var(--ef-accent);
	outline-offset: 2px;
}

.ef-root button.ef-next {
	margin-top: auto;
}

.ef-root button.ef-next:disabled,
.ef-modal button.ef-submit:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	filter: none;
}

.ef-root .ef-left > .ef-group:last-of-type {
	margin-bottom: 28px;
}

/* ---- Preview panel ---- */

.ef-root .ef-right {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 24px 64px;
	border-left: 1px solid var(--ef-line);
	background: #fff;
}

.ef-root .ef-preview {
	width: 100%;
	max-width: 340px;
	opacity: 1;
	transition: opacity 0.25s ease;
}

.ef-root .ef-preview.ef-faint {
	opacity: 0.3;
}

.ef-root .ef-preview svg {
	display: block;
	width: 100%;
	height: auto;
	max-height: 260px;
}

.ef-root .ef-brand {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 24px;
	margin: 0;
	text-align: center;
	font-size: 16px;
	color: #c3c6c9;
}

/* ---- Popup ---- */

.ef-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
}

.ef-modal[hidden] {
	display: none;
}

.ef-modal .ef-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.ef-modal .ef-dialog {
	position: relative;
	width: 100%;
	max-width: 420px;
	max-height: calc(100vh - 24px);
	overflow-y: auto;
	padding: 18px 26px 22px;
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
	animation: ef-pop 0.18s ease-out;
}

.ef-modal .ef-dialog:focus {
	outline: none;
}

@keyframes ef-pop {
	from {
		opacity: 0;
		transform: translateY(8px) scale(0.98);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.ef-modal .ef-dtop {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	margin-bottom: 14px;
}

.ef-modal button.ef-back {
	appearance: none;
	-webkit-appearance: none;
	justify-self: start;
	margin: 0;
	padding: 4px 0;
	font-size: 14px;
	font-weight: 400;
	line-height: 1;
	text-transform: none;
	letter-spacing: 0;
	color: var(--ef-accent);
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
}

.ef-modal button.ef-back:hover,
.ef-modal button.ef-back:focus {
	color: var(--ef-accent);
	background: transparent;
	text-decoration: underline;
}

.ef-modal button.ef-back:focus-visible {
	outline: 2px solid var(--ef-accent);
	outline-offset: 2px;
}

.ef-modal .ef-back span {
	font-size: 18px;
	margin-right: 2px;
}

.ef-modal .ef-dtitle {
	margin: 0 0 12px;
	text-align: center;
	font-size: 24px;
	font-weight: 400;
	line-height: 1.3;
	color: var(--ef-ink);
	letter-spacing: 0;
}

.ef-modal .ef-field {
	margin-bottom: 4px;
}

.ef-modal .ef-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Underline-style inputs */

.ef-modal .ef-form input.ef-input,
.ef-modal .ef-form select.ef-input {
	appearance: none;
	-webkit-appearance: none;
	display: block;
	width: 100%;
	height: 48px;
	margin: 0;
	padding: 12px 0 8px;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.2;
	color: var(--ef-ink);
	background-color: transparent;
	border: 0;
	border-bottom: 1px solid var(--ef-line);
	border-radius: 0;
	box-shadow: none;
}

.ef-modal .ef-form input.ef-input::placeholder {
	color: #8a8d91;
	opacity: 1;
}

.ef-modal .ef-form input.ef-input:focus,
.ef-modal .ef-form select.ef-input:focus {
	outline: none;
	color: var(--ef-ink);
	background-color: transparent;
	border-bottom: 2px solid var(--ef-accent);
	padding-bottom: 7px;
}

.ef-modal .ef-form .ef-invalid input.ef-input,
.ef-modal .ef-form .ef-invalid select.ef-input {
	border-bottom-color: var(--ef-error);
}

.ef-modal .ef-form select.ef-select {
	padding-right: 28px;
	cursor: pointer;
	color: #8a8d91;
	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='%23666' stroke-width='1.6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 4px center;
}

.ef-modal .ef-form select.ef-select.ef-has-value {
	color: var(--ef-ink);
}

.ef-modal .ef-phone {
	display: flex;
	align-items: flex-end;
	border-bottom: 1px solid var(--ef-line);
}

.ef-modal .ef-field.ef-invalid .ef-phone {
	border-bottom-color: var(--ef-error);
}

.ef-modal .ef-phone:focus-within {
	border-bottom: 2px solid var(--ef-accent);
}

.ef-modal .ef-phone .ef-cc {
	display: flex;
	align-items: center;
	gap: 6px;
	height: 48px;
	padding: 12px 10px 8px 0;
	font-size: 15px;
	color: var(--ef-ink);
}

.ef-modal .ef-form .ef-phone input.ef-input,
.ef-modal .ef-form .ef-phone input.ef-input:focus {
	border-bottom: 0;
	padding-bottom: 8px;
}

.ef-modal .ef-err {
	min-height: 0;
	margin: 4px 0 0;
	font-size: 12px;
	color: var(--ef-error);
}

.ef-modal .ef-err:empty {
	display: none;
}

/* WhatsApp toggle */

.ef-modal label.ef-toggle {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 10px 0 8px;
	font-size: 12px;
	font-weight: 700;
	color: #333;
	cursor: pointer;
}

.ef-modal .ef-toggle input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
}

.ef-modal .ef-switch {
	position: relative;
	flex: none;
	width: 40px;
	height: 22px;
	background: #c9cbce;
	border-radius: 11px;
	transition: background-color 0.15s ease;
}

.ef-modal .ef-switch::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 18px;
	height: 18px;
	background: #fff;
	border-radius: 50%;
	transition: transform 0.15s ease;
}

.ef-modal .ef-toggle input:checked + .ef-switch {
	background: var(--ef-accent);
}

.ef-modal .ef-toggle input:checked + .ef-switch::after {
	transform: translateX(18px);
}

.ef-modal .ef-toggle input:focus-visible + .ef-switch {
	outline: 2px solid var(--ef-accent);
	outline-offset: 2px;
}

/* Honeypot: hidden from people, visible to bots */

.ef-modal .ef-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.ef-modal button.ef-submit {
	margin-top: 18px;
}

.ef-modal .ef-formerr {
	margin: 10px 0 0;
	text-align: center;
	font-size: 13px;
	color: var(--ef-error);
}

.ef-modal .ef-formerr:empty {
	display: none;
}

.ef-modal .ef-note {
	margin: 12px 0 0;
	text-align: center;
	font-size: 11px;
	line-height: 1.5;
	color: var(--ef-muted);
}

.ef-modal .ef-done {
	padding: 24px 0 6px;
	text-align: center;
}

.ef-modal .ef-done[hidden] {
	display: none;
}

.ef-modal .ef-done-text {
	margin: 0 0 22px;
	font-size: 15px;
	color: var(--ef-muted);
}

body.ef-lock {
	overflow: hidden;
}

/* ---- Small screens ---- */

@media (max-width: 720px) {
	.ef-root .ef-card {
		grid-template-columns: 1fr;
		min-height: 0;
	}

	.ef-root .ef-right {
		border-left: 0;
		border-top: 1px solid var(--ef-line);
		padding: 20px 20px 56px;
	}

	.ef-root .ef-brand {
		bottom: 16px;
	}

	.ef-root .ef-chips-plan {
		grid-template-columns: repeat(2, 1fr);
	}

	.ef-root .ef-title {
		font-size: 21px;
	}

	.ef-modal .ef-dialog {
		padding: 16px 20px 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ef-modal .ef-dialog {
		animation: none;
	}

	.ef-root .ef-preview,
	.ef-root button.ef-chip,
	.ef-modal .ef-switch,
	.ef-modal .ef-switch::after {
		transition: none;
	}
}


/* =========================================================================
   v2.3: two pages. Page 1 is the card, page 2 is the form (centred, same
   size as before). Filling page 1 slides it out to the left and the form
   slides in from the right. Submitting goes to the thank-you page.
   ========================================================================= */

.ef-root .ef-stage {
	position: relative;
	overflow: hidden;
	transition: height 0.45s ease;
}

/* page 1 */
.ef-root .ef-stage > .ef-card {
	transition: transform 0.45s ease, opacity 0.35s ease, visibility 0s linear 0s;
}

.ef-root.ef-split .ef-stage > .ef-card {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	transform: translateX(-110%);
	opacity: 0;
	visibility: hidden;
	transition: transform 0.45s ease, opacity 0.35s ease, visibility 0s linear 0.45s;
}

/* page 2: the form, centred, same size as the old popup */
.ef-root .ef-modal {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: auto;
	z-index: auto;
	display: block;
	width: 100%;
	max-width: 420px;
	margin: 0 auto;
	padding: 0;
	transform: translateX(110vw);
	opacity: 0;
	visibility: hidden;
	transition: transform 0.45s ease, opacity 0.35s ease, visibility 0s linear 0.45s;
}

.ef-root .ef-modal[hidden] {
	display: none;
}

.ef-root .ef-modal.ef-open {
	position: relative;
	transform: none;
	opacity: 1;
	visibility: visible;
	transition: transform 0.45s ease, opacity 0.35s ease, visibility 0s linear 0s;
}

.ef-root .ef-modal .ef-backdrop {
	display: none;
}

.ef-root .ef-modal .ef-dialog {
	width: 100%;
	max-width: 420px;
	max-height: none;
	overflow: visible;
	margin: 0 auto;
	border: 1px solid var(--ef-line);
	border-radius: 8px;
	box-shadow: none;
	animation: none;
}

/* the form's top row only holds the Back link now */
.ef-root .ef-modal .ef-dtop {
	display: flex;
	justify-content: flex-start;
}

/* the heading's step counter follows the page (JS sets it), Next is not needed on page 2 */
.ef-root.ef-split button.ef-next {
	display: none;
}

@media (prefers-reduced-motion: reduce) {
	.ef-root .ef-stage,
	.ef-root .ef-stage > .ef-card,
	.ef-root .ef-modal,
	.ef-root .ef-modal.ef-open {
		transition: none;
	}
}
