/* Soward – Popup rekrutacyjny
 * Wymiary w cqw (1cqw = 1% szerokości okna popupu), więc projekt skaluje się 1:1
 * w każdym rozmiarze desktopowym. Poniżej 760 px przechodzi w układ mobilny.
 */

.srp {
	--srp-primary: #8f3985;
	--srp-accent: #f5841f;
	--srp-lilac: #eeddf1;
	--srp-peach: #fdebd9;
	--srp-text: #2e2440;
	--srp-muted: #8a8296;
	--srp-line: #ddd6e4;
	--srp-max: 1180px;
	--srp-overlay: rgba(30, 20, 40, .55);
	/* Nagłówki: Trajan Pro (Adobe Fonts / self-hosted / systemowy) → zamiennik Cinzel */
	--srp-serif: "trajan-pro-3", "Trajan Pro 3", "Trajan Pro", "TrajanPro-Bold", "Cinzel", Georgia, serif;
	/* Tekst: Work Sans (w paczce) */
	--srp-sans: "Work Sans", "Segoe UI", system-ui, sans-serif;
	--srp-h-scale: 1;

	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	font-family: var(--srp-sans);
	color: var(--srp-text);
	-webkit-font-smoothing: antialiased;
}
.srp[hidden] { display: none !important; }
.srp *, .srp *::before, .srp *::after { box-sizing: border-box; }

.srp__overlay {
	position: absolute;
	inset: 0;
	background: var(--srp-overlay);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	opacity: 0;
	transition: opacity .3s ease;
}

.srp__dialog {
	container: srp / inline-size;
	position: relative;
	/* Wymiary są w cqw, więc wysokość rośnie proporcjonalnie do szerokości.
	   Ograniczenie szerokości do wysokości ekranu = popup zawsze mieści się bez przewijania. */
	width: min(100%, calc((100vh - 48px) * 1.32));
	width: min(100%, calc((100dvh - 48px) * 1.32));
	max-width: var(--srp-max);
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: #fff;
	border-radius: 28px;
	box-shadow: 0 30px 80px rgba(40, 10, 50, .35);
	display: grid;
	grid-template-columns: 59% 41%;
	opacity: 0;
	transform: translateY(24px) scale(.97);
	transition: opacity .35s ease, transform .45s cubic-bezier(.2, .9, .3, 1.2);
	scrollbar-width: thin;
}
.srp.is-open .srp__overlay { opacity: 1; }
.srp.is-open .srp__dialog { opacity: 1; transform: none; }

/* Tryb osadzony (edytor Elementora / wyzwalacz "inline") */
.srp--inline { position: relative; inset: auto; z-index: 1; padding: 0; }
.srp--inline .srp__overlay { display: none; }
.srp--inline .srp__dialog { max-height: none; overflow: hidden; margin: 0 auto; box-shadow: 0 16px 50px rgba(40, 10, 50, .18); }
.srp--inline .srp__close { display: none; }

/* Tło: jedno zdjęcie (dzieci + szkoła + fala), wyrównane do dołu okna.
 * 66.667cqw = wysokość zdjęcia 3:2 przy pełnej szerokości popupu. */
