/*
 * Public popup styles. Every selector is scoped to .fcl-popup so the active
 * theme keeps ownership of its own buttons, inputs, and typography.
 */
.fcl-popup,
.fcl-popup * {
	box-sizing: border-box;
}

.fcl-popup {
	--fcl-primary: #717ebc;
	--fcl-primary-strong: #5966a4;
	--fcl-primary-hover: #4f5b98;
	--fcl-primary-contrast: #ffffff;
	--fcl-surface: #ffffff;
	--fcl-surface-soft: #f7f8fc;
	--fcl-text: #202744;
	--fcl-muted: #656b81;
	--fcl-border: rgba(32, 39, 68, 0.14);
	--fcl-error: #b42318;
	--fcl-radius-dialog: 24px;
	--fcl-radius-control: 12px;
	--fcl-shadow: 0 24px 70px rgba(32, 39, 68, 0.2);
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	max-width: 100vw;
	overflow-x: hidden;
	padding: 20px;
	color: var(--fcl-text);
	color-scheme: light;
	direction: rtl;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.6;
	text-align: right;
	isolation: isolate;
}

.fcl-popup[hidden],
.fcl-popup [hidden] {
	display: none !important;
}

body.fcl-popup-lock {
	overflow: hidden !important;
}

.fcl-popup__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(12, 28, 42, 0.58);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
	opacity: 0;
	transition-property: opacity;
	transition-duration: 180ms;
	transition-timing-function: ease-out;
}

.fcl-popup__dialog {
	position: relative;
	width: min(100%, 480px);
	min-width: 0;
	max-height: min(720px, calc(100dvh - 40px));
	overflow: auto;
	overflow-x: hidden;
	padding: 40px 36px 32px;
	border: 1px solid var(--fcl-border);
	border-radius: var(--fcl-radius-dialog);
	background: var(--fcl-surface);
	box-shadow: var(--fcl-shadow);
	opacity: 0;
	transform: translateY(12px) scale(0.98);
	transition-property: transform, opacity, box-shadow;
	transition-duration: 180ms;
	transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

.fcl-popup.is-open .fcl-popup__backdrop {
	opacity: 1;
}

.fcl-popup.is-open .fcl-popup__dialog {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.fcl-popup__close {
	position: absolute;
	top: 16px;
	left: 16px;
	display: inline-grid;
	width: 44px;
	height: 44px;
	place-items: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--fcl-muted);
	cursor: pointer;
	font-family: inherit;
	font-size: 26px;
	font-weight: 400;
	line-height: 1;
	transition-property: background-color, color, transform;
	transition-duration: 140ms;
	transition-timing-function: ease-out;
}

.fcl-popup__close:hover {
	background: var(--fcl-surface-soft);
	color: var(--fcl-text);
}

.fcl-popup__close:active {
	transform: scale(0.96);
}

.fcl-popup__close:focus-visible,
.fcl-popup__input:focus-visible,
.fcl-popup__button:focus-visible {
	outline: 3px solid rgba(113, 126, 188, 0.35);
	outline: 3px solid color-mix(in srgb, var(--fcl-primary) 35%, transparent);
	outline-offset: 3px;
}

.fcl-popup__mark {
	width: 42px;
	height: 5px;
	margin-bottom: 18px;
	border-radius: 999px;
	background: var(--fcl-primary);
}

.fcl-popup__title {
	max-width: 13ch;
	overflow-wrap: anywhere;
	margin: 0;
	color: var(--fcl-text);
	font-size: clamp(26px, 5vw, 34px);
	font-weight: 760;
	letter-spacing: -0.035em;
	line-height: 1.2;
	text-wrap: balance;
}

.fcl-popup__form-view,
.fcl-popup__success-view,
.fcl-popup__form,
.fcl-popup__field {
	min-width: 0;
}

.fcl-popup__description {
	/* max-width: 38ch; */
	overflow-wrap: anywhere;
	margin: 12px 0 0;
	color: var(--fcl-muted);
	font-size: 15px;
	line-height: 1.85;
	text-wrap: pretty;
}

.fcl-popup__form {
	display: grid;
	gap: 18px;
	margin-top: 28px;
}

.fcl-popup__field {
	display: grid;
	gap: 8px;
}

.fcl-popup__label {
	color: var(--fcl-text);
	font-size: 14px;
	font-weight: 650;
}

.fcl-popup__input {
	width: 100%;
	min-width: 0;
	min-height: 54px;
	appearance: none;
	padding: 12px 16px;
	border: 1px solid var(--fcl-border);
	border-radius: var(--fcl-radius-control);
	outline: 0;
	background: var(--fcl-surface-soft);
	color: var(--fcl-text);
	direction: ltr;
	font: inherit;
	font-size: 18px;
	letter-spacing: 0.02em;
	text-align: left;
	transition-property: background-color, border-color, box-shadow;
	transition-duration: 140ms;
	transition-timing-function: ease-out;
}

.fcl-popup__input--name {
	direction: rtl;
	font-size: 16px;
	letter-spacing: normal;
	text-align: right;
}

.fcl-popup__input::placeholder {
	color: rgba(101, 107, 129, 0.75);
	color: color-mix(in srgb, var(--fcl-muted) 75%, transparent);
	opacity: 1;
}

.fcl-popup__input:hover {
	border-color: rgba(113, 126, 188, 0.4);
	border-color: color-mix(in srgb, var(--fcl-primary) 35%, var(--fcl-border));
}

.fcl-popup__input:focus {
	border-color: var(--fcl-primary-strong);
	background: var(--fcl-surface);
	box-shadow: 0 0 0 4px rgba(113, 126, 188, 0.16);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--fcl-primary) 16%, transparent);
}

