/* Teckform Popup widget. Colors and sizes set in the Style tab override these defaults. */

.teckform-popup {
	--teckform-popup-speed: 300ms;
	--teckform-popup-overlay: rgba(15, 23, 42, 0.6);
	--teckform-popup-blur: 0px;
}

/* Body scroll lock while a modal popup is open (also in widgets.css, which may not be loaded). */
body.teckform-no-scroll {
	overflow: hidden;
	padding-inline-end: var(--teckform-scrollbar-width, 0px);
}

/* Button */
.teckform-popup__trigger {
	display: flex;
	justify-content: flex-start;
}

.teckform-popup__button {
	display: inline-flex;
	flex-grow: var(--teckform-popup-button-grow, 0);
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 26px;
	border: 1px solid var(--teckform-accent);
	border-radius: 10px;
	background: var(--teckform-accent);
	color: var(--teckform-on-accent, #fff);
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.teckform-popup__button:hover {
	background: color-mix(in srgb, var(--teckform-accent) 85%, #000);
	transform: translateY(-1px);
}

.teckform-popup__button:focus-visible {
	outline: 2px solid var(--teckform-accent);
	outline-offset: 3px;
}

.teckform-popup__button-icon {
	display: inline-flex;
}

.teckform-popup__button-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

/*
 * Dialog: a transparent layer over the whole window that centers the panel.
 * Its ::before is the overlay, so a click on the dialog itself is a click on the overlay.
 */
.teckform-popup__dialog {
	position: fixed;
	inset: 0;
	z-index: 99999;
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 16px;
	overflow: hidden;
	border: 0;
	background: transparent;
	color: var(--teckform-text);
}

.teckform-popup__dialog[open] {
	display: flex;
	align-items: center;
	justify-content: center;
}

.teckform-popup__dialog::backdrop {
	background: transparent;
}

.teckform-popup__dialog::before {
	content: "";
	position: fixed;
	inset: 0;
	background: var(--teckform-popup-overlay);
	opacity: 0;
	-webkit-backdrop-filter: blur(var(--teckform-popup-blur));
	backdrop-filter: blur(var(--teckform-popup-blur));
	transition: opacity var(--teckform-popup-speed) ease;
}

.teckform-popup__dialog.is-visible::before {
	opacity: 1;
}

/* Panel */
.teckform-popup__panel {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	width: 560px;
	max-width: 100%;
	max-height: 85vh;
	overflow: hidden;
	border-radius: 16px;
	background: var(--teckform-surface);
	color: var(--teckform-text);
	box-shadow: 0 30px 80px -20px rgba(15, 23, 42, 0.45);
	opacity: 0;
	outline: none;
	transition:
		opacity var(--teckform-popup-speed) ease,
		transform var(--teckform-popup-speed) cubic-bezier(0.2, 0.7, 0.2, 1);
}

.teckform-popup--anim-zoom .teckform-popup__panel {
	transform: scale(0.92);
}

.teckform-popup--anim-slide-up .teckform-popup__panel {
	transform: translateY(48px);
}

.teckform-popup__dialog.is-visible .teckform-popup__panel {
	opacity: 1;
	transform: none;
}

.teckform-popup__body {
	flex: 1 1 auto;
	min-height: 0;
	padding: 40px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.teckform-popup__title {
	margin: 0 0 12px;
	padding-inline-end: 32px; /* Room for the close button. */
	color: inherit;
	font-size: 1.5rem;
	line-height: 1.25;
}

.teckform-popup__content > :first-child {
	margin-top: 0;
}

.teckform-popup__content > :last-child {
	margin-bottom: 0;
}

.teckform-popup__placeholder {
	padding: 24px;
	border: 1px dashed var(--teckform-border);
	border-radius: 8px;
	color: var(--teckform-muted);
	text-align: center;
}

/* Close button */
.teckform-popup__close {
	--teckform-popup-close-size: 20px;
	position: absolute;
	top: 12px;
	inset-inline-end: 12px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: calc(var(--teckform-popup-close-size) + 16px);
	height: calc(var(--teckform-popup-close-size) + 16px);
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--teckform-muted);
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.teckform-popup__close:hover {
	background: color-mix(in srgb, var(--teckform-text) 8%, transparent);
	color: var(--teckform-text);
}

.teckform-popup__close:focus-visible {
	outline: 2px solid var(--teckform-accent);
	outline-offset: 2px;
}

.teckform-popup__close svg {
	width: var(--teckform-popup-close-size);
	height: var(--teckform-popup-close-size);
	fill: currentColor;
}

/* Slide-in: only the panel, in the bottom end corner. The page stays usable. */
.teckform-popup--slide-in .teckform-popup__dialog {
	inset: auto;
	inset-block-end: 24px;
	inset-inline-end: 24px;
	width: auto;
	height: auto;
	max-width: calc(100vw - 48px);
	padding: 0;
	overflow: visible;
}

.teckform-popup--slide-in .teckform-popup__dialog::before {
	display: none;
}

.teckform-popup--slide-in .teckform-popup__panel {
	width: 380px;
	max-height: calc(100vh - 48px);
}

.teckform-popup--slide-in .teckform-popup__body {
	padding: 28px;
}

/* Full screen */
.teckform-popup--fullscreen .teckform-popup__dialog {
	padding: 0;
}

.teckform-popup--fullscreen .teckform-popup__panel {
	width: 100%;
	height: 100%;
	max-height: none;
	border-radius: 0;
	box-shadow: none;
}

.teckform-popup--fullscreen .teckform-popup__body {
	display: flex;
	flex-direction: column;
}

/* Auto margins center the content, and turn to 0 when it is taller than the window. */
.teckform-popup--fullscreen .teckform-popup__inner {
	width: 100%;
	max-width: 960px;
	margin: auto;
}

.teckform-popup--fullscreen .teckform-popup__close {
	top: 20px;
	inset-inline-end: 20px;
}

/* Elementor editor: the dialog is shown inline below the button so it can be edited. */
.teckform-popup__preview {
	position: relative;
	margin-top: 16px;
	padding: 40px 16px 16px;
	border: 1px dashed var(--teckform-border);
	border-radius: 12px;
	background: color-mix(in srgb, var(--teckform-text) 5%, transparent);
}

.teckform-popup__preview-label {
	position: absolute;
	top: 10px;
	inset-inline-start: 14px;
	color: var(--teckform-muted);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 12px;
	line-height: 1.4;
}

.teckform-popup__preview-label code {
	font-size: inherit;
}

.teckform-popup--preview .teckform-popup__dialog {
	position: static;
	z-index: auto;
	width: auto;
	height: auto;
	max-width: none;
	padding: 0;
	overflow: visible;
}

.teckform-popup--preview .teckform-popup__dialog::before {
	display: none;
}

.teckform-popup--preview.teckform-popup--slide-in .teckform-popup__dialog {
	justify-content: flex-end;
}

.teckform-popup--preview .teckform-popup__panel {
	max-height: none;
	opacity: 1;
	transform: none;
}

.teckform-popup--preview.teckform-popup--fullscreen .teckform-popup__panel {
	min-height: 360px;
}

@media (prefers-reduced-motion: reduce) {
	.teckform-popup *,
	.teckform-popup *::before,
	.teckform-popup *::after {
		animation: none !important;
		transition: none !important;
	}
}

@media (max-width: 767px) {
	.teckform-popup__body {
		padding: 28px 20px;
	}

	.teckform-popup--slide-in .teckform-popup__dialog {
		inset-block-end: 12px;
		inset-inline-end: 12px;
		max-width: calc(100vw - 24px);
	}
}
