/*
* ===============================
*  START: Project Cost Estimator
* ===============================
*  Uses only the --tj-* custom properties declared in main.css, so the section
*  inherits the site theme automatically. Light-mode overrides live at the
*  bottom of this file rather than in light-mode.css.
*/

.estimator-section {
	padding-top: 120px;
	padding-bottom: 120px;
	position: relative;
	overflow: hidden;
	/* Blends out of the blog section above and into the contact section below. */
	background: linear-gradient(
		180deg,
		var(--tj-theme-accent-1) 0%,
		var(--tj-black-2) 100%
	);
}

.estimator-section::before {
	content: "";
	position: absolute;
	top: -180px;
	right: -140px;
	width: 520px;
	height: 520px;
	border-radius: 50%;
	background: radial-gradient(
		circle,
		rgba(135, 80, 247, 0.16) 0%,
		rgba(135, 80, 247, 0) 70%
	);
	pointer-events: none;
}

.estimator-section .container {
	position: relative;
	z-index: 1;
}

.estimator-section .section-header {
	max-width: 700px;
	margin-left: auto;
	margin-right: auto;
}

.estimator-subtitle {
	color: rgba(255, 255, 255, 0.5);
	font-weight: var(--tj-fw-regular);
	display: block;
	margin-bottom: 15px;
	text-transform: uppercase;
	letter-spacing: 2px;
	font-size: 14px;
}

/* ---------------- Question groups ---------------- */

.estimator-group {
	background: var(--tj-theme-accent-2);
	border: 1px solid var(--tj-border);
	border-radius: 15px;
	padding: 30px;
	margin-bottom: 25px;
}

.estimator-group:last-child {
	margin-bottom: 0;
}

.estimator-group__head {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	margin-bottom: 22px;
}

.estimator-group__index {
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: var(--tj-fw-bold);
	color: var(--tj-white);
	background: linear-gradient(
		161deg,
		var(--tj-theme-secondary) 0%,
		var(--tj-theme-primary) 100%
	);
}

/* Lets long titles and helper text wrap instead of overflowing the flex row. */
.estimator-group__heading {
	min-width: 0;
}

.estimator-group__title {
	font-size: 22px;
	margin-bottom: 0;
	color: var(--tj-white);
}

.estimator-group__desc {
	margin: 6px 0 0;
	font-size: 15px;
	color: var(--tj-grey-1);
	line-height: 1.5;
}

/* ---------------- Options ---------------- */

.estimator-options {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 12px;
}

.estimator-option {
	position: relative;
	margin: 0;
	cursor: pointer;
	display: block;
}

/* Visually hidden but still focusable and reachable by assistive tech. */
.estimator-option > input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	margin: 0;
	pointer-events: none;
}

.estimator-option__inner {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	height: 100%;
	background: var(--tj-black-2);
	border: 1px solid var(--tj-grey-4);
	border-radius: 10px;
	padding: 16px 18px;
	transition: all 0.3s ease-in-out;
}

.estimator-option:hover .estimator-option__inner {
	border-color: var(--tj-theme-primary-2);
}

.estimator-option > input:focus-visible + .estimator-option__inner {
	outline: 2px solid var(--tj-theme-primary);
	outline-offset: 2px;
}

.estimator-option > input:checked + .estimator-option__inner {
	border-color: var(--tj-theme-primary);
	background: linear-gradient(
		161deg,
		rgba(42, 20, 84, 0.55) 0%,
		rgba(135, 80, 247, 0.14) 100%
	);
	box-shadow: 0 0 0 1px var(--tj-theme-primary);
}

.estimator-option__check {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin-top: 2px;
	border-radius: 50%;
	border: 1px solid var(--tj-grey-4);
	position: relative;
	transition: all 0.3s ease-in-out;
}

/* Checkboxes read as squares, radios as circles. */
.estimator-option > input[type="checkbox"] + .estimator-option__inner .estimator-option__check {
	border-radius: 5px;
}

.estimator-option > input:checked + .estimator-option__inner .estimator-option__check {
	border-color: var(--tj-theme-primary);
	background: linear-gradient(
		161deg,
		var(--tj-theme-secondary) 0%,
		var(--tj-theme-primary) 100%
	);
}

