/**
 * Email field before downloads (Pro).
 *
 * Every value is a start value: the building block "Email Form" sets its own styles with
 * the Elementor controls or the block settings. Without it the colors of the site are used:
 * the Elementor global colors or the theme (theme.json), the system colors as the last resort.
 *
 * @package NoviIcons
 */

/* Shield: theme and kit styles for buttons and links do not reach these elements. */
.noviicons-gate__submit:not(#noviicons),
.noviicons-gate__cancel:not(#noviicons),
.noviicons-gate__close:not(#noviicons),
.noviicons-gate__privacy:not(#noviicons) {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	width: auto;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0 solid currentColor;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-align: inherit;
	text-decoration: none;
	text-shadow: none;
	text-transform: none;
	white-space: normal;
	transition: none;
}

.noviicons-gate {
	--gate-text: var(--e-global-color-text, var(--wp--preset--color--contrast, CanvasText));
	--gate-panel: var(--wp--preset--color--base, Canvas);
	--gate-accent: var(--e-global-color-accent, var(--e-global-color-primary, var(--wp--preset--color--primary, var(--gate-text))));
	--gate-on-accent: var(--gate-panel);
	--gate-line: color-mix(in srgb, currentColor 25%, transparent);
	box-sizing: border-box;
	width: min(28rem, calc(100vw - 2rem));
	max-width: none;
	max-height: calc(100vh - 2rem);
	margin: auto;
	padding: 0;
	overflow: visible;
	border: 0;
	background: transparent;
	color: var(--gate-text);
	font-family: var(--e-global-typography-text-font-family, inherit);
}

.noviicons-gate::backdrop {
	background: rgba(0, 0, 0, 0.55);
}

/* The box: background, frame and space. The building block "Email Form" sets them. */
.noviicons-gate__box {
	position: relative;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 14px;
	width: 100%;
	max-height: calc(100vh - 2rem);
	margin: 0;
	padding: 28px;
	overflow: auto;
	border-radius: 12px;
	background: var(--gate-panel);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	color: inherit;
}

/* Preview in the editor: the same box on the page, not as a dialog. */
.noviicons-gate--preview {
	display: block;
	width: 100%;
	max-width: 28rem;
	margin: 0;
}

.noviicons-gate--preview .noviicons-gate__box {
	max-height: none;
}

/* Block preview: the box takes the colors, type, space and frame of the block around it.
 * On the page gate.js puts the classes and styles of the block on the box itself. */
.noviicons-gate--preview.noviicons-gate--block .noviicons-gate__box {
	padding: inherit;
	border: inherit;
	border-radius: inherit;
	background: inherit;
	box-shadow: inherit;
}

/* Elementor: the dialog lives in the widget (so its styles apply); the widget takes no room. */
.noviicons-gate-host--inside {
	position: absolute;
	width: 0;
	height: 0;
	overflow: visible;
}

.noviicons-gate-host--copy {
	display: none;
}

.noviicons-gate__title {
	margin: 0;
	padding-right: 32px;
	color: inherit;
	font-size: 1.25em;
	line-height: 1.3;
}

.noviicons-gate__lead,
.noviicons-gate__error {
	margin: 0;
	line-height: 1.5;
}

.noviicons-gate__error:empty {
	display: none;
}

.noviicons-gate__fields {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.noviicons-gate__label {
	font-weight: 600;
}

.noviicons-gate__input {
	box-sizing: border-box;
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--gate-line);
	border-radius: 8px;
	background: transparent;
	color: inherit;
	font: inherit;
}

.noviicons-gate__consent {
	display: flex;
	gap: 8px;
	align-items: flex-start;
	font-size: 0.9em;
	line-height: 1.45;
}

.noviicons-gate__consent input {
	flex: none;
	margin: 0.2em 0 0;
}

.noviicons-gate__privacy:not(#noviicons) {
	color: inherit;
	text-decoration: underline;
}

.noviicons-gate__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.noviicons-gate__submit:not(#noviicons),
.noviicons-gate__cancel:not(#noviicons) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 18px;
	border-radius: 8px;
	cursor: pointer;
	transition: opacity 0.2s, background-color 0.2s, color 0.2s;
}

.noviicons-gate__submit:not(#noviicons) {
	background: var(--gate-accent);
	color: var(--gate-on-accent);
	font-weight: 600;
}

.noviicons-gate__submit:disabled:not(#noviicons) {
	opacity: 0.6;
	cursor: progress;
}

.noviicons-gate__cancel:not(#noviicons) {
	border-width: 1px;
	border-color: var(--gate-line);
}

.noviicons-gate__close:not(#noviicons) {
	position: absolute;
	top: 14px;
	right: 14px;
	display: inline-flex;
	padding: 6px;
	border-radius: 999px;
	cursor: pointer;
}

.noviicons-gate__close svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

.noviicons-gate [hidden]:not(#noviicons) {
	display: none;
}

/* The limit message: no fields, only the message and "Close". */
.noviicons-gate.is-limit .noviicons-gate__fields,
.noviicons-gate.is-limit .noviicons-gate__submit:not(#noviicons),
.noviicons-gate.is-limit .noviicons-gate__error {
	display: none;
}

.noviicons-gate :focus-visible {
	outline: 2px solid var(--gate-accent);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.noviicons-gate__submit:not(#noviicons),
	.noviicons-gate__cancel:not(#noviicons) {
		transition: none;
	}
}
