/* gcb/donation-form — popup wspólnego formularza wpłat (GDEV) */

.gdf-popup-open,
.gdf-popup-open body {
	overflow: hidden;
}

.gdf-popup-open body {
	position: fixed;
	right: 0;
	left: 0;
	width: 100%;
}

.gdf-popup {
	position: fixed;
	z-index: 100000;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 2rem 1rem;
	box-sizing: border-box;
}

.gdf-popup[hidden] {
	display: none;
}

.gdf-popup-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.gdf-popup-dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	width: 100%;
	max-width: 62rem;
	max-height: 100%;
	overflow: hidden;
	border-radius: 1rem;
	background: #fff;
	box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.3);
}

.gdf-popup-dialog:focus {
	outline: none;
}

.gdf-popup-head {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.75rem 1rem 0.75rem 1.5rem;
	border-bottom: 1px solid #eee;
}

.gdf-popup-title {
	margin: 0;
	overflow: hidden;
	color: #222;
	font-size: 1.1rem;
	line-height: 1.3;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.gdf-popup-close {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #f4f4f4;
	color: #222;
	cursor: pointer;
	font-size: 1.75rem;
	line-height: 1;
}

.gdf-popup-close:hover,
.gdf-popup-close:focus-visible {
	background: #ea4d7f;
	color: #fff;
}

.gdf-popup-body {
	flex: 1 1 auto;
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

.gdf-popup-body .gcb-donation-form {
	box-sizing: border-box;
	max-width: 100%;
	margin: 0;
	padding: 1.5rem 2rem 2rem;
}

/* the dialog heading already names the cause (and labels the dialog) */
.gdf-popup-body .gcb-donation-form .brief-title {
	display: none;
}

.gdf-popup-loading,
.gdf-popup-error {
	padding: 3rem 1.5rem;
	text-align: center;
}

.gdf-popup-spinner {
	display: block;
	width: 2.5rem;
	height: 2.5rem;
	margin: 0 auto 1rem;
	border: 0.25rem solid #f4c6d5;
	border-top-color: #ea4d7f;
	border-radius: 50%;
	animation: gdf-popup-spin 0.9s linear infinite;
}

@keyframes gdf-popup-spin {

	to {
		transform: rotate(360deg);
	}
}

.gdf-popup-error p {
	margin: 0 0 1.25rem;
	color: #9e1515;
}

.gdf-popup-fallback {
	display: block;
	margin-top: 1rem;
}

/* phones: full screen, X always reachable, safe areas respected */
@media (max-width: 767px) {

	.gdf-popup {
		align-items: stretch;
		padding: 0;
	}

	.gdf-popup-dialog {
		max-width: none;
		height: 100vh;
		/* stylelint-disable-next-line unit-no-unknown -- 100vh fallback above */
		height: 100dvh;
		max-height: none;
		border-radius: 0;
	}

	.gdf-popup-head {
		position: sticky;
		top: 0;
		padding-top: max(0.75rem, env(safe-area-inset-top));
		padding-right: max(1rem, env(safe-area-inset-right));
		padding-left: max(1rem, env(safe-area-inset-left));
		background: #fff;
	}

	.gdf-popup-body {
		padding-bottom: env(safe-area-inset-bottom);
	}

	.gdf-popup-body .gcb-donation-form {
		padding: 1rem 1rem 1.5rem;
	}
}

@media (prefers-reduced-motion: reduce) {

	.gdf-popup-spinner {
		animation: none;
	}
}
