:root {
	--bg: #f6f1e8;
	--text: #24303d;
	--muted: #6b7280;
	--line: #d0ccc6;
}

* {
	box-sizing: border-box;
}

body {
	font-family: Helvetica, system-ui, sans-serif;
	background-color: var(--bg);
	color: var(--text);
	max-width: 960px;
	margin: auto;
}
main {
	max-width: 820px;
	margin: 0 auto;
	padding: 48px 20px 64px;
}

h1 {
	text-align: center;
}
input, select {
	font-size: 1.5rem;
}
[hidden] {
	display: none !important;
}
button {
	cursor: pointer;
}

button.is-loading {
	position: relative;
	padding-left: 2.4rem;
	cursor: wait;
	opacity: 0.9;
}

button.is-loading::before {
	content: '';
	position: absolute;
	left: 0.9rem;
	top: 50%;
	width: 1rem;
	height: 1rem;
	margin-top: -0.5rem;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: buttonSpin 0.7s linear infinite;
}

button:disabled {
	cursor: not-allowed;
}

@keyframes buttonSpin {
	to {
		transform: rotate(360deg);
	}
}

.center {
	text-align: center;
}
.logo {
	max-width: 500px;
	width: 80vw;
	display: block;
	margin: auto;
	margin-bottom: 2rem;
}

.wrapper {
	display: flex;
	flex-direction: column;
	width: max-content;
	margin: auto;
}
.input-step p label {
	display: flex;
	flex-direction: column;
}
.placeholder-field {
	display: flex;
	flex-direction: row;
	gap: .5rem;
}
.placeholder-field input {
	flex: 1;
	min-width: 0;
}
.clear-placeholder {
	font-size: 1.3rem;
	border: 0;
	background: none;
	color: red;
	line-height: 1;
	padding: 0;
	margin: 0;
}

.input-step p label span:has(+ span input:required)::after {
	content: ' *';
	color: red;
}
.input-step-active {
	background-color: #fff5c3;
}
.input-step label {
	font-size: 1.5rem;
	cursor: pointer;
}

#entrants ul {
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
}
#entrants li {
	padding: .75rem .9rem;
	border-radius: .75rem;
	background: #fff;
}
#entrants li.flash-added {
	animation: entrantFlash 0.9s ease-in-out 2;
}
@keyframes entrantFlash {
	0% { background: #dcfce7; border-color: #22c55e; }
	50% { background: #bbf7d0; border-color: #16a34a; }
	100% { background: #fff; border-color: #e5e7eb; }
}
#entrants hr {
	width: 100vw;
	max-width: 100vw;
	margin-left: -50vw;
	margin-right: -50vw;
	position: relative;
	left: 50%;
	right: 50%;
}
#entrants .remove {
	color: red;
	font-size: 1.5rem;
	line-height: 0;
	vertical-align: middle;
	cursor: pointer;
}

.hero {
	padding: 28px;
	border: 1px solid var(--line);
	background: rgba(255, 250, 243, 0.92);
	border-radius: 22px;
	box-shadow: 0 18px 50px rgba(36, 48, 61, 0.08);
}
.notice {
	padding: 14px 16px;
	background: rgba(15, 118, 110, 0.08);
	border-radius: 12px;
}
.muted {
	color: var(--muted);
}
.entrants-card {
	margin-top: 24px;
	padding: 20px 22px;
	border: 1px solid var(--line);
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.72);

	ul {
		list-style: none;
		padding: 0;
		margin: 0;
	}
	li {
		display: flex;
		justify-content: space-between;
		gap: 16px;
		padding: 12px 0;
		border-bottom: 1px solid var(--line);
	}
	li:last-child {
		border-bottom: 0;
	}

	.name {
		font-weight: 650;
	}
	.meta {
		color: var(--muted);
		text-align: right;
		white-space: nowrap;
		display: flex;
		flex-direction: row;
		align-items: baseline;
		gap: .5rem;
	}
	.badge {
		display: inline-block;
		padding: 4px 10px 0 6px;
		border-radius: 999px;
		font-size: 1.2rem;
		background: #d1e8fa;
		color: #052e47;
		vertical-align: middle;
	}

	@media (max-width: 640px) {
		li {
			flex-direction: column;
		}
		.meta {
			text-align: left;
			white-space: normal;
		}
	}
}

.page-index {
	background: #f3ede4;
}

.page-index main {
	max-width: 940px;
	padding-top: 56px;
	padding-bottom: 72px;
}

.page-index h1 {
	margin-bottom: 1rem;
	font-size: clamp(2rem, 4vw, 3.2rem);
	line-height: 1.05;
	letter-spacing: -0.03em;
}

