/* Lead callback modal. YepX tokens only. */

.yepx-lead-modal[hidden]:not(.is-closing) {
	display: none !important;
}

.yepx-lead-modal:not([hidden]) {
	position: fixed;
	inset: 0;
	z-index: calc(var(--yepx-z-modal, 90) + 8);
	display: grid;
	align-items: center;
	justify-items: center;
	padding: 1.25rem;
}

@media (max-width: 1024px) {
	.yepx-lead-modal:not([hidden]) {
		align-items: flex-start;
		padding-top: 2cm;
	}

	.yepx-lead-modal__panel {
		max-height: min(calc(100dvh - 1cm - 1.25rem), 40rem);
	}
}

.yepx-lead-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(16, 44, 59, 0.45);
}

.yepx-lead-modal__dialog {
	position: relative;
	z-index: 1;
	overflow: visible;
}

.yepx-lead-modal__panel {
	position: relative;
	width: min(32rem, calc(100vw - 2.5rem));
	max-height: min(90dvh, 40rem);
	overflow: auto;
	background: var(--yepx-color-surface);
	color: var(--yepx-color-ink);
	border-radius: 1.75rem;
	padding: 1.75rem 1.5rem 1.5rem;
	box-shadow: var(--yepx-shadow-lg);
}

.yepx-lead-modal__close {
	position: absolute;
	top: -12px;
	right: -12px;
	z-index: 3;
	min-height: 44px;
	min-width: 44px;
	border: 0;
	border-radius: 999px;
	background: #fff;
	color: #0b2c3d;
	box-shadow: var(--yepx-shadow-sm);
	cursor: pointer;
	font-size: 1.5rem;
	line-height: 1;
	pointer-events: auto;
}

.yepx-lead-modal__title {
	margin: 0 0 0.4rem;
	font-size: 1.35rem;
	line-height: 1.25;
	color: var(--yepx-color-heading);
	text-align: center;
}

.yepx-lead-modal__intro {
	margin: 0 0 1.15rem;
	color: var(--yepx-color-text);
	font-size: 0.95rem;
	text-align: center;
}

.yepx-lead-form__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.yepx-lead-form__field {
	margin: 0 0 0.9rem;
}

.yepx-lead-form__field label {
	display: block;
	margin-bottom: 0.35rem;
	font-size: 0.9rem;
	color: var(--yepx-color-heading);
}

.yepx-lead-form__field input {
	width: 100%;
	min-height: 48px;
	border: 0;
	border-radius: var(--yepx-radius-pill);
	background: var(--yepx-color-bg-soft);
	padding: 0.7rem 1.1rem;
	color: var(--yepx-color-ink);
	font: inherit;
}

.yepx-lead-form__field input:focus {
	outline: 2px solid var(--yepx-color-focus);
	outline-offset: 2px;
}

