/* Eden Trees Calculator - front end */

.etc-calc {
	--etc-primary: var(--primary, #bc5523);
	--etc-primary-dark: var(--primary-dark, #843b19);
	--etc-primary-soft: var(--primary-extra-light, #f8eee9);
	--etc-ink: var(--global-color-13, #301d3d);
	--etc-muted: var(--secondary-light, #83778b);
	--etc-line: #ddd8e1;
	--etc-soft: var(--secondary-extra-light, #eae8ec);
	--etc-green: var(--global-color-10, #abc32a);
	--etc-radius: 14px;
	--etc-ctrl: 52px;

	width: 100%;
	max-width: 680px;
	margin: clamp(24px, 3vw, 36px) auto clamp(32px, 4vw, 48px);
	color: var(--etc-ink);
	text-align: left;
	font-size: 16px;
	line-height: 1.45;
}

.etc-calc.alignwide,
.etc-calc.alignfull {
	max-width: none;
}

.etc-calc *,
.etc-calc *::before,
.etc-calc *::after {
	box-sizing: border-box;
}

.etc-calc__card {
	background: #fff;
	border: 1px solid var(--etc-soft);
	border-top: 5px solid var(--etc-primary);
	border-radius: var(--etc-radius);
	box-shadow: 0 18px 40px -22px rgba(48, 29, 61, 0.35);
	padding: clamp(20px, 4vw, 36px);
}

.etc-calc__heading {
	margin: 0 0 1rem;
}

/* Header */
.etc-calc .etc-head {
	margin-bottom: 22px;
}

/* Page already has its own heading: add class etc-calc--nohead to the block */
.etc-calc.etc-calc--nohead .etc-head {
	display: none;
}

.etc-calc .etc-eyebrow {
	display: inline-block;
	margin-bottom: 8px;
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--etc-primary-soft);
	color: var(--etc-primary-dark);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.etc-calc .etc-title {
	display: block;
	font-size: clamp(20px, 2.4vw, 24px);
	font-weight: 700;
	line-height: 1.2;
	text-transform: uppercase;
	color: var(--etc-ink);
}

/* Layout */
.etc-calc .wpcf7 form {
	margin: 0;
}

.etc-calc .etc-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 18px;
}

.etc-calc .etc-field {
	margin: 0 0 20px;
	padding: 0;
	border: 0;
	min-width: 0;
}

.etc-calc .etc-label,
.etc-calc fieldset.etc-field > legend {
	display: block;
	width: 100%;
	margin: 0 0 8px;
	padding: 0;
	font-size: 15px;
	font-weight: 700;
	color: var(--etc-ink);
	float: none;
}

.etc-calc .etc-optional {
	margin-left: 4px;
	font-size: 12px;
	font-weight: 500;
	color: var(--etc-muted);
	text-transform: lowercase;
}

.etc-calc .etc-hint {
	display: block;
	margin-top: 6px;
	font-size: 13px;
	color: var(--etc-muted);
}

.etc-calc .etc-divider {
	height: 1px;
	margin: 4px 0 22px;
	background: var(--etc-soft);
	border: 0;
}

.etc-calc .wpcf7-form-control-wrap {
	display: block;
	position: relative;
}

/* Text inputs */
.etc-calc input[type="text"],
.etc-calc input[type="email"],
.etc-calc input[type="number"],
.etc-calc input[type="tel"] {
	display: block;
	width: 100%;
	min-width: 0;
	height: var(--etc-ctrl);
	margin: 0;
	padding: 0 16px;
	border: 1.5px solid var(--etc-line);
	border-radius: 10px;
	background: #fff;
	color: var(--etc-ink);
	font: inherit;
	font-size: 16px;
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.etc-calc input::placeholder {
	color: #a49cab;
	opacity: 1;
}

.etc-calc input[type="text"]:focus,
.etc-calc input[type="email"]:focus,
.etc-calc input[type="number"]:focus {
	outline: none;
	border-color: var(--etc-primary);
	box-shadow: 0 0 0 4px rgba(188, 85, 35, 0.15);
}

/* Number stepper */
.etc-calc .etc-stepper {
	display: flex;
	align-items: stretch;
	height: var(--etc-ctrl);
	border: 1.5px solid var(--etc-line);
	border-radius: 10px;
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.etc-calc .etc-stepper:focus-within {
	border-color: var(--etc-primary);
	box-shadow: 0 0 0 4px rgba(188, 85, 35, 0.15);
}

.etc-calc .etc-stepper .wpcf7-form-control-wrap {
	flex: 1 1 auto;
	min-width: 0;
}

.etc-calc .etc-stepper input[type="number"] {
	height: 100%;
	padding: 0 4px;
	border: 0;
	border-radius: 0;
	text-align: center;
	font-size: 18px;
	font-weight: 700;
	-moz-appearance: textfield;
	appearance: textfield;
}

.etc-calc .etc-stepper input[type="number"]:focus {
	box-shadow: none;
}

.etc-calc .etc-stepper input::-webkit-outer-spin-button,
.etc-calc .etc-stepper input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.etc-calc .etc-stepper__btn {
	flex: 0 0 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: var(--etc-primary-soft);
	color: var(--etc-primary-dark);
	font-size: 22px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}

.etc-calc .etc-stepper__btn:first-child {
	border-radius: 8px 0 0 8px;
}

.etc-calc .etc-stepper__btn:last-child {
	border-radius: 0 8px 8px 0;
}

.etc-calc .etc-stepper__btn:hover,
.etc-calc .etc-stepper__btn:focus-visible {
	background: var(--etc-primary);
	color: #fff;
	outline: none;
}

.etc-calc .etc-stepper__unit {
	display: flex;
	align-items: center;
	padding-right: 10px;
	font-size: 14px;
	font-weight: 600;
	color: var(--etc-muted);
}

/* Choice pills (CF7 radio with use_label_element) */
.etc-calc .wpcf7-radio,
.etc-calc .wpcf7-checkbox {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	border: 0;
	padding: 0;
	height: auto;
	background: none;
}

.etc-calc .wpcf7-list-item {
	display: block;
	margin: 0;
}

.etc-calc .wpcf7-list-item > label {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	margin: 0;
	padding: 10px 18px;
	border: 1.5px solid var(--etc-line);
	border-radius: 999px;
	background: #fff;
	color: var(--etc-ink);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.25;
	cursor: pointer;
	user-select: none;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.etc-calc .wpcf7-list-item > label:hover {
	border-color: var(--etc-primary);
}

.etc-calc .wpcf7-list-item input[type="radio"],
.etc-calc .wpcf7-list-item input[type="checkbox"] {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.etc-calc .wpcf7-list-item-label {
	margin: 0;
	position: relative;
}

.etc-calc .wpcf7-list-item > label:has(input:checked),
.etc-calc .wpcf7-list-item > label.is-checked {
	border-color: var(--etc-primary);
	background: var(--etc-primary);
	color: #fff;
}

.etc-calc .wpcf7-list-item > label:has(input:focus-visible) {
	outline: 3px solid rgba(188, 85, 35, 0.35);
	outline-offset: 2px;
}

/* Long answers stack as full-width cards with a radio dot */
.etc-calc .etc-choice--stack .wpcf7-radio {
	flex-direction: column;
}

.etc-calc .etc-choice--stack .wpcf7-list-item > label {
	display: flex;
	width: 100%;
	padding: 12px 16px 12px 46px;
	border-radius: 12px;
	font-weight: 500;
}

.etc-calc .etc-choice--stack .wpcf7-list-item > label::before {
	content: "";
	position: absolute;
	left: 16px;
	top: 50%;
	width: 18px;
	height: 18px;
	margin-top: -9px;
	border: 2px solid var(--etc-line);
	border-radius: 50%;
	background: #fff;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.etc-calc .etc-choice--stack .wpcf7-list-item > label:has(input:checked),
.etc-calc .etc-choice--stack .wpcf7-list-item > label.is-checked {
	background: var(--etc-primary-soft);
	color: var(--etc-ink);
}

.etc-calc .etc-choice--stack .wpcf7-list-item > label:has(input:checked)::before,
.etc-calc .etc-choice--stack .wpcf7-list-item > label.is-checked::before {
	border-color: var(--etc-primary);
	box-shadow: inset 0 0 0 4px #fff;
	background: var(--etc-primary);
}

/* Follow-up question (shown by script) */
.etc-calc .etc-more {
	margin-top: -6px;
	padding: 16px;
	border-radius: 12px;
	background: #faf8fb;
	border: 1px solid var(--etc-soft);
}

.etc-calc fieldset.etc-more > legend {
	float: left;
	width: 100%;
}

.etc-calc fieldset.etc-more > legend + * {
	clear: both;
}

.etc-calc .etc-more[hidden] {
	display: none;
}

/* Note + submit */
.etc-calc .etc-note {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	margin: 0 0 16px;
	font-size: 13px;
	color: var(--etc-muted);
}

.etc-calc .etc-note::before {
	content: "";
	flex: 0 0 16px;
	height: 16px;
	margin-top: 2px;
	background: var(--etc-green);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2Zm0 4-8 5-8-5V6l8 5 8-5Z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2Zm0 4-8 5-8-5V6l8 5 8-5Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.etc-calc input.wpcf7-submit,
.etc-calc .etc-submit {
	display: block;
	width: 100%;
	height: 58px;
	margin: 0;
	padding: 0 24px;
	border: 0;
	border-radius: 999px;
	background: var(--etc-primary);
	color: #fff;
	font: inherit;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
	box-shadow: 0 10px 22px -12px rgba(188, 85, 35, 0.9);
	transition: background 0.15s ease, transform 0.15s ease;
}

.etc-calc input.wpcf7-submit:hover,
.etc-calc input.wpcf7-submit:focus-visible {
	background: var(--etc-primary-dark);
	outline: none;
}

.etc-calc input.wpcf7-submit:active {
	transform: translateY(1px);
}

.etc-calc .wpcf7-spinner {
	display: block;
	margin: 12px auto 0;
}

/* Validation + response */
.etc-calc .wpcf7-not-valid-tip {
	display: block;
	margin-top: 6px;
	padding: 0;
	border: 0;
	background: none;
	color: #c0392b;
	font-size: 13px;
	font-weight: 600;
}

.etc-calc .wpcf7-not-valid,
.etc-calc .etc-stepper:has(.wpcf7-not-valid) {
	border-color: #c0392b;
}

.etc-calc .etc-stepper .wpcf7-not-valid-tip {
	position: absolute;
	top: calc(100% + 8px);
	left: -48px;
	white-space: nowrap;
}

.etc-calc .etc-stepper:has(.wpcf7-not-valid-tip) + .etc-hint {
	margin-top: 28px;
}

.etc-calc .wpcf7 form .wpcf7-response-output {
	margin: 18px 0 0;
	padding: 14px 16px;
	border: 0;
	border-radius: 10px;
	background: var(--etc-soft);
	color: var(--etc-ink);
	font-size: 15px;
	font-weight: 600;
}

.etc-calc .wpcf7 form.sent .wpcf7-response-output {
	background: #f1f6dc;
	color: #3d4a07;
	border-left: 5px solid var(--etc-green);
}

.etc-calc .wpcf7 form.invalid .wpcf7-response-output,
.etc-calc .wpcf7 form.unaccepted .wpcf7-response-output,
.etc-calc .wpcf7 form.failed .wpcf7-response-output,
.etc-calc .wpcf7 form.spam .wpcf7-response-output {
	background: #fdecea;
	color: #8a1f12;
	border-left: 5px solid #c0392b;
}

/* ---------------------------------------------------------------- Steps */

.etc-calc .etc-step[hidden] {
	display: none;
}

.etc-calc--steps .etc-step.is-active {
	animation: etc-in 0.28s ease both;
}

@keyframes etc-in {
	from {
		opacity: 0;
		transform: translateX(14px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.etc-calc--steps .etc-step.is-active {
		animation: none;
	}
}

.etc-calc .etc-progress {
	--etc-progress: 0%;
	margin: 0 0 24px;
}

.etc-calc .etc-progress__meta {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	margin-bottom: 12px;
	font-size: 13px;
}

.etc-calc .etc-progress__count {
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--etc-primary);
}

.etc-calc .etc-progress__title {
	font-weight: 600;
	color: var(--etc-muted);
}

.etc-calc .etc-progress__track {
	position: relative;
	display: flex;
	justify-content: space-between;
	margin: 0;
	padding: 0;
	list-style: none;
}

.etc-calc .etc-progress__track::before,
.etc-calc .etc-progress__track::after {
	content: "";
	position: absolute;
	top: 15px;
	left: 16px;
	right: 16px;
	height: 3px;
	border-radius: 3px;
	background: var(--etc-soft);
}

.etc-calc .etc-progress__track::after {
	right: auto;
	width: calc((100% - 32px) * var(--etc-progress-num, 0));
	background: var(--etc-primary);
	transition: width 0.3s ease;
}

.etc-calc .etc-progress__dot {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	margin: 0;
	min-width: 32px;
}

.etc-calc .etc-progress__dot:first-child {
	align-items: flex-start;
}

.etc-calc .etc-progress__dot:last-child {
	align-items: flex-end;
}

.etc-calc .etc-progress__dot span {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: 2px solid var(--etc-soft);
	border-radius: 50%;
	background: #fff;
	color: var(--etc-muted);
	font-size: 14px;
	font-weight: 700;
	transition: all 0.2s ease;
}

.etc-calc .etc-progress__dot em {
	font-size: 12px;
	font-style: normal;
	font-weight: 600;
	color: var(--etc-muted);
	white-space: nowrap;
}

.etc-calc .etc-progress__dot.is-current span {
	border-color: var(--etc-primary);
	background: var(--etc-primary);
	color: #fff;
	box-shadow: 0 0 0 5px rgba(188, 85, 35, 0.15);
}

.etc-calc .etc-progress__dot.is-current em {
	color: var(--etc-ink);
}

.etc-calc .etc-progress__dot.is-done span {
	border-color: var(--etc-primary);
	color: var(--etc-primary);
}

.etc-calc .etc-nav {
	display: flex;
	gap: 12px;
	align-items: center;
	margin-top: 8px;
}

.etc-calc .etc-nav .etc-btn-next,
.etc-calc .etc-nav .wpcf7-submit {
	flex: 1 1 auto;
}

.etc-calc .etc-btn-next,
.etc-calc .etc-btn-again {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 58px;
	margin: 0;
	padding: 0 28px;
	border: 0;
	border-radius: 999px;
	background: var(--etc-ink);
	color: #fff;
	font: inherit;
	font-size: 17px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
}

.etc-calc .etc-btn-next:hover,
.etc-calc .etc-btn-next:focus-visible,
.etc-calc .etc-btn-again:hover,
.etc-calc .etc-btn-again:focus-visible {
	background: var(--etc-primary);
	outline: none;
}

.etc-calc .etc-btn-next span {
	transition: transform 0.15s ease;
}

.etc-calc .etc-btn-next:hover span {
	transform: translateX(3px);
}

.etc-calc .etc-btn-back {
	flex: 0 0 auto;
	height: 58px;
	margin: 0;
	padding: 0 22px;
	border: 1.5px solid var(--etc-line);
	border-radius: 999px;
	background: #fff;
	color: var(--etc-ink);
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.etc-calc .etc-btn-back:hover,
.etc-calc .etc-btn-back:focus-visible {
	border-color: var(--etc-primary);
	color: var(--etc-primary);
	outline: none;
}

.etc-calc .etc-step-error {
	display: block;
	margin-top: 6px;
	color: #c0392b;
	font-size: 13px;
	font-weight: 600;
}

.etc-calc .etc-has-error .etc-stepper,
.etc-calc .etc-has-error input[type="text"],
.etc-calc .etc-has-error input[type="email"] {
	border-color: #c0392b;
}

.etc-calc .etc-recap {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 20px;
	padding: 12px;
	border-radius: 12px;
	background: var(--etc-primary-soft);
}

.etc-calc .etc-recap[hidden] {
	display: none;
}

.etc-calc .etc-recap span {
	padding: 4px 10px;
	border-radius: 999px;
	background: #fff;
	font-size: 13px;
	font-weight: 600;
	color: var(--etc-primary-dark);
}

/* Sent state */
.etc-calc .etc-btn-again {
	display: none;
	width: 100%;
	margin-top: 14px;
}

.etc-calc.etc-is-sent .etc-btn-again {
	display: flex;
}

.etc-calc.etc-is-sent .etc-step,
.etc-calc.etc-is-sent .etc-progress,
.etc-calc.etc-is-sent .etc-head {
	display: none;
}

.etc-calc.etc-is-sent .wpcf7 form .wpcf7-response-output {
	margin-top: 0;
	padding: 22px 20px;
	font-size: 17px;
}

.etc-admin-note {
	padding: 12px 16px;
	border: 2px dashed #bc5523;
	background: #f8eee9;
}

/* Mobile */
@media (max-width: 600px) {
	.entry-content > .etc-calc {
		padding-inline: 14px;
	}

	.etc-calc .etc-grid {
		grid-template-columns: 1fr;
	}

	.etc-calc__card {
		border-radius: 12px;
	}

	.etc-calc .wpcf7-radio:not(.etc-choice--stack .wpcf7-radio) .wpcf7-list-item {
		flex: 1 1 0;
	}

	.etc-calc .wpcf7-radio .wpcf7-list-item > label {
		justify-content: center;
		width: 100%;
		padding-inline: 10px;
	}

	.etc-calc .etc-choice--stack .wpcf7-list-item > label {
		justify-content: flex-start;
		padding-left: 46px;
	}
}

/* Fluid buttons, and stack the step buttons on narrow screens (down to 320px) */
.etc-calc .etc-nav .etc-btn-next,
.etc-calc .etc-nav .wpcf7-submit {
	min-width: 0;
}

.etc-calc input.wpcf7-submit,
.etc-calc .etc-submit {
	font-size: clamp(0.9375rem, 0.88rem + 0.29vw, 1.125rem);
	padding-inline: clamp(1rem, 0.81rem + 0.96vw, 1.5rem);
}

.etc-calc .etc-btn-next,
.etc-calc .etc-btn-again {
	font-size: clamp(0.9375rem, 0.9rem + 0.19vw, 1.0625rem);
	padding-inline: clamp(1rem, 0.71rem + 1.43vw, 1.75rem);
}

.etc-calc .etc-btn-back {
	padding-inline: clamp(1rem, 0.86rem + 0.72vw, 1.375rem);
}

@media (max-width: 420px) {
	.etc-calc .etc-nav {
		flex-wrap: wrap;
	}

	.etc-calc .etc-nav .etc-btn-back,
	.etc-calc .etc-nav .etc-btn-next,
	.etc-calc .etc-nav .wpcf7-submit {
		flex: 1 1 100%;
	}
}
