:root {
	--color-brand: #008740;
	--color-accent: #ffa800;
}

.c-query-heading {
	margin-top: 24px;
	margin-bottom: 8px;
	font-size: 18px;
	background-color: var(--color-brand);
	color: #fff;
	padding: 8px 16px;
}

.c-query-subheading {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 32px;
	margin-bottom: 16px;
	font-size: 15px;
}

.c-query-flow {
	margin-bottom: 8px;
	list-style: none;
}

.c-query-flow__item {
	position: relative;
	border: 1px solid var(--color-brand);
	padding: 12px;
	margin-bottom: 24px;
	border-radius: 4px;
	font-weight: bold;
	color: var(--color-brand);
	text-align: center;
	box-sizing: border-box;
	font-size: 14px;

	&.is-active {
		background-color: var(--color-accent);
		color: var(--color-brand);
	}

	&:not(:last-child) {
		&::after {
			content: "";
			position: absolute;
			bottom: -40%;
			right: 50%;
			display: inline-block;
			width: 8px;
			height: 8px;
			border: solid #46464c;
			border-width: 2px 2px 0 0;
			transform: translateX(50%) rotate(135deg);
		}
	}
}

.c-query-form {
	padding-bottom: 40px;
}

.c-query-form * {
	box-sizing: border-box;
}

.c-query-form :where(a) {
	color: var(--color-brand);
}

.c-query-form :where(input, select, textarea) {
	font-family: "ヒラギノ角ゴ Pro", "Hiragino Kaku Gothic Pro", "メイリオ",
		Meiryo, Osaka, "ＭＳ Ｐゴシック", "MS PGothic", sans-serif;
}

.c-query-intro :where(a) {
	color: var(--color-brand);
}

.c-query-form-text,
.c-query-form-text--small,
.c-query-form-text--alert {
	margin-bottom: 8px;
}

.c-query-form-text--small {
	font-size: 15px;
}

.c-query-form-text--alert {
	font-size: 15px;
	color: #f00;
	font-weight: bold;
}

.c-query-form-text--confirm {
	font-size: 16px;
}

.c-query-form-note {
	font-size: 12px;
}

.c-query-form-list {
	display: grid;
	gap: 4px;
}

.c-query-form-list__item {
	text-indent: -1em;
	padding-left: 1em;
	font-size: 15px;
}

.c-query-form-required {
	display: inline-block;
	background: var(--color-brand);
	color: #fff;
	border-radius: 4px;
	padding: 1px 8px;
	font-size: 11px;
	font-weight: normal;
}

.c-query-color-required {
	color: var(--color-brand);
}

.c-query-form-checkbox {
	display: flex;
	gap: 10px;
	align-items: center;

	input[type="checkbox"] {
		position: absolute;
		opacity: 0;

		&:checked + .c-query-form-checkbox-text::before {
			background: var(--color-brand);
			border: 2px solid var(--color-brand);
		}

		&:checked + .c-query-form-checkbox-text::after {
			opacity: 1;
		}
	}
}

.c-query-form-spacer {
	margin-bottom: 24px;
}

.c-query-form-checkbox-text {
	display: inline-block;
	vertical-align: middle;
	position: relative;
	cursor: pointer;

	span {
		display: inline-block;
		vertical-align: middle;
		line-height: 1.2;
		font-size: 16px;
	}

	&::before {
		content: "";
		display: inline-block;
		vertical-align: middle;
		width: 20px;
		height: 20px;
		border-radius: 4px;
		background-color: #fdfdfb;
		margin: 0 8px 0 0;
		border: 2px solid #d0d0d2;
	}

	&::after {
		content: "";
		position: absolute;
		top: 55%;
		left: 7px;
		display: block;
		width: 6px;
		height: 12px;
		margin: -10px 0 0;
		border-right: 3px solid #fff;
		border-bottom: 3px solid #fff;
		opacity: 0;
		transform: rotate(45deg);
	}
}

.c-query-form-radio {
	padding-left: 20px;
	position: relative;
	cursor: pointer;
	display: flex;
	justify-content: center;
	align-items: center;

	&:has(:checked) {
		&::before {
			border: 2px solid var(--color-brand);
		}
		&::after {
			content: "";
			display: block;
			position: absolute;
			top: 3px;
			left: 6px;
			width: 12px;
			height: 12px;
			background: var(--color-brand);
			border-radius: 50%;
		}
	}

	input[type="radio"] {
		width: 1px;
		height: 1px;
		border: none;
		opacity: 0;
	}

	&::before {
		content: "";
		display: block;
		position: absolute;
		top: -3px;
		left: 0;
		width: 20px;
		height: 20px;
		border: 1px solid #e0e0e0;
		border-radius: 50%;
	}
}

.c-query-form-radio-text {
	margin-left: 2px;
	font-size: 16px;
}