.yepx-lead-form__field input.is-invalid,
.yepx-lead-form__field.is-invalid input {
	outline: 2px solid var(--yepx-color-error, var(--yepx-color-danger, #b42318));
	outline-offset: 1px;
}

.yepx-lead-form__err {
	display: block;
	margin: 0.35rem 0 0;
	font-size: 0.85rem;
	line-height: 1.3;
	color: var(--yepx-color-error, var(--yepx-color-danger, #b42318));
}

.yepx-lead-form__err[hidden] {
	display: none !important;
}

.yepx-lead-form__field.is-shake input {
	animation: yepx-lead-shake 0.32s ease;
}

.yepx-lead-form__actions {
	margin: 1.15rem 0 0;
}

.yepx-lead-form__submit {
	width: 100%;
	min-height: 48px;
	border-radius: var(--yepx-radius-pill);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
}

.yepx-lead-form__submit:hover,
.yepx-lead-form__submit:focus-visible {
	background: var(--yepx-color-success-hover);
}

.yepx-lead-form__submit:disabled {
	opacity: 0.72;
	cursor: wait;
}

.yepx-lead-form__submit-wrap {
	position: relative;
	display: block;
}

.yepx-lead-form__spin {
	display: none;
	position: absolute;
	left: 50%;
	top: 50%;
	width: 18px;
	height: 18px;
	margin: -9px 0 0 -9px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: yepx-lead-spin 0.7s linear infinite;
	pointer-events: none;
	z-index: 1;
}

.yepx-lead-form.is-busy .yepx-lead-form__spin,
.yepx-lead-form--cf7 form.submitting .yepx-lead-form__spin,
.yepx-lead-form--cf7 .wpcf7-submit[aria-busy="true"] ~ .yepx-lead-form__spin {
	display: block;
}

.yepx-lead-form__status {
	margin: 0.85rem 0 0;
	font-size: 0.95rem;
}

.yepx-lead-form__ok-icon {
	display: none;
}

.yepx-lead-form__status.is-ok {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 0.7rem;
	margin: 0.5rem 0 0;
	color: var(--yepx-color-success);
}

.yepx-lead-form__status.is-ok .yepx-lead-form__ok-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3.5rem;
	height: 3.5rem;
	border: 2.5px solid currentColor;
	border-radius: 50%;
	color: var(--yepx-color-success);
	animation: yepx-lead-ok-pop 0.42s ease-out both;
}

.yepx-lead-form__status.is-ok .yepx-lead-form__ok-svg {
	width: 1.85rem;
	height: 1.85rem;
	stroke-width: 2.25;
}

.yepx-lead-form__status.is-ok .yepx-lead-form__ok-svg path {
	stroke-dasharray: 28;
	stroke-dashoffset: 0;
	animation: yepx-lead-ok-check 0.32s ease-out 0.08s both;
}

.yepx-lead-form__ok-msg {
	display: block;
}

.yepx-lead-form__status.is-err {
	color: var(--yepx-color-error);
}

.yepx-lead-form.is-done .yepx-lead-form__field,
.yepx-lead-form.is-done .yepx-lead-form__actions {
	display: none;
}

.yepx-lead-modal.is-success .yepx-lead-modal__panel {
	padding-top: 2.25rem;
	padding-bottom: 2.15rem;
}

.yepx-lead-success {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 0.35rem 0.15rem 0.15rem;
}

.yepx-lead-success[hidden] {
	display: none !important;
}

.yepx-lead-success__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3.5rem;
	height: 3.5rem;
	margin: 0 0 1.15rem;
	border-radius: 50%;
	background: #22c55e;
	color: #fff;
	animation: yepx-lead-ok-pop 0.42s ease-out both;
}

.yepx-lead-success__svg {
	display: block;
	width: 1.7rem;
	height: 1.7rem;
}

.yepx-lead-success__title {
	margin: 0 0 0.5rem;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.3;
	color: var(--yepx-color-heading);
}

.yepx-lead-success__text {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: var(--yepx-color-text);
}

.yepx-lead-modal.is-success .yepx-lead-modal__title,
.yepx-lead-modal.is-success .yepx-lead-modal__intro,
.yepx-lead-modal.is-success .yepx-lead-form,
.yepx-lead-modal.is-success .yepx-recaptcha-legal,
.yepx-lead-modal.is-success .wpcf7-response-output,
.yepx-lead-modal.is-success .g-recaptcha,
.yepx-lead-modal.is-success .wpcf7-form-control-wrap.recaptcha,
.yepx-lead-modal.is-success .recaptcha {
	display: none !important;
}

/* Google v3 badge hide (visibility, not display:none). Legal line is the substitute. */
.grecaptcha-badge {
	visibility: hidden !important;
	width: 0 !important;
	height: 0 !important;
	overflow: hidden !important;
}

.yepx-recaptcha-legal {
	margin: 0.65rem 0 0;
	font-size: 0.75rem;
	line-height: 1.45;
	color: var(--yepx-color-muted, #6b7280);
	text-align: center;
}

.yepx-recaptcha-legal a {
	color: inherit;
	text-decoration: underline;
}

body.is-yepx-lead-open {
	overflow: hidden;
}

.yepx-lead-form--cf7 .wpcf7,
.yepx-lead-form--cf7 .wpcf7-form {
	margin: 0;
}

.yepx-lead-form--cf7 .wpcf7-form p,
.yepx-lead-form--cf7 .wpcf7 p {
	margin: 0;
}

.yepx-lead-form--cf7 #responsive-form,
.yepx-lead-form--cf7 .form-row,
.yepx-lead-form--cf7 .column-half,
.yepx-lead-form--cf7 .form-group,
.yepx-lead-form--cf7 .column-full,
.yepx-lead-form--cf7 .wpcf7-form-control-wrap {
	flex-grow: 0;
	height: auto;
	max-width: 100%;
	margin: 0;
}

.yepx-lead-form--cf7 #responsive-form {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.yepx-lead-form--cf7 .form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.45rem;
}

.yepx-lead-form--cf7 .column-half,
.yepx-lead-form--cf7 .form-group {
	min-width: 0;
}

.yepx-lead-form--cf7 .column-full,
.yepx-lead-form--cf7 .form-row > .form-group:only-child {
	grid-column: 1 / -1;
	min-width: 0;
}

/* Hosting labels stay in markup; screenshot uses placeholders. */
.yepx-lead-form--cf7 label {
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
}

.yepx-lead-form:not(.is-tool-waste) .yepx-lead-email,
.yepx-lead-form .yepx-lead-rapor {
	display: none;
}

.yepx-lead-form.is-tool-waste .yepx-lead-email {
	display: block;
	margin-top: 0.4rem;
}

.yepx-lead-form--cf7 .form-row:has(textarea),
.yepx-lead-form--cf7 .form-row:has(.wpcf7-textarea) {
	margin-top: 0.55rem;
	grid-template-columns: 1fr;
}

.yepx-lead-form--cf7 input.wpcf7-form-control:not([type="submit"]):not([type="hidden"]) {
	width: 100%;
	min-height: 48px;
	height: 48px;
	border: 0;
	border-radius: var(--yepx-radius-pill);
	background: var(--yepx-color-bg-soft);
	padding: 0.7rem 1.1rem;
	color: var(--yepx-color-ink);
	font: inherit;
	box-sizing: border-box;
}

.yepx-lead-form--cf7 textarea.wpcf7-form-control,
.yepx-lead-form--cf7 .wpcf7-textarea {
	display: block;
	width: 100%;
	line-height: 1.4;
	padding: 0.45rem 0.85rem;
	height: calc(1.4em * 2 + 0.9rem);
	min-height: calc(1.4em * 2 + 0.9rem);
	max-height: calc(1.4em * 2 + 0.9rem);
	border: 0;
	border-radius: 18px;
	background: var(--yepx-color-bg-soft);
	color: var(--yepx-color-ink);
	font: inherit;
	box-sizing: border-box;
	resize: none;
	flex: none;
	overflow-y: auto;
}

.yepx-lead-form--cf7 .wpcf7-form-control:focus {
	outline: 2px solid var(--yepx-color-focus);
	outline-offset: 2px;
}

.yepx-lead-form--cf7 .wpcf7-not-valid {
	outline: 2px solid var(--yepx-color-error, var(--yepx-color-danger, #b42318));
	outline-offset: 1px;
}

.yepx-lead-form--cf7 .wpcf7-not-valid-tip {
	display: block;
	margin: 0.35rem 0 0;
	font-size: 0.85rem;
	color: var(--yepx-color-error, var(--yepx-color-danger, #b42318));
}

.yepx-lead-form--cf7 .form-row:has(.recaptcha),
.yepx-lead-form--cf7 .form-row:has(.g-recaptcha) {
	justify-items: center;
}

.yepx-lead-form--cf7 .wpcf7-form-control-wrap.recaptcha,
.yepx-lead-form--cf7 .recaptcha {
	display: flex;
	justify-content: center;
	width: 100%;
	max-width: 100%;
	max-height: none;
	overflow: visible;
	margin: 0.15rem 0 0.35rem;
}

.yepx-lead-form--cf7 .g-recaptcha {
	display: flex;
	justify-content: center;
	width: 304px;
	max-width: 100%;
	margin-left: auto;
	margin-right: auto;
	overflow: visible;
	transform-origin: top center;
}

.yepx-lead-form--cf7 .g-recaptcha[data-size="invisible"],
.yepx-lead-form--cf7 .yepx-recaptcha-invisible {
	display: block;
	width: auto;
	height: 0;
	min-height: 0;
	margin: 0;
	overflow: visible;
	transform: none;
}

.yepx-lead-form--cf7 .form-row:has(.g-recaptcha[data-size="invisible"]),
.yepx-lead-form--cf7 .form-row:has(.yepx-recaptcha-invisible) {
	margin: 0;
	min-height: 0;
}

.yepx-lead-form--cf7 .grecaptcha-noscript {
	display: none;
}

.yepx-lead-form--cf7 .wpcf7-submit {
	display: block;
	width: 100%;
	min-height: 48px;
	flex-shrink: 0;
	border: 0;
	border-radius: var(--yepx-radius-pill);
	background: var(--yepx-color-success);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	box-shadow: var(--yepx-shadow-md);
}

.yepx-lead-form--cf7 .wpcf7-submit:hover,
.yepx-lead-form--cf7 .wpcf7-submit:focus-visible {
	background: var(--yepx-color-success-hover);
}

/* CF7 default spinner is a dark 24px circle after the submit (next line). */
.yepx-lead-form--cf7 .wpcf7-spinner,
.yepx-lead-form--cf7 .ajax-loader,
.yepx-lead-modal .wpcf7-spinner,
.yepx-lead-modal .ajax-loader {
	display: none !important;
	visibility: hidden !important;
	width: 0 !important;
	height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
	opacity: 0 !important;
	background: none !important;
	border: 0 !important;
	pointer-events: none !important;
	position: absolute !important;
	left: -9999px !important;
}

.yepx-lead-form--cf7 .wpcf7-spinner::before,
.yepx-lead-form--cf7 .ajax-loader::before {
	content: none !important;
	display: none !important;
	animation: none !important;
}

.yepx-lead-form--cf7 form.submitting .wpcf7-submit,
.yepx-lead-form--cf7 .wpcf7-submit[aria-busy="true"],
.yepx-lead-form--cf7 .wpcf7-submit:disabled {
	cursor: wait;
	pointer-events: none;
	color: rgba(255, 255, 255, 0.42);
}

.yepx-lead-form--cf7 .wpcf7-response-output {
	margin: 0.75rem 0 0;
	text-align: center;
	font-size: 0.95rem;
}

.yepx-lead-form--local .wpcf7-form-control-wrap.recaptcha,
.yepx-lead-form--local .recaptcha {
	max-height: none;
}

.yepx-lead-form--local .g-recaptcha {
	transform: scale(0.88);
	transform-origin: top center;
}

@media (max-width: 479px) {
	.yepx-lead-form--cf7 .form-row {
		grid-template-columns: 1fr;
	}

	.yepx-lead-form--cf7 .g-recaptcha {
		transform: scale(0.82);
		transform-origin: top center;
	}
}

@keyframes yepx-lead-spin {
	to {
		transform: rotate(360deg);
	}
}

@keyframes yepx-lead-shake {
	0%,
	100% {
		transform: translateX(0);
	}
	20% {
		transform: translateX(-6px);
	}
	40% {
		transform: translateX(5px);
	}
	60% {
		transform: translateX(-3px);
	}
	80% {
		transform: translateX(2px);
	}
}

@keyframes yepx-lead-ok-pop {
	0% {
		opacity: 0;
		transform: scale(0.78);
	}
	70% {
		opacity: 1;
		transform: scale(1.06);
	}
	100% {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes yepx-lead-ok-check {
	from {
		stroke-dashoffset: 28;
	}
	to {
		stroke-dashoffset: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.yepx-lead-form__spin {
		animation: none;
		border-top-color: #fff;
		opacity: 1;
	}

	.yepx-lead-form__status.is-ok .yepx-lead-form__ok-icon,
	.yepx-lead-form__status.is-ok .yepx-lead-form__ok-svg path,
	.yepx-lead-success__icon {
		animation: none;
	}

	.yepx-lead-form__field.is-shake input {
		animation: none;
	}
}
