/* Closing panel of the page "Leistungsumfang": interest poll, feedback, link to the demo page.
   Split from scope.css; the poll and the feedback button get their function with the feedback
   feature (TODO in the template). */

.hwa-scope-close {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 0.625rem 1.5rem;
	margin-top: 1rem;
	padding: 1.25rem;
}

/* heading, content and action of the three parts share three rows (User) */
.hwa-scope-part {
	display: grid;
	grid-row: span 3;
	grid-template-rows: subgrid;
	align-items: start;
	justify-items: start;
}

.hwa-scope-part h2 {
	margin: 0;
	font-size: 1.0625rem;
	font-weight: 700;
}

.hwa-scope-part p {
	margin: 0;
	color: var(--hwa-muted);
}

.hwa-scope-action {
	justify-self: stretch; /* as wide as the answer fields */
}

.hwa-scope-opts {
	display: grid;
	justify-self: stretch;
	gap: 0.5rem;
	/* icon + label form one block, as wide as the longest label, centred in every field */
	grid-template-columns: minmax(2.25rem, 1fr) auto max-content minmax(2.25rem, 1fr);
}

.hwa-scope-opt {
	display: grid;
	grid-column: 1 / -1;
	grid-template-columns: subgrid;
	align-items: center;
	padding: 0.5rem 0;
	border-radius: 0.75rem;
	background: var(--hwa-lane);
	cursor: pointer;
}

.hwa-scope-opt:hover {
	background: var(--hwa-lane-hover);
}

.hwa-scope-opt-icon {
	grid-row: 1;
	grid-column: 2;
	width: 1.75rem;
	height: 1.75rem;
}

.hwa-scope-opt-icon svg {
	width: 1rem;
	height: 1rem;
}

.hwa-scope-opt > span:last-child {
	grid-row: 1;
	grid-column: 3;
	padding-left: 0.5625rem;
}

/* check mark in the free space left of the icon */
.hwa-scope-opt::before {
	content: "";
	grid-row: 1;
	grid-column: 1;
	justify-self: center;
	width: 1rem;
	height: 1rem;
	background: var(--hwa-primary);
	-webkit-mask: var(--hwa-check) center / 1rem no-repeat;
	mask: var(--hwa-check) center / 1rem no-repeat;
	opacity: 0;
}

/* "Leider für keinen": own row below the areas, no icon, text centred, grey when chosen */
.hwa-scope-opt-none {
	margin-top: 0.25rem;
}

.hwa-scope-opt-none > span:last-child {
	grid-column: 2 / 4;
	justify-self: center;
	padding-left: 0;
}

.hwa-scope-opt.hwa-scope-opt-none:has(:checked) {
	background: var(--hwa-mark-misc);
}

.hwa-scope-opt:has(:checked) {
	background: var(--hwa-lime-soft);
	font-weight: 600;
}

.hwa-scope-opt:has(:checked)::before {
	opacity: 1;
}

.hwa-scope-opt:has(:focus-visible) {
	outline: 2px solid var(--hwa-primary);
	outline-offset: 2px;
}

.hwa-scope-part .hwa-scope-thanks {
	align-self: center;
	justify-self: center;
	visibility: hidden; /* keeps its row, so the buttons do not move */
	color: var(--hwa-primary);
}

.hwa-scope-part:has(:checked) .hwa-scope-thanks {
	visibility: visible;
}

.hwa-scope {
	--hwa-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l4 4 10-10'/%3E%3C/svg%3E");
}

/* Tablets: three columns are too narrow for the poll fields (they ran into the middle part,
   seen by the User) – the poll gets its own row, feedback and demo share the next one. */
@media (max-width: 991.98px) {
	.hwa-scope-close {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.hwa-scope-part:first-child {
		grid-column: 1 / -1;
		margin-bottom: 0.875rem;
	}

	/* four answers as 2 x 2 across the full width (User); icons line up per column */
	.hwa-scope-opts {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.hwa-scope-opt {
		grid-column: auto;
		grid-template-columns: 2.25rem auto 1fr;
	}

	.hwa-scope-opt-none {
		grid-column: 1 / -1;
		grid-template-columns: 2.25rem 1fr 2.25rem;
	}

	.hwa-scope-opt-none > span:last-child {
		grid-column: 2;
	}
}

/* phones: back to one answer per row, block centred as on the desktop */
@media (max-width: 575.98px) {
	.hwa-scope-opts {
		grid-template-columns: minmax(2.25rem, 1fr) auto max-content minmax(2.25rem, 1fr);
	}

	.hwa-scope-opt,
	.hwa-scope-opt-none {
		grid-column: 1 / -1;
		grid-template-columns: subgrid;
	}

	.hwa-scope-opt-none > span:last-child {
		grid-column: 2 / 4;
	}
}

@media (max-width: 575.98px) {
	.hwa-scope-close {
		grid-template-columns: minmax(0, 1fr);
		padding: 0.875rem;
		text-align: center;
	}

	.hwa-scope-part {
		justify-items: center;
	}

	.hwa-scope-part + .hwa-scope-part {
		margin-top: 0.875rem;
	}
}