.c-query-form-container {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 20px 16px;

	&:has(.c-query-form-select) {
		row-gap: 12px;
	}
}

.c-query-form-item {
	display: flex;
	align-items: center;
	gap: 8px;
}

.c-query-form-input-text,
.c-query-form-input-text--tel {
	width: 100%;
	border: 2px solid #e0e0e0;
	border-radius: 4px;
	background-color: #fdfdfb;
	text-indent: 10px;
	height: 40px;
	font-size: 16px;

	&::placeholder {
		color: #aaa;
	}
}

.c-query-form-input-text--tel {
	width: 6em;
}

.c-query-form-datepicker {
	position: relative;
	display: flex;
	gap: 10px;
	align-items: center;
	width: 100%;

	input {
		width: 10em;
	}

	button {
		display: inline-block;
		width: auto;
		padding: 4px 8px;
		color: #fff;
		background-color: var(--color-brand);
		border: none !important;
		border-radius: 2px;
		cursor: pointer;
		height: 2.5rem;
		max-width: 3rem;

		img {
			width: 100%;
		}
	}
}

.c-query-form-select {
	position: relative;
	display: inline-block;

	select {
		border: 1px solid #e0e0e0;
		background-color: transparent;
		margin: 0;
		padding: 0;
		position: relative;
		z-index: 1;
		padding: 0 40px 0 10px;
		border-radius: 5px;
		cursor: pointer;
		appearance: none;
		height: 40px;
		width: 100%;
		font-size: 16px;
	}

	&:has([style*="visibility: hidden"]) {
		display: none;
	}

	&::before {
		content: "";
		position: absolute;
		z-index: 0;
		border-radius: 0 5px 5px 0;
		top: 0;
		right: 0;
		background: #e0e0e0;
		height: 100%;
		width: 30px;
	}

	&::after {
		content: "";
		position: absolute;
		z-index: 0;
		top: 40%;
		right: 12px;
		display: inline-block;
		width: 5px;
		height: 5px;
		border: solid #46464c;
		border-width: 2px 2px 0 0;
		transform: rotate(135deg);
	}
}

.c-query-form-textarea,
.c-query-form-textarea--small {
	textarea {
		width: 100% !important;
		border: 2px solid #e0e0e0;
		border-radius: 4px;
		background-color: #fdfdfb;
		min-height: 200px;
		padding: 10px;
		font-size: 16px;
	}
}

.c-query-form-textarea--small {
	textarea {
		min-height: 100px;
	}
}

.c-query-form-submit {
	display: grid;
	grid-template-columns: 1fr;
	gap: 16px;
	margin-top: 40px;
}

.c-query-form-button,
.c-query-form-button--back {
	position: relative;
	background: var(--color-brand);
	border: 1px solid var(--color-brand);
	color: #fff;
	font-weight: bold;
	padding: 16px;
	width: 100%;
	border-radius: 4px;
	letter-spacing: 0.1rem;
	cursor: pointer;
	font-size: 16px;
	transition: opacity 0.3s;

	&:hover {
		opacity: 0.8;
	}

	&:only-child {
		grid-column: 1 / -1;
	}

	&.disabled {
		pointer-events: none;
		background: #e0e0e0;
		border: 1px solid #e0e0e0;
	}

	&::after {
		content: "";
		position: absolute;
		top: 40%;
		right: 32px;
		display: inline-block;
		width: 7px;
		height: 7px;
		border: solid #fff;
		border-width: 1px 1px 0 0;
		transform: rotate(45deg);
	}
}

.c-query-form-button--back {
	background: #afafaf;
	border-color: #afafaf;
	color: #fff;
	font-weight: bold;

	&::after {
		left: 32px;
		transform: rotate(-135deg);
	}
}

.ui-datepicker {
	.date-saturday .ui-state-default {
		background-color: #66ccff;
	}
	.date-sunday .ui-state-default,
	.date-holiday .ui-state-default {
		background-color: #ff9999;
	}
}

.c-query-form-section {
	margin-top: 54px;

	&:first-of-type {
		margin-top: 40px;
	}
}

.c-query-form-heading {
	font-size: 16px;
	border-bottom: 1px solid #e0e0e0;
	font-weight: bold;
	padding-bottom: 10px;
	margin-bottom: 18px;
}

.c-query-form-confirm-list {
	& + .c-query-form-confirm-list {
		margin-top: 32px;
	}
}

.c-query-form-confirm-list__heading {
	display: flex;
	align-items: center;
	gap: 12px;
	font-weight: bold;
	margin-bottom: 12px;
	font-size: 15px;
}

.c-query-form-confirm-list__content {
	font-size: 16px;

	+ .c-query-form-confirm-list__content {
		margin-top: 12px;
	}
}