.srp__bg {
	position: absolute;
	left: 0; right: 0; bottom: 0;
	height: calc(100cqw / var(--srp-bg-ratio, 1.5));
	background: var(--srp-bg) center bottom / cover no-repeat;
	pointer-events: none;
	z-index: 0;
}
.srp__bg::after {
	/* miękkie przejście w biel, gdy popup jest wyższy od zdjęcia */
	content: "";
	position: absolute;
	left: 0; right: 0; top: -1px;
	height: 7cqw;
	background: linear-gradient(#fff, rgba(255, 255, 255, 0));
}

/* Zamknij */
.srp__close {
	position: absolute;
	top: 2cqw; right: 1.9cqw;
	z-index: 5;
	width: 3.4cqw; height: 3.4cqw;
	min-width: 36px; min-height: 36px;
	display: grid; place-items: center;
	padding: 0; border: 0; border-radius: 50%;
	background: transparent;
	color: var(--srp-primary);
	cursor: pointer;
	transition: background .2s, transform .2s;
}
.srp__close svg { width: 60%; height: 60%; }
.srp__close:hover { background: rgba(143, 57, 133, .08); transform: rotate(90deg); }
.srp__close:focus-visible { outline: 2px solid var(--srp-accent); outline-offset: 2px; }

/* ───── Lewa kolumna ───── */
.srp__left {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	padding: 1.8cqw 0 var(--srp-kids-space, 28.5cqw) 4.8cqw;
	min-width: 0;
}
.srp__logo {
	display: block;
	width: 17cqw;
	height: auto;
	max-width: none;
	margin: 0 0 1.9cqw -.3cqw;
	mix-blend-mode: multiply;
}
.srp__plane {
	position: absolute;
	top: 2.4cqw; left: 31.5cqw;
	width: 25.6cqw;
	height: auto;
	color: var(--srp-accent);
	pointer-events: none;
}
.srp .srp__heading {
	margin: 0;
	padding: 0;
	font-family: var(--srp-serif);
	font-weight: 700;
	font-size: calc(6.05cqw * var(--srp-h-scale));
	line-height: .95;
	letter-spacing: -.005em;
	color: var(--srp-primary);
	text-transform: none;
	font-variant: normal;
	white-space: nowrap;
}
.srp__heading span { display: block; }
.srp__heading span::first-letter { font-size: 1.12em; }

.srp__year {
	position: relative;
	margin: 1cqw 0 0 9.8cqw;
	font-family: var(--srp-sans);
	font-weight: 500;
	font-size: 1.85cqw;
	letter-spacing: .3em;
	text-transform: uppercase;
	color: var(--srp-primary);
	white-space: nowrap;
}
.srp__swoosh {
	position: absolute;
	left: -12.6cqw; top: -1.5cqw;
	width: 11.5cqw;
	height: auto;
	color: var(--srp-accent);
}
.srp .srp__intro {
	margin: 1.7cqw 0 0;
	font-size: 1.9cqw;
	line-height: 1.3;
	color: var(--srp-text);
}
.srp__intro strong { color: var(--srp-primary); font-weight: 700; }

.srp__features {
	list-style: none;
	margin: 1.3cqw 0 0 -.4cqw;
	padding: 0;
	display: flex;
	gap: 1.6cqw;
	position: relative;
	z-index: 2;
}
.srp__feature {
	margin: 0;
	padding: 0;
	width: 9.2cqw;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: .5cqw;
}
.srp__feature:last-child { width: 11cqw; }
.srp__feature::before { content: none !important; }
.srp__feature-icon {
	width: 6.2cqw; height: 6.2cqw;
	border-radius: 50%;
	display: grid; place-items: center;
	color: var(--srp-primary);
}
.srp__feature-icon svg { width: 54%; height: 54%; }
.srp__tone--lilac { background: var(--srp-lilac); }
.srp__tone--peach { background: var(--srp-peach); }
.srp__tone--peach svg { color: var(--srp-primary); }
.srp__feature:nth-child(4) .srp__feature-icon svg { color: var(--srp-accent); }
.srp__feature-label { font-size: max(1.18cqw, 11px); line-height: 1.25; color: var(--srp-text); }


/* ───── Prawa kolumna / karta ───── */
.srp__right {
	position: relative;
	z-index: 2;
	padding: 8.2cqw 2.3cqw 6.2cqw 1.2cqw;
	display: flex;
	align-items: stretch;
}
.srp__card {
	width: 100%;
	background: rgba(255, 255, 255, .97);
	border-radius: 2cqw;
	box-shadow: 0 1cqw 3.4cqw rgba(90, 40, 110, .12);
	padding: 2.6cqw 2.8cqw 2.4cqw;
	display: flex;
}
.srp__form { width: 100%; margin: 0; display: flex; flex-direction: column; justify-content: center; }
.srp .srp__form-title {
	margin: 0;
	font-family: var(--srp-serif);
	font-weight: 700;
	font-size: calc(2.72cqw * var(--srp-h-scale));
	line-height: 1.05;
	white-space: nowrap;
	color: var(--srp-primary);
	text-transform: none;
	letter-spacing: 0;
}
.srp__form-title::first-letter { font-size: 1.15em; }
.srp .srp__form-subtitle { margin: .2cqw 0 0; font-size: 2.05cqw; line-height: 1.2; color: var(--srp-text); }

.srp__choice { border: 0; padding: 0; margin: 2.8cqw 0 0; min-width: 0; }
.srp__choice legend { padding: 0; margin: 0 0 1.1cqw; font-size: 1.3cqw; font-weight: 700; color: var(--srp-text); }
.srp__choice-row { display: grid; grid-template-columns: .92fr 1.08fr; gap: 1cqw; }
.srp__option {
	position: relative;
	display: flex;
	align-items: center;
	gap: .55cqw;
	height: 5.2cqw;
	padding: 0 .8cqw 0 .9cqw;
	min-width: 0;
	border: 1px solid var(--srp-line);
	border-radius: .9cqw;
	background: #fff;
	cursor: pointer;
	transition: border-color .2s, background .2s, box-shadow .2s;
	margin: 0;
}
.srp__option input { position: absolute; opacity: 0; pointer-events: none; }
.srp__option-icon { width: 2.6cqw; height: 2.6cqw; flex: none; color: var(--srp-primary); }
.srp__option-icon svg { width: 100%; height: 100%; display: block; }
.srp__option-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 1.2cqw; letter-spacing: -.01em; color: var(--srp-text); white-space: nowrap; }
.srp__radio {
	width: 1.7cqw; height: 1.7cqw; min-width: 16px; min-height: 16px;
	flex: none;
	border-radius: 50%;
	border: 1.5px solid #b9b0c4;
	position: relative;
	transition: border-color .2s;
}
.srp__radio::after {
	content: "";
	position: absolute;
	inset: 22%;
	border-radius: 50%;
	background: var(--srp-primary);
	transform: scale(0);
	transition: transform .2s;
}
.srp__option:hover { border-color: #c7a8cf; }
.srp__option:has(input:checked) { background: #f4e8f6; border-color: #d7b6de; }
.srp__option input:checked ~ .srp__option-label { color: var(--srp-primary); font-weight: 700; }
.srp__option input:checked ~ .srp__radio { border-color: var(--srp-primary); border-width: 2px; }
.srp__option input:checked ~ .srp__radio::after { transform: scale(1); }
.srp__option:has(input:focus-visible) { outline: 2px solid var(--srp-accent); outline-offset: 2px; }

.srp__field {
	position: relative;
	display: flex;
	align-items: center;
	margin: 1.7cqw 0 0;
	height: 5.4cqw;
	border: 1px solid var(--srp-line);
	border-radius: .9cqw;
	background: #fff;
	transition: border-color .2s, box-shadow .2s;
}
.srp__choice + .srp__field { margin-top: 2.2cqw; }
.srp__field + .srp__field { margin-top: 1.8cqw; }
.srp__field-icon { width: 2.3cqw; height: 2.3cqw; margin: 0 1.3cqw 0 1.6cqw; flex: none; color: #9a92a6; }
.srp__field-icon svg { width: 100%; height: 100%; display: block; }
.srp .srp__field input {
	flex: 1;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0 1cqw 0 0;
	border: 0 !important;
	outline: 0;
	box-shadow: none !important;
	background: transparent !important;
	font-family: var(--srp-sans);
	font-size: max(1.32cqw, 13px);
	color: var(--srp-text);
	border-radius: 0;
}
.srp__field input::placeholder { color: #9a92a6; opacity: 1; }
.srp__field:focus-within { border-color: var(--srp-primary); box-shadow: 0 0 0 3px rgba(143, 57, 133, .12); }
.srp__field.is-invalid { border-color: #d6334a; box-shadow: 0 0 0 3px rgba(214, 51, 74, .12); }

.srp__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

.srp .srp__submit {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 2.6cqw;
	width: 100%;
	height: 6.4cqw;
	margin: 2.6cqw 0 0;
	padding: 0 2cqw;
	border: 0;
	border-radius: 999px;
	background: var(--srp-accent);
	color: #fff;
	font-family: var(--srp-sans);
	font-size: 1.85cqw;
	font-weight: 600;
	line-height: 1;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	box-shadow: 0 .6cqw 1.6cqw rgba(245, 132, 31, .35);
	transition: transform .2s, box-shadow .2s, filter .2s;
}
.srp__submit svg { width: 2.4cqw; height: 2.4cqw; transition: transform .2s; }
.srp__submit:hover { transform: translateY(-2px); filter: brightness(1.05); box-shadow: 0 .9cqw 2cqw rgba(245, 132, 31, .45); }
.srp__submit:hover svg { transform: translateX(4px); }
.srp__submit:focus-visible { outline: 3px solid var(--srp-primary); outline-offset: 3px; }
.srp__submit[disabled] { cursor: progress; filter: saturate(.7); }
.srp__submit.is-loading span { opacity: .4; }
.srp__submit.is-loading::after {
	content: "";
	position: absolute;
	width: 2cqw; height: 2cqw; min-width: 18px; min-height: 18px;
	border: 3px solid rgba(255, 255, 255, .5);
	border-top-color: #fff;
	border-radius: 50%;
	animation: srp-spin .8s linear infinite;
}
@keyframes srp-spin { to { transform: rotate(360deg); } }

.srp__consent {
	display: flex;
	align-items: flex-start;
	gap: 1cqw;
	margin: 2.4cqw 0 0;
	font-size: max(1.1cqw, 11px);
	line-height: 1.4;
	color: #4a4258;
	cursor: pointer;
}
.srp__consent input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.srp__checkbox {
	flex: none;
	width: 1.6cqw; height: 1.6cqw; min-width: 16px; min-height: 16px;
	margin-top: .1cqw;
	border: 1.5px solid #a39bb0;
	border-radius: 4px;
	background: #fff;
	display: grid; place-items: center;
	transition: background .2s, border-color .2s;
}
.srp__consent input:checked + .srp__checkbox {
	background: var(--srp-primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/80% no-repeat;
	border-color: var(--srp-primary);
}
.srp__consent input:focus-visible + .srp__checkbox { outline: 2px solid var(--srp-accent); outline-offset: 2px; }
.srp__consent.is-invalid .srp__checkbox { border-color: #d6334a; box-shadow: 0 0 0 3px rgba(214, 51, 74, .15); }
.srp__consent a { color: var(--srp-primary); text-decoration: underline; text-underline-offset: 2px; }

.srp .srp__error { margin: 1cqw 0 0; font-size: 1.2cqw; color: #c42a40; font-weight: 600; }
.srp__error[hidden], .srp__success[hidden], .srp__form[hidden] { display: none !important; }

.srp__success {
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 1.2cqw;
	animation: srp-pop .5s cubic-bezier(.2, .9, .3, 1.3);
}
.srp__success-icon { width: 7cqw; height: 7cqw; color: var(--srp-accent); }
.srp__success-icon svg { width: 100%; height: 100%; }
.srp .srp__success p { margin: 0; font-size: 1.6cqw; line-height: 1.45; max-width: 30cqw; }
@keyframes srp-pop { from { opacity: 0; transform: scale(.9); } }

/* ───── Układ mobilny / wąski ───── */
/* Tekst: Gill Sans (Adobe Fonts „Gill Sans Nova”, self-hosted lub systemowy), w razie braku Work Sans */
.srp.srp--body-gill { --srp-sans: "gill-sans-nova", "Gill Sans Nova", "Gill Sans", "Gill Sans MT", "Work Sans", sans-serif; }

@container srp (max-width: 760px) {
	.srp .srp__form-title { white-space: normal; }
	.srp__left { padding: 22px 22px 0; align-items: flex-start; }
	.srp__logo { width: 150px; margin: 0 0 14px; }
	.srp__plane { width: 110px; top: 18px; left: auto; right: 54px; }
	.srp .srp__heading { font-size: calc(clamp(30px, 10.2cqw, 54px) * var(--srp-h-scale)); white-space: normal; }
	.srp__year { margin: 8px 0 0 0; padding-left: 52px; font-size: clamp(11px, 3.2cqw, 16px); letter-spacing: .22em; }
	.srp__swoosh { left: 0; top: -6px; width: 46px; }
	.srp .srp__intro { margin-top: 12px; font-size: clamp(15px, 4.4cqw, 20px); }
	.srp__features { margin: 14px 0 0; gap: 8px; width: 100%; justify-content: space-between; }
	.srp__feature, .srp__feature:last-child { width: 25%; gap: 4px; }
	.srp__feature-icon { width: 48px; height: 48px; }
	.srp__feature-label { font-size: 11.5px; }
	/* mobile: najpierw treść i formularz, zdjęcie dzieci na dole */
	.srp__left { padding-bottom: 0; }
	.srp__bg {
		position: relative;
		grid-column: 1 / -1;
		order: 3;
		height: 64cqw;
		margin-top: -16cqw;
		background: var(--srp-bg) left bottom / 200% auto no-repeat;
	}
	.srp__bg::after { height: 22cqw; }
	.srp__left { order: 1; }
	.srp__right { order: 2; }

	.srp__right { padding: 16px 14px 0; }
	.srp__card { padding: 22px 18px 18px; border-radius: 18px; }
	.srp .srp__form-title { font-size: calc(24px * var(--srp-h-scale)); }
	.srp .srp__form-subtitle { font-size: 17px; }
	.srp__choice { margin-top: 16px; }
	.srp__choice legend { font-size: 14px; margin-bottom: 8px; }
	.srp__choice-row { gap: 8px; grid-template-columns: 1fr 1fr; }
	.srp__option { height: 52px; padding: 0 10px; gap: 6px; border-radius: 10px; }
	.srp__option-icon { width: 26px; height: 26px; }
	.srp__option-label { font-size: 14px; white-space: normal; line-height: 1.1; }
	.srp__radio { width: 18px; height: 18px; }
	.srp__field { height: 50px; margin-top: 12px; border-radius: 10px; }
	.srp__choice + .srp__field { margin-top: 14px; }
	.srp__field + .srp__field { margin-top: 10px; }
	.srp__field-icon { width: 20px; height: 20px; margin: 0 10px 0 14px; }
	.srp .srp__field input { font-size: 16px; } /* 16px = brak auto-zoomu na iOS */
	.srp .srp__submit { height: 54px; font-size: 17px; margin-top: 16px; gap: 14px; }
	.srp__submit svg { width: 20px; height: 20px; }
	.srp__consent { font-size: 12.5px; gap: 10px; margin-top: 14px; }
	.srp .srp__error { font-size: 13px; margin-top: 8px; }
	.srp__success { gap: 10px; padding: 20px 0; }
	.srp__success-icon { width: 64px; height: 64px; }
	.srp .srp__success p { font-size: 15px; max-width: none; }

	.srp__close { top: 10px; right: 10px; background: rgba(255, 255, 255, .85); }
}

@media (max-width: 760px) {
	.srp { padding: 10px; align-items: flex-start; }
	.srp__dialog { width: 100%; grid-template-columns: 1fr; border-radius: 20px; max-height: calc(100dvh - 20px); }
	.srp--inline { padding: 0; }
}

/* Gdy popup wąski, ale ekran szeroki (np. mała maks. szerokość) */
@container srp (max-width: 760px) { .srp__left, .srp__right { grid-column: 1 / -1; } }

@media (prefers-reduced-motion: reduce) {
	.srp__dialog, .srp__overlay, .srp__success { transition: none; animation: none; }
}

body.srp-lock { overflow: hidden; }
