/*
 * TMCフォーム：お客様側の見た目。
 *
 * テーマの決まりに負けないよう、文字の大きさ・寄せ・太さをここで決め直している。
 * ボタンの色は［共通の設定］で決めた色（--tmcf-color）。
 *
 * 画面の状態（form に付く class）
 *   なし        … 入力画面
 *   is-confirm  … 確認画面
 *   is-done     … 送信が終わった後
 */

/* ---------- 土台 ---------- */

.tmcf {
	--tmcf-color: #1565c0;
	box-sizing: border-box;
	max-width: 900px;
	margin: 0 auto;
	padding: 2em 0;
	scroll-margin-top: 100px;
	color: #333;
	font-size: 15px;
	font-weight: normal;
	line-height: 1.7;
	letter-spacing: normal;
	text-align: left;
}

.tmcf *,
.tmcf *::before,
.tmcf *::after {
	box-sizing: border-box;
}

.tmcf .tmcf-form {
	display: block;
	margin: 0;
	padding: 0;
}

.tmcf .tmcf-lead {
	margin: 0 0 1.5em;
	font-size: 14px;
}

.tmcf .tmcf-confirm-note {
	display: none;
	margin: 0 0 1.5em;
	padding: 12px 16px;
	border-left: 4px solid var(--tmcf-color);
	background: #f3f6fa;
	font-weight: bold;
	outline: 0;
}

/* ---------- 1 行（左：項目名　右：入力欄） ---------- */

.tmcf .tmcf-row {
	display: grid;
	grid-template-columns: 15em minmax(0, 1fr);
	column-gap: 2em;
	align-items: start;
	margin: 0;
	padding: 14px 0;
	border-bottom: 1px solid #ddd;
}

.tmcf .tmcf-row:first-child {
	border-top: 1px solid #ddd;
}

.tmcf .tmcf-label {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.6em;
	padding-top: 7px;
	font-weight: bold;
}

.tmcf .tmcf-label .tmcf-name {
	display: inline;
	margin: 0;
	padding: 0;
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
}

.tmcf .tmcf-req {
	flex: 0 0 auto;
	padding: 2px 8px;
	border-radius: 3px;
	background: #c62828;
	color: #fff;
	font-size: 12px;
	font-weight: normal;
	line-height: 1.5;
}

.tmcf .tmcf-field {
	min-width: 0;
}

/* ---------- 入力欄 ---------- */

.tmcf .tmcf-form .tmcf-input {
	display: inline-block;
	width: 100%;
	max-width: 100%;
	height: auto;
	min-height: 40px;
	margin: 0;
	padding: 8px 11px;
	border: 1px solid #aaa;
	border-radius: 4px;
	background-color: #fff;
	box-shadow: none;
	color: #333;
	font-family: inherit;
	font-size: 16px;
	font-weight: normal;
	line-height: 1.4;
	vertical-align: middle;
}

.tmcf .tmcf-form .tmcf-input:focus {
	border-color: var(--tmcf-color);
	outline: 2px solid var(--tmcf-color);
	outline-offset: 1px;
}

.tmcf .tmcf-form select.tmcf-input {
	height: 40px;
	padding-top: 0;
	padding-bottom: 0;
}

.tmcf .tmcf-form .tmcf-textarea {
	height: 9em;
	resize: vertical;
}

.tmcf .tmcf-form .tmcf-short {
	width: 10em;
}

.tmcf .tmcf-form .tmcf-middle {
	width: 16em;
}

.tmcf .tmcf-unit {
	margin-left: 0.5em;
}

.tmcf .tmcf-again {
	margin-top: 10px;
}

.tmcf .tmcf-again-label {
	display: block;
	margin: 0 0 4px;
	color: #555;
	font-size: 13px;
	font-weight: normal;
	line-height: 1.5;
}

/* ラジオボタン・チェックボックス・同意のチェック */

.tmcf .tmcf-choices {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 2.2em;
	padding: 6px 0 5px;
}

.tmcf .tmcf-choice {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	margin: 0;
	padding: 0;
	font-size: 15px;
	font-weight: normal;
	line-height: 1.7;
	cursor: pointer;
}

.tmcf .tmcf-form .tmcf-choice input {
	flex: 0 0 auto;
	width: 18px;
	min-width: 18px;
	height: 18px;
	margin: 0;
	padding: 0;
}

/* 誤りの知らせ */

.tmcf .tmcf-error {
	display: none;
	margin-top: 5px;
	color: #c62828;
	font-size: 13px;
	line-height: 1.5;
}

