/* お問い合わせフォーム(入力=トップページ)。完了画面は pages/contact-thanks.css。 */

/*
 * トップページのお問い合わせフォーム(Figma「案1_事業部TOP｜PC1440」「案1_事業部TOP｜SP375」の「Form」)。
 * フォームのHTMLは CF7 の管理画面で設定する(docs/02-dev-workflow.md「フォーム」)。
 * 見出しと枠は pages/front.css。
 */
.p-contact__form .wpcf7-form {
	display: flex;
	flex-direction: column;
	gap: var(--space-lg);

	@media (width < 770px) {
		gap: 14px;
	}
}

.p-contact__field label {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 10px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.8;
	letter-spacing: 0.04em;

	@media (width < 770px) {
		gap: 6px 8px;
		font-size: 14px;
	}
}

.p-contact__field .wpcf7-form-control-wrap {
	display: block;
	flex-basis: 100%;
}

.p-contact__form :is(input[type="text"], input[type="email"], input[type="tel"], select, textarea) {
	display: block;
	width: 100%;
	max-width: 100%;
	min-height: 56px;
	padding: 12px 22px;
	border: 1px solid #d6e2f2;
	border-radius: 0;
	background: var(--color-bg);
	color: inherit;
	font: inherit;
	font-size: 16px; /* iOS で入力時に拡大されないよう16px以上にする */
	font-weight: 400;
	line-height: 1.6;

	@media (width < 770px) {
		min-height: 50px;
		padding: 10px 18px;
	}
}

.p-contact__form textarea {
	height: 167px;
	resize: vertical;

	@media (width < 770px) {
		height: 122px;
	}
}

.p-contact__required,
.p-contact__optional {
	padding: 0 8px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.6;

	@media (width < 770px) {
		padding-inline: 6px;
		font-size: 10px;
	}
}

.p-contact__required {
	background: #005ef5;
	color: var(--color-text-inverse);
}

.p-contact__optional {
	background: #c9d5e6;
	color: #15232f;
}

.p-contact__privacy {
	font-size: 14px;
	line-height: 1.8;
	letter-spacing: 0.04em;
	text-align: center;

	& label {
		display: inline-flex;
		align-items: center;
		gap: 10px;
		min-height: 44px;
		cursor: pointer;
	}

	& input[type="checkbox"] {
		width: 20px;
		height: 20px;
		margin: 0;
	}

	& .wpcf7-list-item {
		margin: 0;
	}

	& a {
		color: #005ef5;

		@media (width < 770px) {
			color: #0050d4;
		}
	}
}

/* 送信ボタン。CF7 の submit は input なので、右の丸い矢印は背景に重ねて描く */
.p-contact__submit {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;

	& .wpcf7-submit {
		min-height: 60px;
		padding: 0 60px 0 44px;
		border: 0;
		border-radius: var(--radius-pill);
		background:
			url("../../images/top/icon-arrow-submit.svg") no-repeat right 27px center / 12px,
			radial-gradient(circle at calc(100% - 33px) 50%, var(--color-bg) 12.5px, transparent 13px),
			#005ef5;
		color: var(--color-text-inverse);
		font: inherit;
		font-size: 16px;
		font-weight: 700;
		letter-spacing: 0.04em;
		cursor: pointer;
		transition: opacity 0.2s;

		&:hover {
			opacity: 0.8;
		}

		/*
		 * SP は横幅いっぱい。丸い矢印は22px。
		 * 文言と矢印をまとめて中央に置くため、文言を矢印の分(12 + 22px)の半分だけ左にずらし、
		 * 矢印は「送信する」(約63px)の右に12px空けて描く。文言を変えたら矢印の位置も直す
		 */
		@media (width < 770px) {
			width: 100%;
			min-height: 56px;
			padding: 0 34px 0 0;
			background:
				url("../../images/top/icon-arrow-submit.svg") no-repeat calc(50% + 37.5px) center / 11px,
				radial-gradient(circle at calc(50% + 37.5px) 50%, var(--color-bg) 10.5px, transparent 11px),
				#005ef5;
			font-size: 15px;
		}

		/* 同意のチェックを入れるまでは押せない(CF7 の acceptance) */
		&:disabled {
			opacity: 0.5;
			cursor: not-allowed;
		}
	}
}

.p-contact__notice {
	padding: 16px;
	border: 1px solid var(--color-error);
	color: var(--color-error);
}
