/**
 * Futuvia Ebook Guard – formularz pobrania i strona pobierania.
 * Kolory domyślnie dziedziczą globalne kolory Elementora (--e-global-color-*).
 */

.fveg {
	--fveg-accent: var(--e-global-color-accent, var(--e-global-color-primary, #f2af23));
	--fveg-accent-hover: color-mix(in srgb, var(--fveg-accent) 86%, #000);
	--fveg-accent-text: #1a1a1a;
	--fveg-text: inherit;
	--fveg-muted: color-mix(in srgb, currentColor 62%, transparent);
	--fveg-border: color-mix(in srgb, currentColor 20%, transparent);
	--fveg-surface: #fff;
	--fveg-radius: 8px;
	--fveg-control-height: 52px;
	--fveg-gap: clamp(24px, 4vw, 48px);
	--fveg-error: #b42318;
	--fveg-error-bg: #fef3f2;
	--fveg-success: currentColor;
	--fveg-success-bg: color-mix(in srgb, var(--fveg-accent) 14%, #fff);

	container-type: inline-size;
	color: var(--fveg-text);
	box-sizing: border-box;
}

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

/*
 * Widget Elementora bywa elementem kontenera flex ustawionego w kolumnę. Bez jawnej szerokości
 * przeglądarka liczy jego wysokość dla zerowej szerokości treści (skutek container-type powyżej),
 * co zostawia pod formularzem pustą przestrzeń.
 */
.elementor-widget-fveg-ebook-form {
	width: 100%;
}

/* ---------- Karta ---------- */

.fveg__card {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--fveg-gap);
	align-items: center;
}

.fveg--has-cover .fveg__card {
	grid-template-columns: minmax(140px, var(--fveg-cover-width, 34%)) 1fr;
}

.fveg--cover-right .fveg__cover {
	order: 2;
}

.fveg--cover-top.fveg--has-cover .fveg__card {
	grid-template-columns: 1fr;
}

.fveg--cover-top .fveg__cover {
	max-width: var(--fveg-cover-max, 260px);
	margin-inline: auto;
}

.fveg__cover {
	margin: 0;
	line-height: 0;
}

.fveg__cover img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 4px;
	box-shadow: 0 22px 44px -18px rgba(0, 0, 0, 0.45), 0 4px 10px -4px rgba(0, 0, 0, 0.2);
}

.fveg__body {
	min-width: 0;
}

.fveg__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 12px;
	font-size: 0.78em;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--fveg-muted);
}

.fveg__eyebrow::before {
	content: "";
	width: 28px;
	height: 2px;
	background: var(--fveg-accent);
}

.fveg .fveg__heading {
	margin: 0 0 14px;
	line-height: 1.15;
}

.fveg .fveg__subtitle {
	margin: -6px 0 16px;
	font-size: 1.1em;
	font-style: italic;
	color: var(--fveg-muted);
}

.fveg__description {
	margin: 0 0 18px;
	color: var(--fveg-muted);
}

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

.fveg__meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: var(--fveg-justify, flex-start);
	gap: 6px 18px;
	margin: 0 0 22px;
	padding: 0;
	list-style: none;
	font-size: 0.85em;
	color: var(--fveg-muted);
}

.fveg__meta li {
	position: relative;
	margin: 0;
	padding-left: 16px;
}

.fveg__meta li.fveg__meta-item--icon {
	display: inline-flex;
	gap: var(--fveg-meta-icon-gap, 8px);
	align-items: center;
	padding-left: 0;
}

.fveg__meta li.fveg__meta-item--icon::before {
	content: none;
}

.fveg__meta-icon {
	display: inline-flex;
	line-height: 1;
	color: var(--fveg-meta-icon, var(--fveg-accent));
	font-size: var(--fveg-meta-icon-size, 14px);
}

.fveg__meta-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.fveg__meta li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--fveg-meta-icon, var(--fveg-accent));
	transform: translateY(-50%);
}

/* ---------- Formularz ---------- */

.fveg__form {
	display: grid;
	gap: 14px;
	margin: 0;
}

.fveg__row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: flex-end;
}