.tmcf .tmcf-row.has-error .tmcf-error {
	display: block;
}

.tmcf .tmcf-form .tmcf-row.has-error .tmcf-input {
	border-color: #c62828;
}

/* 確認画面で出す値（入力画面では隠す） */

.tmcf .tmcf-value {
	display: none;
	padding: 7px 0;
	font-size: 16px;
	line-height: 1.6;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

/* おとりの欄（人には見せない） */

.tmcf .tmcf-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* ---------- ロボット確認・ボタン・知らせ ---------- */

.tmcf .tmcf-turnstile {
	display: flex;
	justify-content: center;
	margin: 2em 0 0;
}

.tmcf .tmcf-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 1em;
	margin: 1.5em 0 0;
}

.tmcf .tmcf-form .tmcf-btn {
	display: inline-block;
	width: auto;
	min-width: 16em;
	height: 52px;
	margin: 0;
	padding: 0 1.5em;
	border: 0;
	border-radius: 4px;
	background: var(--tmcf-color);
	box-shadow: none;
	color: #fff;
	font-family: inherit;
	font-size: 16px;
	font-weight: bold;
	line-height: 52px;
	letter-spacing: normal;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.tmcf .tmcf-form .tmcf-btn:hover,
.tmcf .tmcf-form .tmcf-btn:focus-visible {
	filter: brightness(0.88);
}

.tmcf .tmcf-form .tmcf-btn:focus-visible {
	outline: 2px solid #333;
	outline-offset: 2px;
}

.tmcf .tmcf-form .tmcf-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ［修正する］は濃い灰色 */
.tmcf .tmcf-form .tmcf-btn.tmcf-back {
	background: #555;
}

.tmcf .tmcf-message {
	display: none;
	margin: 1.5em 0 0;
	padding: 12px 16px;
	border: 1px solid #9bbfe6;
	border-radius: 4px;
	background: #f3f8fd;
	font-size: 15px;
	text-align: center;
	white-space: pre-wrap;
	outline: 0;
}

.tmcf .tmcf-message.is-shown {
	display: block;
}

.tmcf .tmcf-message.is-error {
	border-color: #e3a1a1;
	background: #fdf3f3;
	color: #c62828;
}

.tmcf .tmcf-noscript {
	margin: 1.5em 0 0;
	padding: 12px 16px;
	border: 1px solid #e3a1a1;
	border-radius: 4px;
	color: #c62828;
	text-align: center;
}

/* ---------- 入力画面と確認画面の切り替え ---------- */

/* 入力画面：［修正する］は出さない。確認画面を使うフォームでは［送信する］も出さない。 */
.tmcf .tmcf-form:not(.is-confirm) .tmcf-btn.tmcf-back,
.tmcf.uses-confirm .tmcf-form:not(.is-confirm) .tmcf-btn.tmcf-send {
	display: none;
}

/* 確認画面：入力欄を隠して、値だけを出す。 */
.tmcf .tmcf-form.is-confirm .tmcf-confirm-note,
.tmcf .tmcf-form.is-confirm .tmcf-value {
	display: block;
}

.tmcf .tmcf-form.is-confirm .tmcf-lead,
.tmcf .tmcf-form.is-confirm .tmcf-req,
.tmcf .tmcf-form.is-confirm .tmcf-control,
.tmcf .tmcf-form.is-confirm .tmcf-btn.tmcf-to-confirm {
	display: none;
}

.tmcf .tmcf-form.is-confirm .tmcf-label {
	padding-top: 7px;
}

/* ---------- 送信が終わった後は、完了の知らせだけにする ---------- */

.tmcf .tmcf-form.is-done .tmcf-lead,
.tmcf .tmcf-form.is-done .tmcf-rows,
.tmcf .tmcf-form.is-done .tmcf-actions,
.tmcf .tmcf-form.is-done .tmcf-turnstile {
	display: none;
}

.tmcf .tmcf-form.is-done .tmcf-message {
	margin-top: 0;
	padding: 1.5em 1em;
	font-size: 16px;
}

/* ---------- スマホ ---------- */

@media (max-width: 640px) {
	.tmcf .tmcf-row {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 6px;
	}

	.tmcf .tmcf-label {
		justify-content: flex-start;
		padding-top: 0;
	}

	.tmcf .tmcf-form.is-confirm .tmcf-label {
		padding-top: 0;
	}

	.tmcf .tmcf-form .tmcf-btn {
		width: 100%;
		min-width: 0;
	}

	.tmcf .tmcf-form .tmcf-middle {
		width: 100%;
	}
}