.page-index .logo {
	max-width: 440px;
	margin-bottom: 2rem;
}

.page-index #form,
.page-index #entrants {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.page-index .wrapper {
	width: 100%;
	max-width: 680px;
}

.page-index .input-step,
.page-index #entrants {
	padding: 22px;
	border: 1px solid #d8cec0;
	border-radius: 22px;
	background: #fffaf2;
}

.page-index #entrants {
	margin-bottom: 1rem;
}

.page-index .input-step-active {
	border-color: #aeb9c7;
	background: #fffdf8;
}

.page-index .input-step .wrapper {
	gap: 1rem;
}

.page-index .input-step p {
	margin: 0;
}

.page-index .input-step label {
	font-size: 1.05rem;
}

.page-index .input-step p label {
	gap: .5rem;
}

.page-index .input-step p label > span:first-child {
	font-size: .95rem;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--muted);
}

.page-index [data-js-distance-wrapper] .wrapper,
.page-index [data-js-category-wrapper] {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: .75rem;
}

.page-index [data-js-distance-wrapper] label,
.page-index [data-js-category-wrapper] label {
	display: flex;
	align-items: center;
	gap: .75rem;
	padding: .95rem 1rem;
	border: 1px solid #d8cec0;
	border-radius: 16px;
	background: #fff;
	cursor: pointer;
	transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}

.page-index [data-js-distance-wrapper] label:hover,
.page-index [data-js-category-wrapper] label:hover {
	transform: translateY(-1px);
}

.page-index [data-js-distance-wrapper] label:has(input:checked),
.page-index [data-js-category-wrapper] label:has(input:checked) {
	border-color: #1f2937;
	background: #eef2f7;
}

.page-index [data-js-distance-wrapper] input[type="radio"],
.page-index [data-js-category-wrapper] input[type="radio"] {
	margin: 0;
	accent-color: #1f2937;
}

.page-index .placeholder-field {
	align-items: center;
	gap: .65rem;
}

.page-index input[type="text"],
.page-index input[type="email"],
.page-index input[type="number"] {
	width: 100%;
	padding: .95rem 1rem;
	border: 1px solid #cfc7bb;
	border-radius: 14px;
	background: #fff;
	font-size: 1rem;
	transition: border-color .15s ease, background-color .15s ease;
}

.page-index input[type="text"]:focus-visible,
.page-index input[type="email"]:focus-visible,
.page-index input[type="number"]:focus-visible,
.page-index input[type="radio"]:focus-visible,
.page-index button:focus-visible {
	outline: 3px solid rgba(59, 130, 246, 0.24);
	outline-offset: 3px;
}

.page-index input[type="text"]:focus-visible,
.page-index input[type="email"]:focus-visible,
.page-index input[type="number"]:focus-visible {
	border-color: #7f95ac;
}

.page-index .clear-placeholder {
	flex: 0 0 auto;
	width: 2rem;
	height: 2rem;
	border: 1px solid #d7b2b2;
	border-radius: 999px;
	background: #fff5f5;
	color: #b42318;
	font-size: 1rem;
	line-height: 1;
	padding: 0;
}

.page-index button:not(.clear-placeholder) {
	align-self: center;
	min-width: 12rem;
	padding: .95rem 1.5rem;
	border: 1px solid #1f2937;
	border-radius: 999px;
	background: #1f2937;
	color: #fff;
	font-weight: 700;
	letter-spacing: .01em;
	transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}

.page-index button:not(.clear-placeholder):hover:not(:disabled) {
	transform: translateY(-1px);
	background: #111827;
}

.page-index button:not(.clear-placeholder):active:not(:disabled) {
	transform: translateY(0);
}

.page-index [data-go-to-payment] {
	width: min(100%, 320px);
}

.page-index #entrants ul {
	gap: .5rem;
}

.page-index #entrants li {
	padding: .9rem 1rem;
	border: 1px solid #e5ddd1;
	border-radius: 14px;
	background: #fff;
}

.page-index #entrants hr {
	width: 100%;
	max-width: none;
	margin: .5rem 0;
	position: static;
}

.page-index .remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.6rem;
	height: 1.6rem;
	border-radius: 999px;
	background: #fff5f5;
	color: #b42318;
	font-size: 1rem;
	line-height: 1;
}

@media (max-width: 640px) {
	.page-index main {
		padding-top: 40px;
		padding-bottom: 56px;
	}

	.page-index .input-step,
	.page-index #entrants {
		padding: 18px;
	}

	.page-index [data-js-distance-wrapper] .wrapper,
	.page-index [data-js-category-wrapper] {
		grid-template-columns: 1fr;
	}

	.page-index button:not(.clear-placeholder) {
		width: 100%;
	}
}