.fcl-popup__error {
	margin: 0;
	color: var(--fcl-error);
	font-size: 13px;
	font-weight: 600;
}

.fcl-popup__button {
	display: inline-flex;
	width: 100%;
	min-width: 0;
	min-height: 54px;
	align-items: center;
	justify-content: center;
	padding: 12px 20px;
	border: 1px solid var(--fcl-primary-strong);
	border-radius: var(--fcl-radius-control);
	background: var(--fcl-primary-strong);
	color: var(--fcl-primary-contrast);
	cursor: pointer;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	overflow-wrap: anywhere;
	text-align: center;
	transition-property: background-color, border-color, color, transform, box-shadow;
	transition-duration: 140ms;
	transition-timing-function: ease-out;
}

.fcl-popup__button:hover {
	border-color: var(--fcl-primary-hover);
	background: var(--fcl-primary-hover);
	box-shadow: 0 8px 18px rgba(89, 102, 164, 0.2);
	box-shadow: 0 8px 18px color-mix(in srgb, var(--fcl-primary-strong) 20%, transparent);
}

.fcl-popup__button:active {
	transform: scale(0.96);
}

.fcl-popup__button:disabled {
	cursor: wait;
	opacity: 0.72;
}

.fcl-popup__button--secondary {
	margin-top: 26px;
	border-color: var(--fcl-border);
	background: var(--fcl-surface-soft);
	color: var(--fcl-text);
}

.fcl-popup__button--secondary:hover {
	border-color: var(--fcl-primary);
	background: var(--fcl-surface);
	color: var(--fcl-primary-hover);
}

.fcl-popup__privacy {
	margin: 16px 0 0;
	color: var(--fcl-muted);
	font-size: 12px;
	line-height: 1.7;
}

.fcl-popup__honeypot {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.fcl-popup__success-view {
	padding-top: 16px;
	text-align: right;
}

.fcl-popup__success-mark {
	display: grid;
	width: 56px;
	height: 56px;
	margin-bottom: 22px;
	place-items: center;
	border-radius: 50%;
	background: rgba(113, 126, 188, 0.14);
	background: color-mix(in srgb, var(--fcl-primary) 13%, var(--fcl-surface));
	color: var(--fcl-primary-strong);
	font-size: 28px;
	font-weight: 750;
}

@media (max-width: 520px) {
	.fcl-popup {
		padding: 12px;
	}

	.fcl-popup__dialog {
		width: 100%;
		max-width: 100%;
		max-height: calc(100dvh - 24px);
		padding: 36px 22px 24px;
		border-radius: 20px;
	}

	.fcl-popup__button {
		white-space: normal;
	}

	.fcl-popup__close {
		top: 10px;
		left: 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fcl-popup__backdrop,
	.fcl-popup__dialog,
	.fcl-popup__close,
	.fcl-popup__input,
	.fcl-popup__button {
		transition-duration: 1ms;
		transition-timing-function: linear;
	}

	.fcl-popup__dialog {
		transform: none;
	}
}
