body {
	padding: 0;
	-webkit-tap-highlight-color: transparent;
	scroll-behavior: smooth;
	text-wrap: balance;
	display: flex;
	flex-direction: column;
	gap: var(--gap);
	justify-content: center;
	align-items: center;
}
* {
	transition: all 0.2s linear;
}
:root {
	--gap: 24px;
	--shadow: 1px 1px 1px;
}
h4 {
	font-size: 1rem;
	font-weight: bold;
}
form {
	width: min(400px, 90%);
	display: flex;
	flex-direction: column;
	gap: var(--gap);
}
fieldset {
	display: flex;
	flex-direction: column;
	gap: calc(var(--gap) / 2);
	padding: var(--gap);
	border-radius: calc(var(--gap) / 4);
}
legend {
	padding: calc(var(--gap) / 4);
	font-size: 90%;
}
#submit,
dialog > button {
	width: 50%;
	align-self: center;
	padding: calc(var(--gap) / 8);
	cursor: pointer;
	border-radius: calc(var(--gap) / 8);
	background-color: hsl(0, 0%, 95%);
	border: 1px solid;
}
fieldset,
#submit,
dialog > button {
	box-shadow: var(--shadow);
}
.form-row {
	display: flex;
	flex-direction: column;
	gap: calc(var(--gap) / 4);
}
#submit:active,
dialog > button:active {
	box-shadow: inset var(--shadow);
}
input,
select {
	border-radius: calc(var(--gap) / 8);
	border: 1px solid;
	padding: calc(var(--gap) / 4);
}
input:focus:not(#submit),
select:focus {
	outline: 1px solid;
	box-shadow: var(--shadow);
}
input:invalid {
	background-color: hsl(9, 100%, 64%, 0.3);
}
input:valid,
select:valid {
	background-color: hsl(120, 73%, 75%, 0.3);
}
label {
	outline: 1px solid;
	background-color: hsl(0, 0%, 95%);
	font-size: 90%;
	width: fit-content;
	position: relative;
	top: calc(var(--gap) / 2);
	left: calc(var(--gap) / 4);
	padding: calc(var(--gap) / 8);
	border-radius: calc(var(--gap) / 4);
}
.form-row:has(input:focus, select:focus) label {
	top: 0;
	outline: 2px solid;
}
span.error {
	position: relative;
	bottom: calc(var(--gap) / 6);
	color: hsl(9, 100%, 64%);
}
dialog {
	padding: var(--gap);
	border-radius: calc(var(--gap) / 4);
	border: 1px solid;
	box-shadow: var(--shadow);
	text-align: center;
}
::backdrop {
	background-color: hsl(0, 0%, 95%);
	opacity: .8;
}