.estimator-option > input:checked + .estimator-option__inner .estimator-option__check::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 1px;
	width: 5px;
	height: 10px;
	border: solid var(--tj-white);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.estimator-option__text {
	flex: 1 1 auto;
	min-width: 0;
}

.estimator-option__label {
	display: block;
	font-size: 16px;
	font-weight: var(--tj-fw-medium);
	color: var(--tj-white);
	line-height: 1.3;
}

.estimator-option__desc {
	display: block;
	margin-top: 5px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--tj-grey-1);
}

.estimator-option__meta {
	flex: 0 0 auto;
	font-size: 13px;
	font-weight: var(--tj-fw-sbold);
	white-space: nowrap;
	background: linear-gradient(
		to right,
		var(--tj-theme-primary) 0%,
		var(--tj-theme-primary-2) 100%
	);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

/*
 * From the point the option grid goes multi-column, the price reads better
 * pinned to the top-right corner as a badge than sitting inline at the end of
 * the row. Below this width the grid is a single column and the inline layout
 * already looks right, so it is left alone.
 */
@media (min-width: 576px) {
	.estimator-option__inner.has-meta {
		padding-top: 38px;
	}

	.estimator-option__inner.has-meta .estimator-option__check {
		margin-top: 0;
	}

	.estimator-option__meta {
		position: absolute;
		top: 13px;
		right: 16px;
	}
}

/* ---------------- Numeric group ---------------- */

.estimator-number {
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
}

.estimator-range {
	flex: 1 1 200px;
	-webkit-appearance: none;
	appearance: none;
	height: 6px;
	border-radius: 50px;
	background: var(--tj-grey-4);
	outline: none;
	margin: 0;
}

.estimator-range::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	cursor: pointer;
	border: 2px solid var(--tj-white);
	background: linear-gradient(
		161deg,
		var(--tj-theme-secondary) 0%,
		var(--tj-theme-primary) 100%
	);
}

.estimator-range::-moz-range-thumb {
	width: 18px;
	height: 18px;
	border-radius: 50%;
	cursor: pointer;
	border: 2px solid var(--tj-white);
	background: var(--tj-theme-primary);
}

.estimator-number__box {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--tj-black-2);
	border: 1px solid var(--tj-grey-4);
	border-radius: 8px;
	padding: 10px 14px;
}

.estimator-number__input {
	width: 60px;
	background: transparent;
	border: none;
	outline: none;
	color: var(--tj-white);
	font-size: 16px;
	font-weight: var(--tj-fw-sbold);
	text-align: center;
	padding: 0;
}

.estimator-number__unit {
	font-size: 14px;
	color: var(--tj-grey-1);
}

.estimator-number__hint {
	margin: 12px 0 0;
	font-size: 13px;
	color: var(--tj-grey-1);
}

/* ---------------- Summary panel ---------------- */

.estimator-summary {
	background: var(--tj-theme-accent-2);
	border: 1px solid var(--tj-border);
	border-radius: 15px;
	padding: 32px;
}

@media (min-width: 992px) {
	.estimator-summary {
		position: sticky;
		top: 100px;
	}
}

/*
 * The panel itself never scrolls - only the breakdown list inside it does.
 * That means it must always fit on screen while pinned, or its lower half
 * would be unreachable. On short viewports, and once the quote form has been
 * opened, it is released to scroll with the page instead.
 */
@media (min-width: 992px) and (max-height: 899px) {
	.estimator-summary {
		position: static;
	}
}

.estimator-wrapper.is-form-open .estimator-summary {
	position: static;
}

.estimator-summary__currency {
	display: inline-flex;
	gap: 4px;
	background: var(--tj-black-2);
	border: 1px solid var(--tj-grey-4);
	border-radius: 50px;
	padding: 4px;
	margin-bottom: 25px;
}

.estimator-currency-btn {
	border: none;
	background: transparent;
	color: var(--tj-grey-3);
	font-size: 14px;
	font-weight: var(--tj-fw-medium);
	padding: 8px 22px;
	border-radius: 50px;
	cursor: pointer;
	transition: all 0.3s ease-in-out;
}

.estimator-currency-btn.is-active {
	color: var(--tj-white);
	background: linear-gradient(
		to right,
		var(--tj-theme-primary) 0%,
		var(--tj-theme-secondary) 100%
	);
}

