/* Popup leadowy na stronie głównej. Układ 1:1 z megapolis-web (HomeLeadPopup):
 * hero ze zdjęciem (proporcje 1680:355) + dwie kolumny (preferencje | formularz).
 * Rozmiary hero w `cqw` skalują się z szerokością dialogu, więc kadr zdjęcia
 * i pozycje napisów zostają jak w makiecie. Kod formularza: inc/lead-popup/cf7-form.txt */

.lp-backdrop {
	--lp-navy: #003c71;
	--lp-gold: #a87a3d;
	--lp-paper: #f5f3ee;
	--lp-line: #b9c3d3;

	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
	overflow: hidden;
	background: rgba(0, 20, 40, 0.55);
	backdrop-filter: blur(4px);
	animation: lp-fade 0.2s ease-out;
}

.lp-backdrop[hidden] {
	display: none;
}

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

.lp-dialog {
	position: relative;
	width: 100%;
	max-width: 1120px;
	max-height: 92vh;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	container-type: inline-size;
	background: var(--lp-paper);
	color: var(--lp-navy);
	border-radius: 6px;
	box-shadow: 0 24px 64px rgba(0, 60, 113, 0.3);
	font-family: inherit;
	animation: lp-slide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.lp-dialog:focus {
	outline: none;
}

.lp-close {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.85);
	color: var(--lp-navy);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease;
}

.lp-close:hover,
.lp-close:focus-visible {
	background: #fff;
	outline: 2px solid var(--lp-gold);
	outline-offset: 2px;
}

/* ── Hero ──
 * Wysokość = proporcje makiety (21.13cqw), ale nie więcej niż 19vh — dzięki temu
 * całość mieści się w oknie bez przewijania. Zdjęcie kadrowane od dołu. */
.lp-hero {
	--lp-h: max(150px, min(21.13cqw, 19vh));
	position: relative;
	height: var(--lp-h);
	background: #d59a55 var(--lp-hero-img) no-repeat;
	background-size: 100% auto;
	background-position: 0 calc(var(--lp-h) - 62.98cqw);
}

.lp-logo {
	position: absolute;
	left: 8.45cqw;
	top: 3cqw;
	width: 20.7cqw;
	height: auto;
}

.lp-heading {
	position: absolute;
	left: 15.2cqw;
	right: 4cqw;
	bottom: 2.2cqw;
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-size: 2.68cqw;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #fff;
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ── Body (formularz CF7 jako grid) ── */
.lp-dialog .lp-body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 460px);
	gap: 12px 48px;
	margin: 0;
	padding: 26px 48px 28px;
}

.lp-body .hidden-fields-container,
.lp-body .wpcf7-spinner {
	display: none;
}

.lp-body .wpcf7-form-control-wrap {
	display: block;
}