.fveg__field {
	display: grid;
	gap: 6px;
	flex: 1 1 240px;
	min-width: 0;
}

.fveg--stacked .fveg__row {
	flex-direction: column;
	align-items: stretch;
}

.fveg--stacked .fveg__field {
	flex-basis: auto;
}

.fveg__label {
	font-size: 0.9em;
	font-weight: 600;
}

.fveg .fveg__input {
	width: 100%;
	min-height: var(--fveg-control-height);
	margin: 0;
	padding: 0 16px;
	border: 1px solid var(--fveg-border);
	border-radius: var(--fveg-radius);
	background: var(--fveg-surface);
	color: #1a1a1a;
	font: inherit;
	font-size: 1rem;
	line-height: 1.3;
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fveg .fveg__input::placeholder {
	color: #8a8a8a;
	opacity: 1;
}

.fveg .fveg__input:focus {
	outline: none;
	border-color: var(--fveg-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--fveg-accent) 30%, transparent);
}

.fveg .fveg__input[aria-invalid="true"] {
	border-color: var(--fveg-error);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--fveg-error) 16%, transparent);
}

.fveg .fveg__button,
.fveg-download .fveg__button {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: var(--fveg-control-height, 52px);
	margin: 0;
	padding: 0 28px;
	border: 0;
	border-radius: var(--fveg-radius, 8px);
	background: var(--fveg-accent, #f2af23);
	color: var(--fveg-accent-text, #1a1a1a);
	font: inherit;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.fveg .fveg__button:hover,
.fveg .fveg__button:focus,
.fveg-download .fveg__button:hover,
.fveg-download .fveg__button:focus {
	background: var(--fveg-accent-hover, #da9e20);
	color: var(--fveg-accent-text, #1a1a1a);
	text-decoration: none;
}

.fveg .fveg__button:active {
	transform: translateY(1px);
}

.fveg .fveg__button:focus-visible,
.fveg-download .fveg__button:focus-visible {
	outline: 3px solid color-mix(in srgb, var(--fveg-accent, #f2af23) 45%, transparent);
	outline-offset: 2px;
}

.fveg--stacked .fveg__button {
	width: 100%;
}

.fveg__button-icon {
	display: inline-flex;
	line-height: 0;
}

.fveg__button-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.fveg__spinner {
	display: none;
	width: 18px;
	height: 18px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: fveg-spin 0.7s linear infinite;
}

.fveg .fveg__button.is-loading {
	cursor: progress;
}

.fveg .fveg__button.is-loading .fveg__spinner {
	display: inline-block;
}

.fveg .fveg__button.is-loading .fveg__button-icon {
	display: none;
}

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

.fveg__consent {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	text-align: left;
	font-size: 0.85em;
	line-height: 1.5;
	color: var(--fveg-muted);
}

.fveg .fveg__checkbox {
	flex: none;
	width: 18px;
	height: 18px;
	margin: 2px 0 0;
	accent-color: var(--fveg-accent);
	cursor: pointer;
}

.fveg .fveg__consent label {
	margin: 0;
	font-size: inherit;
	font-weight: inherit;
	line-height: 1.5;
	cursor: pointer;
}

.fveg__consent a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.fveg__consent.is-invalid {
	color: var(--fveg-error);
}

.fveg__required {
	color: var(--fveg-error);
}

.fveg__message {
	margin: 0;
	padding: 12px 14px;
	border-radius: var(--fveg-radius);
	font-size: 0.9em;
	line-height: 1.45;
	background: color-mix(in srgb, currentColor 6%, transparent);
}

.fveg__message--error {
	background: var(--fveg-error-bg);
	color: var(--fveg-error);
}

.fveg__message[hidden],
.fveg__success[hidden],
.fveg__form[hidden] {
	display: none;
}

.fveg__note {
	margin: 0;
	font-size: 0.8em;
	color: var(--fveg-muted);
}

.fveg__success {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	padding: 20px 22px;
	border-left: 4px solid var(--fveg-accent);
	border-radius: var(--fveg-radius);
	background: var(--fveg-success-bg);
	color: var(--fveg-success);
	outline: none;
}

.fveg__success-icon {
	flex: none;
	display: inline-flex;
	color: var(--fveg-accent-hover);
}

.fveg__success-heading {
	margin: 0 0 4px;
	font-weight: 700;
	font-size: 1.05em;
}

.fveg__success-text {
	margin: 0;
	line-height: 1.5;
}

.fveg__admin-hint {
	font-size: 0.85em;
	color: var(--fveg-muted);
}

.fveg--placeholder {
	padding: 24px;
	border: 2px dashed var(--fveg-border, #ccc);
	border-radius: 8px;
	text-align: center;
	color: #666;
}

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

@container (max-width: 620px) {
	.fveg--has-cover .fveg__card {
		grid-template-columns: 1fr;
	}

	.fveg__cover {
		max-width: var(--fveg-cover-max, 220px);
		margin-inline: auto;
		order: 0 !important;
	}
}

@container (max-width: 440px) {
	.fveg--inline .fveg__button {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.fveg *,
	.fveg-download * {
		transition: none !important;
		animation-duration: 1.5s !important;
	}
}

/* ---------- Strona pobierania ---------- */

.fveg-download {
	--fveg-accent: var(--e-global-color-accent, var(--e-global-color-primary, #f2af23));
	--fveg-accent-hover: color-mix(in srgb, var(--fveg-accent) 86%, #000);
	--fveg-accent-text: #1a1a1a;
	--fveg-radius: 8px;
	--fveg-control-height: 56px;

	padding: clamp(40px, 8vw, 96px) 20px;
}

.fveg-download__inner {
	max-width: 920px;
	margin: 0 auto;
}

.fveg-download__card {
	display: grid;
	grid-template-columns: 1fr;
	gap: clamp(28px, 5vw, 56px);
	align-items: center;
}

.fveg-download__card:has(.fveg-download__cover) {
	grid-template-columns: minmax(160px, 300px) 1fr;
}

.fveg-download__card--invalid,
.fveg-download__card--expired,
.fveg-download__card--exhausted,
.fveg-download__card--revoked,
.fveg-download__card--unavailable {
	max-width: 620px;
	margin: 0 auto;
	text-align: center;
}

.fveg-download__cover {
	margin: 0;
	line-height: 0;
}

.fveg-download__cover img {
	width: 100%;
	height: auto;
	border-radius: 4px;
	box-shadow: 0 26px 50px -20px rgba(0, 0, 0, 0.5), 0 4px 12px -4px rgba(0, 0, 0, 0.2);
}

.fveg-download__eyebrow {
	margin: 0 0 8px;
	font-size: 0.8em;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	opacity: 0.65;
}

.fveg-download__title {
	margin: 0 0 24px;
	line-height: 1.15;
}

.fveg-download__facts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1px;
	margin: 0 0 28px;
	padding: 0;
	list-style: none;
	border-radius: 8px;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.1);
	border: 1px solid rgba(0, 0, 0, 0.1);
}

.fveg-download__facts li {
	display: grid;
	gap: 2px;
	margin: 0;
	padding: 14px 16px;
	background: #fff;
}

.fveg-download__facts span {
	font-size: 0.75em;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.6;
}

.fveg-download__form {
	margin: 0 0 22px;
}

.fveg-download .fveg-download__button {
	min-width: 260px;
	font-size: 1.05rem;
}

.fveg-download__note,
.fveg-download__help {
	margin: 0 0 10px;
	font-size: 0.88em;
	line-height: 1.55;
	opacity: 0.75;
}

.fveg-download__text {
	margin: 0 0 24px;
	font-size: 1.05em;
	line-height: 1.6;
}

.fveg-download__link {
	color: inherit;
	text-underline-offset: 3px;
}

@media (max-width: 680px) {
	.fveg-download__card:has(.fveg-download__cover) {
		grid-template-columns: 1fr;
	}

	.fveg-download__cover {
		max-width: 200px;
		margin-inline: auto;
	}

	.fveg-download__facts {
		grid-template-columns: 1fr;
	}

	.fveg-download .fveg-download__button {
		width: 100%;
		min-width: 0;
	}
}
