/* EPS Contact Form Popper */
.eps-cfp {
	--eps-cfp-size: 60px;
	--eps-cfp-gap: 16px;
	--eps-cfp-width: 400px;
	--eps-cfp-radius: 12px;
	--eps-cfp-z: 999990;
	font-size: 15px;
	line-height: 1.5;
}

.eps-cfp *,
.eps-cfp *::before,
.eps-cfp *::after {
	box-sizing: border-box;
}

/* Launcher + teaser */
.eps-cfp__launcher-wrap {
	position: fixed;
	right: var(--eps-cfp-x);
	bottom: var(--eps-cfp-y);
	z-index: calc(var(--eps-cfp-z) + 2);
	display: flex;
	align-items: center;
	gap: 12px;
}

.eps-cfp__launcher {
	position: relative;
	width: var(--eps-cfp-size);
	height: var(--eps-cfp-size);
	flex: 0 0 var(--eps-cfp-size);
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--eps-cfp-color);
	color: var(--eps-cfp-on-color);
	box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .2s ease, box-shadow .2s ease;
}

.eps-cfp__launcher:hover {
	transform: scale(1.06);
	box-shadow: 0 8px 26px rgba(0, 0, 0, .28);
}

.eps-cfp__launcher:focus-visible,
.eps-cfp__close:focus-visible,
.eps-cfp__teaser button:focus-visible {
	outline: 3px solid var(--eps-cfp-color);
	outline-offset: 3px;
}

.eps-cfp__icon {
	position: absolute;
	transition: opacity .2s ease, transform .25s ease;
}

.eps-cfp__icon--close {
	opacity: 0;
	transform: rotate(-90deg) scale(.6);
}

.eps-cfp.is-open .eps-cfp__icon--msg {
	opacity: 0;
	transform: rotate(90deg) scale(.6);
}

.eps-cfp.is-open .eps-cfp__icon--close {
	opacity: 1;
	transform: none;
}

.eps-cfp__teaser {
	position: relative;
	display: flex;
	align-items: center;
	max-width: 260px;
	background: #fff;
	color: #222;
	border-radius: 10px;
	box-shadow: 0 4px 18px rgba(0, 0, 0, .16);
	animation: eps-cfp-teaser-in .4s ease .8s both;
	transition: opacity .2s ease, transform .2s ease;
}

.eps-cfp__teaser::after {
	content: "";
	position: absolute;
	right: -6px;
	top: 50%;
	width: 12px;
	height: 12px;
	margin-top: -6px;
	background: #fff;
	transform: rotate(45deg);
}

.eps-cfp__teaser-text {
	position: relative;
	z-index: 1;
	margin: 0;
	padding: 10px 6px 10px 14px;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 14px;
	text-align: left;
	line-height: 1.35;
	cursor: pointer;
	text-transform: none;
	letter-spacing: normal;
}

.eps-cfp__teaser-dismiss {
	position: relative;
	z-index: 1;
	align-self: flex-start;
	margin: 2px 2px 0 0;
	padding: 2px 8px;
	border: 0;
	background: transparent;
	color: #888;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}

.eps-cfp__teaser-dismiss:hover {
	color: #222;
}

.eps-cfp.is-open .eps-cfp__teaser,
.eps-cfp.teaser-dismissed .eps-cfp__teaser {
	opacity: 0;
	transform: translateX(10px);
	pointer-events: none;
}

.eps-cfp.teaser-dismissed .eps-cfp__teaser {
	display: none;
}

@keyframes eps-cfp-teaser-in {
	from { opacity: 0; transform: translateX(12px); }
	to { opacity: 1; transform: none; }
}

/* Overlay */
.eps-cfp__overlay {
	position: fixed;
	inset: 0;
	z-index: var(--eps-cfp-z);
	background: var(--eps-cfp-overlay);
	opacity: 0;
	transition: opacity .25s ease;
}

.eps-cfp.is-open .eps-cfp__overlay {
	opacity: 1;
}

/* Panel */
.eps-cfp__panel {
	position: fixed;
	right: var(--eps-cfp-x);
	bottom: calc(var(--eps-cfp-y) + var(--eps-cfp-size) + var(--eps-cfp-gap));
	z-index: calc(var(--eps-cfp-z) + 1);
	width: var(--eps-cfp-width);
	max-width: calc(100vw - var(--eps-cfp-x) - 10px);
	max-height: calc(100vh - var(--eps-cfp-y) - var(--eps-cfp-size) - var(--eps-cfp-gap) - 20px);
	max-height: calc(100dvh - var(--eps-cfp-y) - var(--eps-cfp-size) - var(--eps-cfp-gap) - 20px);
	display: flex;
	flex-direction: column;
	background: #fff;
	color: #222;
	border-radius: var(--eps-cfp-radius);
	box-shadow: 0 12px 48px rgba(0, 0, 0, .28);
	overflow: hidden;
	transform-origin: bottom right;
	opacity: 0;
	transform: translateY(20px) scale(.92);
	transition: opacity .25s ease, transform .3s cubic-bezier(.2, .9, .3, 1.15);
}

.eps-cfp.is-open .eps-cfp__panel {
	opacity: 1;
	transform: none;
}

.eps-cfp__panel[hidden],
.eps-cfp__overlay[hidden] {
	display: none !important;
}

.eps-cfp__titlebar {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 12px 14px 20px;
	background: var(--eps-cfp-color);
	color: var(--eps-cfp-on-color);
}

.eps-cfp__title {
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
}

.eps-cfp__close {
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background-color .15s ease;
}

.eps-cfp__close:hover {
	background: rgba(127, 127, 127, .25);
}

.eps-cfp__body {
	flex: 1 1 auto;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: 20px;
}

.eps-cfp__body > :first-child {
	margin-top: 0;
}

.eps-cfp__body > :last-child {
	margin-bottom: 0;
}

/* Gravity Forms tidy-ups inside the panel */
.eps-cfp__body .gform_wrapper {
	margin: 0 !important;
}

.eps-cfp__body .gform_wrapper .gform_footer {
	margin-bottom: 0;
	padding-bottom: 0;
}

/* Mobile */
@media (max-width: 520px) {
	.eps-cfp__panel {
		left: 10px;
		right: 10px;
		width: auto;
		max-width: none;
	}

	.eps-cfp__teaser {
		max-width: calc(100vw - var(--eps-cfp-x) - var(--eps-cfp-size) - 30px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.eps-cfp *,
	.eps-cfp__teaser {
		animation: none !important;
		transition: none !important;
	}
}

body.eps-cfp-lock {
	overflow: hidden;
}