.lp-prefs {
	grid-column: 1;
	grid-row: 1;
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.lp-formcol {
	grid-column: 2;
	grid-row: 1;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.lp-actions {
	grid-column: 2;
	grid-row: 2;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.lp-body .wpcf7-response-output {
	grid-column: 1 / -1;
	margin: 0;
}

/* Komunikat po wysyłce zastępuje formularz (jak w megapolis-web). Chowamy cały
 * wrapper CF7 — dziecko ma własne `display`, więc sam atrybut [hidden] by nie wystarczył. */
.lp-success {
	padding: 56px 32px 64px;
	text-align: center;
	font-size: 16px;
	line-height: 1.6;
}

.lp-success[hidden] {
	display: none;
}

.lp-success p {
	margin: 0;
}

.lp-sent .lp-dialog .wpcf7 {
	display: none;
}

.lp-steps {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 7px;
}

.lp-steps li {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 30px;
	margin: 0;
	font-size: 14px;
	letter-spacing: 0.04em;
}

.lp-step-no {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border: 1px solid #9aa9c0;
	border-radius: 50%;
	font-size: 12px;
	color: #6f83a3;
}

.lp-group {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.lp-group-title {
	padding: 0;
	margin-bottom: 12px;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.1em;
	line-height: 1.25;
	text-transform: uppercase;
}

.lp-districts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 188px));
	gap: 14px;
}

.lp-rooms {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
}

.lp-chip {
	height: 44px;
	min-width: 86px;
	margin: 0;
	padding: 0 12px;
	border: 1px solid #c3ccd9;
	border-radius: 4px;
	background: #fff;
	color: #6f83a3;
	font-family: inherit;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.lp-districts .lp-chip {
	height: 47px;
}

.lp-chip:hover {
	border-color: var(--lp-navy);
}

.lp-chip[aria-pressed="true"] {
	background: var(--lp-navy);
	border-color: var(--lp-navy);
	color: #fff;
}

.lp-chip:focus-visible {
	outline: 2px solid var(--lp-gold);
	outline-offset: 2px;
}

/* ── Formularz ── */
.lp-form-title {
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--lp-navy);
}

.lp-row {
	display: grid;
	grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
	gap: 14px;
}

.lp-field {
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-width: 0;
	margin: 0;
}

.lp-label {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.lp-req {
	color: #cc0033;
	font-weight: 700;
}

.lp-body input[type="text"],
.lp-body input[type="email"],
.lp-body input[type="tel"] {
	width: 100%;
	height: 40px;
	margin: 0;
	padding: 0 14px;
	background: #fff;
	border: 1px solid var(--lp-line);
	border-radius: 4px;
	font-family: inherit;
	font-size: 13px;
	letter-spacing: 0.05em;
	color: var(--lp-navy);
	outline: none;
	box-shadow: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lp-body input::placeholder {
	color: #6f7f96;
	opacity: 1;
}

.lp-body input[type="text"]:focus-visible,
.lp-body input[type="email"]:focus-visible,
.lp-body input[type="tel"]:focus-visible {
	border-color: var(--lp-navy);
	box-shadow: 0 0 0 3px rgba(0, 60, 113, 0.15);
}

.lp-body .wpcf7-not-valid {
	border-color: #cc0033;
}

.lp-body .wpcf7-not-valid-tip {
	display: block;
	font-size: 12px;
	color: #cc0033;
}

/* Zgody RODO */
.lp-consents {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.lp-consent {
	padding: 8px 12px;
	background: rgba(0, 60, 113, 0.04);
	border: 1.5px solid rgba(0, 60, 113, 0.2);
	border-radius: 10px;
	font-size: 12px;
	line-height: 1.4;
	color: rgba(0, 60, 113, 0.78);
}

.lp-consent:has(input[type="checkbox"]:checked) {
	border-color: var(--lp-navy);
	background: rgba(0, 60, 113, 0.06);
}

.lp-consent .wpcf7-list-item {
	margin: 0;
}

.lp-consent label {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	margin: 0;
	cursor: pointer;
}

.lp-consent input[type="checkbox"] {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	margin: 1px 0 0;
	accent-color: var(--lp-navy);
	cursor: pointer;
}

.lp-consent a {
	color: var(--lp-gold);
	font-weight: 700;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.lp-consent a:hover {
	color: var(--lp-navy);
}

.lp-consent-text {
	margin: 0;
	font-size: 11.5px;
	line-height: 1.4;
	color: rgba(0, 60, 113, 0.7);
}

.lp-body .lp-submit {
	width: 100%;
	height: 54px;
	margin: 8px 0 0;
	padding: 0 24px;
	border: 0;
	border-radius: 27px;
	background: var(--lp-gold);
	color: #fff;
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease;
}

.lp-body .lp-submit:hover:not(:disabled) {
	background: #916830;
	transform: translateY(-1px);
}

.lp-body .lp-submit:focus-visible {
	outline: 2px solid var(--lp-navy);
	outline-offset: 2px;
}

.lp-body .lp-submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.lp-note {
	margin: 0;
	text-align: center;
	font-size: 13px;
	letter-spacing: 0.04em;
}

@keyframes lp-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes lp-slide {
	from { opacity: 0; transform: translateY(20px) scale(0.97); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Niskie okna desktopowe (np. laptop 1366×768) ──
 * Niższy hero z mniejszym logo, węższe odstępy, a przycisk schodzi pod lewą
 * kolumnę (ma tam zapas miejsca), zamiast wydłużać prawą. */
@media (min-width: 901px) and (max-height: 820px) {
	.lp-hero {
		--lp-h: max(120px, min(21.13cqw, 15vh));
	}

	.lp-logo {
		top: 2.2cqw;
		width: 15cqw;
	}

	.lp-heading {
		bottom: 1.6cqw;
		font-size: 2.3cqw;
	}

	.lp-dialog .lp-body {
		padding: 18px 48px 20px;
	}

	.lp-prefs {
		gap: 18px;
	}

	.lp-formcol {
		grid-row: 1 / span 2;
		gap: 10px;
	}

	.lp-actions {
		grid-column: 1;
	}

	.lp-consent {
		padding: 6px 12px;
	}
}

/* ── Węższe ekrany ── */
@media (max-width: 900px) {
	.lp-dialog .lp-body {
		grid-template-columns: minmax(0, 1fr);
		gap: 32px;
		padding: 28px 28px 32px;
	}

	.lp-prefs,
	.lp-formcol,
	.lp-actions {
		grid-column: 1;
		grid-row: auto;
	}

	.lp-actions {
		margin-top: -16px;
	}
}

@media (max-width: 720px) {
	.lp-hero {
		height: 200px;
		background-size: cover;
		background-position: 30% 43%;
	}

	.lp-logo {
		left: 20px;
		top: 20px;
		width: 150px;
	}

	.lp-heading {
		left: 20px;
		right: 20px;
		bottom: 20px;
		font-size: 20px;
		line-height: 1.2;
	}

	.lp-dialog .lp-body {
		padding: 24px 20px 28px;
	}

	.lp-districts {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.lp-rooms .lp-chip {
		flex: 1 1 0;
		min-width: 0;
	}

	.lp-row {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (prefers-reduced-motion: reduce) {
	.lp-backdrop,
	.lp-dialog {
		animation: none;
	}
}