.estimator-summary__label {
	margin: 0 0 8px;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 1.5px;
	color: var(--tj-grey-1);
}

.estimator-summary__price {
	font-family: var(--tj-ff-heading);
	font-size: 32px;
	line-height: 1.25;
	font-weight: var(--tj-fw-bold);
	background: linear-gradient(
		to right,
		var(--tj-theme-primary) 0%,
		var(--tj-white) 100%
	);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	transition: opacity 0.2s ease-in-out;
}

.estimator-summary__price.is-updating {
	opacity: 0.45;
}

.estimator-summary__monthly {
	margin: 10px 0 0;
	font-size: 15px;
	color: var(--tj-theme-primary-2);
	font-weight: var(--tj-fw-medium);
}

.estimator-summary__divider {
	height: 1px;
	background: var(--tj-border1);
	margin: 25px 0 22px;
}

.estimator-breakdown {
	max-height: 250px;
	overflow-y: auto;
	margin: 0 0 25px;
	padding-right: 6px;
}

.estimator-breakdown::-webkit-scrollbar {
	width: 4px;
}

.estimator-breakdown::-webkit-scrollbar-thumb {
	background: var(--tj-grey-4);
	border-radius: 50px;
}

.estimator-breakdown__row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 14px;
	padding: 11px 0;
	border-bottom: 1px solid var(--tj-border);
}

.estimator-breakdown__row:last-child {
	border-bottom: none;
}

.estimator-breakdown__name {
	font-size: 15px;
	color: var(--tj-white);
	line-height: 1.4;
}

.estimator-breakdown__name em {
	display: block;
	font-style: normal;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: var(--tj-grey-1);
	margin-bottom: 3px;
}

.estimator-breakdown__value {
	flex: 0 0 auto;
	font-size: 14px;
	font-weight: var(--tj-fw-sbold);
	color: var(--tj-theme-primary-2);
	white-space: nowrap;
}

.estimator-breakdown__empty {
	padding: 11px 0;
	font-size: 15px;
	color: var(--tj-grey-1);
}

/* Local elements set their own display, which would otherwise beat [hidden]. */
.estimator-section [hidden] {
	display: none !important;
}

/* ---------------- Discount code ---------------- */

.estimator-discount {
	margin-bottom: 22px;
}

.estimator-discount__row {
	display: flex;
	gap: 8px;
}

.estimator-discount__input {
	flex: 1 1 auto;
	min-width: 0;
	background: var(--tj-black-2);
	border: 1px solid var(--tj-grey-4);
	border-radius: 8px;
	color: var(--tj-white);
	font-size: 15px;
	letter-spacing: 1px;
	text-transform: uppercase;
	padding: 12px 16px;
	outline: none;
	transition: all 0.3s ease-in-out;
}

.estimator-discount__input::placeholder {
	color: var(--tj-grey-1);
	letter-spacing: 0;
	text-transform: none;
}

.estimator-discount__input:focus {
	border-color: var(--tj-theme-primary);
}

.estimator-discount__btn {
	flex: 0 0 auto;
	border: none;
	border-radius: 8px;
	color: var(--tj-white);
	font-size: 14px;
	font-weight: var(--tj-fw-sbold);
	padding: 12px 22px;
	cursor: pointer;
	background-size: 200%;
	background-image: linear-gradient(
		to right,
		var(--tj-theme-primary) 0%,
		var(--tj-theme-secondary) 51%,
		var(--tj-theme-primary) 100%
	);
	transition: 0.4s;
}

.estimator-discount__btn:hover {
	background-position: -100%;
}

.estimator-discount__btn:disabled {
	opacity: 0.6;
	cursor: default;
}

.estimator-discount__applied {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	background: linear-gradient(
		161deg,
		rgba(42, 20, 84, 0.55) 0%,
		rgba(135, 80, 247, 0.14) 100%
	);
	border: 1px solid var(--tj-theme-primary);
	border-radius: 8px;
	padding: 12px 16px;
}

.estimator-discount__tag {
	font-size: 14px;
	color: var(--tj-white);
	min-width: 0;
	word-break: break-word;
}

.estimator-discount__tag strong {
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-right: 6px;
}

.estimator-discount__remove {
	flex: 0 0 auto;
	background: none;
	border: none;
	color: var(--tj-grey-1);
	font-size: 13px;
	text-decoration: underline;
	cursor: pointer;
	padding: 0;
	transition: color 0.3s ease-in-out;
}

.estimator-discount__remove:hover {
	color: var(--tj-white);
}

.estimator-discount__msg {
	margin: 10px 0 0;
	font-size: 13px;
	line-height: 1.5;
}

.estimator-discount__msg.is-ok {
	color: var(--tj-theme-primary-2);
}

.estimator-discount__msg.is-error {
	color: #ff7b7b;
}

/* ---------------- Discounted price ---------------- */

.estimator-summary__was {
	font-size: 17px;
	color: var(--tj-grey-1);
	text-decoration: line-through;
	margin-bottom: 4px;
}

.estimator-summary__saving {
	margin: 8px 0 0;
	font-size: 14px;
	font-weight: var(--tj-fw-medium);
	color: var(--tj-theme-primary-2);
}

.estimator-summary__cta,
.estimator-summary__submit {
	width: 100%;
}

/* Visible by default so the form still works with JavaScript disabled;
   estimator.js collapses it on load and the CTA reveals it. */
.estimator-summary__cta {
	display: none;
}

.estimator-wrapper.is-enhanced .estimator-summary__cta {
	display: inline-flex;
}

.estimator-wrapper.is-enhanced .estimator-form.is-collapsed {
	display: none;
}

.estimator-form {
	margin-top: 22px;
}

.estimator-form .form_group textarea {
	height: 110px;
}

.estimator-summary__note {
	margin: 20px 0 0;
	font-size: 13px;
	line-height: 1.6;
	color: var(--tj-grey-1);
}

/* ---------------- Responsive ---------------- */

@media (max-width: 991px) {
	.estimator-section {
		padding-top: 90px;
		padding-bottom: 90px;
	}

	.estimator-summary {
		margin-top: 25px;
	}
}

@media (max-width: 575px) {
	.estimator-group,
	.estimator-summary {
		padding: 22px;
	}

	.estimator-options {
		grid-template-columns: 1fr;
	}

	.estimator-summary__price {
		font-size: 26px;
	}

	.estimator-group__title {
		font-size: 19px;
	}
}

/* ---------------- Light mode ---------------- */

.light-mode .estimator-section {
	background: linear-gradient(
		180deg,
		var(--tj-off-white) 0%,
		var(--tj-white) 100%
	);
}

.light-mode .estimator-group,
.light-mode .estimator-summary {
	background: var(--tj-white);
	border-color: var(--tj-grey-2);
	box-shadow: 0 4px 30px rgba(16, 32, 57, 0.06);
}

.light-mode .estimator-group__title,
.light-mode .estimator-option__label,
.light-mode .estimator-breakdown__name {
	color: var(--tj-theme-secondary);
}

.light-mode .estimator-option__inner,
.light-mode .estimator-number__box,
.light-mode .estimator-summary__currency {
	background: var(--tj-off-white);
	border-color: var(--tj-grey-2);
}

.light-mode .estimator-option > input:checked + .estimator-option__inner {
	background: rgba(135, 80, 247, 0.08);
}

.light-mode .estimator-number__input {
	color: var(--tj-theme-secondary);
}

.light-mode .estimator-currency-btn {
	color: var(--tj-black3);
}

.light-mode .estimator-currency-btn.is-active {
	color: var(--tj-white);
}

.light-mode .estimator-summary__price {
	background: linear-gradient(
		to right,
		var(--tj-theme-primary) 0%,
		var(--tj-theme-secondary) 100%
	);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}

.light-mode .estimator-breakdown__row {
	border-bottom-color: var(--tj-grey-2);
}

.light-mode .estimator-subtitle {
	color: var(--tj-black3);
}

.light-mode .estimator-discount__input {
	background: var(--tj-off-white);
	border-color: var(--tj-grey-2);
	color: var(--tj-theme-secondary);
}

.light-mode .estimator-discount__applied {
	background: rgba(135, 80, 247, 0.08);
}

.light-mode .estimator-discount__tag {
	color: var(--tj-theme-secondary);
}

.light-mode .estimator-discount__msg.is-error {
	color: #c62828;
}

/* END: Project Cost Estimator */
