/*
 * 4ブログ共通：お問い合わせページ（/inquiry）のフォーム
 * デザイン見本：reports/blog-contact-design.html
 * 色：--bc-accent（AFFINGER のメインカラー）・--bc-on-accent は blog-contact.php が出力する
 * Contact Form 7 の標準CSSは読み込まないため、必要な部分（読み上げ用テキストの非表示など）もここで指定する
 */

:root {
	--bc-accent: #1d4ed8;
	--bc-on-accent: #ffffff;
	--bc-text: #1f2937;
	--bc-text-sub: #4b5563;
	--bc-border: #d1d5db;
	--bc-border-light: #e5e7eb;
	--bc-field-bg: #f9fafb;
	--bc-error: #b91c1c;
}

/* ---------- 本文の導入と注意書き ---------- */

.bc-lead,
.post .bc-lead {
	margin: 0 0 24px;
	font-size: 15px;
	line-height: 1.8;
	color: #374151;
}

.bc-notes {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0 0 32px;
	padding: 16px 20px;
	background: var(--bc-field-bg);
	border: 1px solid var(--bc-border-light);
	border-radius: 6px;
	font-size: 13px;
	line-height: 1.8;
	color: var(--bc-text-sub);
}

/* AFFINGER のスマホ用の段落指定（.post .entry-content p:not(...) が多数連なり詳細度が高い）に負けないよう !important */
.bc-notes p,
.post .bc-notes p {
	margin: 0;
	padding: 0;
	font-size: 13px !important;
	line-height: 1.8 !important;
	color: var(--bc-text-sub);
}

.post .bc-lead {
	font-size: 15px !important;
	line-height: 1.8 !important;
}

/* ---------- Contact Form 7 の標準CSSの代わり ---------- */

.wpcf7 .screen-reader-response {
	position: absolute;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	word-wrap: normal !important;
	word-break: normal !important;
}

.wpcf7 .hidden-fields-container {
	display: none;
}

.wpcf7-form-control-wrap {
	position: relative;
	display: block;
}

.wpcf7 [inert] {
	opacity: 0.5;
}

.wpcf7 input[type="url"],
.wpcf7 input[type="email"] {
	direction: ltr;
}

/* ---------- フォーム全体 ---------- */

.wpcf7 .bc-form {
	display: flex;
	flex-direction: column;
	gap: 28px;
	color: var(--bc-text);
	line-height: 1.8;
}

.wpcf7 .bc-form p {
	margin: 0;
	padding: 0;
}

.wpcf7 .bc-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: none;
}

/* 入力欄ごと包む label（CF7 の id: は同じリクエスト内で2回目以降に出力されないため、for= に頼らない） */
.wpcf7 label.bc-field {
	font-size: inherit;
	font-weight: 400;
	cursor: default;
}

.wpcf7 .bc-row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 28px 20px;
}

/* 項目名と「必須」「任意」 */
.wpcf7 .bc-label {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.6;
	color: var(--bc-text);
}

.wpcf7 fieldset.bc-field > legend.bc-label {
	margin-bottom: 10px;
}

.wpcf7 .bc-req,
.wpcf7 .bc-opt {
	display: inline-block;
	padding: 1px 8px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.6;
	white-space: nowrap;
}

.wpcf7 .bc-req {
	color: var(--bc-on-accent);
	background: var(--bc-accent);
}

.wpcf7 .bc-opt {
	color: var(--bc-text-sub);
	background: var(--bc-border-light);
}

.wpcf7 .bc-help {
	display: block;
	font-size: 13px;
	line-height: 1.7;
	color: var(--bc-text-sub);
}

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

.wpcf7 .bc-form input[type="text"],
.wpcf7 .bc-form input[type="email"],
.wpcf7 .bc-form input[type="url"],
.wpcf7 .bc-form textarea {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	margin: 0;
	font-family: inherit;
	font-size: 15px;
	color: var(--bc-text);
	background: var(--bc-field-bg);
	border: 1px solid var(--bc-border);
	border-radius: 6px;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}

.wpcf7 .bc-form input[type="text"],
.wpcf7 .bc-form input[type="email"],
.wpcf7 .bc-form input[type="url"] {
	height: 48px;
	padding: 0 14px;
	line-height: normal;
}

.wpcf7 .bc-form textarea {
	display: block;
	min-height: 0;
	height: auto;
	padding: 12px 14px;
	line-height: 1.8;
	resize: vertical;
}

.wpcf7 .bc-form input::placeholder,
.wpcf7 .bc-form textarea::placeholder {
	color: #6b7280;
	opacity: 1;
}

.wpcf7 .bc-form input[type="text"]:focus,
.wpcf7 .bc-form input[type="email"]:focus,
.wpcf7 .bc-form input[type="url"]:focus,
.wpcf7 .bc-form textarea:focus {
	background: #ffffff;
	border-color: var(--bc-accent);
	outline: 2px solid var(--bc-accent);
	outline-offset: 0;
}

/* ---------- お問い合わせ種別（ラジオ） ---------- */

.wpcf7 .bc-form .wpcf7-radio {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 10px;
}

.wpcf7 .bc-form .wpcf7-radio .wpcf7-list-item {
	display: block;
	margin: 0;
}

.wpcf7 .bc-form .wpcf7-radio label {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 48px;
	margin: 0;
	padding: 0 16px;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.5;
	color: var(--bc-text);
	background: #ffffff;
	border: 1px solid var(--bc-border);
	border-radius: 6px;
	cursor: pointer;
}

.wpcf7 .bc-form .wpcf7-radio label:has(input:checked) {
	border: 1.5px solid var(--bc-accent);
	box-shadow: inset 0 0 0 0.5px var(--bc-accent);
}

.wpcf7 .bc-form .wpcf7-radio label:has(input:focus-visible) {
	outline: 2px solid var(--bc-accent);
	outline-offset: 2px;
}

.wpcf7 .bc-form input[type="radio"],
.wpcf7 .bc-form input[type="checkbox"] {
	flex: none;
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--bc-accent);
	cursor: pointer;
}

.wpcf7 .bc-form .wpcf7-list-item-label::before,
.wpcf7 .bc-form .wpcf7-list-item-label::after {
	content: none;
}

/* ---------- 同意・Turnstile・送信ボタン ---------- */

.wpcf7 .bc-submit-area {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 20px;
	padding-top: 8px;
	border-top: 1px solid var(--bc-border-light);
}

.wpcf7 .bc-submit-area .wpcf7-acceptance .wpcf7-list-item {
	display: block;
	margin: 16px 0 0;
}

.wpcf7 .bc-submit-area .wpcf7-acceptance label {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	margin: 0;
	font-size: 15px;
	font-weight: 400;
	color: var(--bc-text);
	cursor: pointer;
}

.wpcf7 .bc-submit-area .wpcf7-acceptance a {
	text-decoration: underline;
}

.wpcf7 .bc-submit-area > .wpcf7-form-control-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.wpcf7 .bc-turnstile {
	display: flex;
	justify-content: center;
	width: 100%;
	max-width: 100%;
	min-height: 65px;
	overflow: hidden;
}

.wpcf7 .bc-turnstile .wpcf7-turnstile {
	display: flex;
	justify-content: center;
}

.wpcf7 .bc-submit-wrap {
	position: relative;
	display: flex;
	justify-content: center;
	width: 100%;
	max-width: 320px;
}

.wpcf7 .bc-form input.bc-submit[type="submit"] {
	box-sizing: border-box;
	display: block;
	width: 100%;
	min-height: 56px;
	margin: 0;
	padding: 0 16px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--bc-on-accent);
	background: var(--bc-accent);
	border: none;
	border-radius: 6px;
	box-shadow: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.wpcf7 .bc-form input.bc-submit[type="submit"]:hover {
	filter: brightness(0.95);
}

.wpcf7 .bc-form input.bc-submit[type="submit"]:focus-visible {
	outline: 2px solid var(--bc-text);
	outline-offset: 2px;
}

.wpcf7 .bc-form input.bc-submit[type="submit"]:disabled {
	cursor: not-allowed;
	opacity: 0.6;
}

/* 送信中のスピナー（ボタンの内側・右端に表示。スマホでボタンが全幅でもはみ出さない） */
.wpcf7 .bc-submit-wrap .wpcf7-spinner {
	position: absolute;
	top: 50%;
	right: 14px;
	visibility: hidden;
	width: 24px;
	height: 24px;
	margin: -12px 0 0;
	padding: 0;
	background-color: var(--bc-text-sub);
	border: none;
	border-radius: 100%;
	opacity: 0.75;
}

.wpcf7 form.submitting .wpcf7-spinner {
	visibility: visible;
}

.wpcf7 .wpcf7-spinner::before {
	content: "";
	position: absolute;
	top: 4px;
	left: 4px;
	width: 6px;
	height: 6px;
	background-color: #fbfbfc;
	border-radius: 100%;
	transform-origin: 8px 8px;
	animation: bc-spin 1000ms linear infinite;
}

@media (prefers-reduced-motion: reduce) {
	.wpcf7 .wpcf7-spinner::before {
		animation: bc-blink 2000ms linear infinite;
	}
}

@keyframes bc-spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

@keyframes bc-blink {
	from { opacity: 0; }
	50% { opacity: 1; }
	to { opacity: 0; }
}

/* ---------- 入力エラー・送信結果 ---------- */

.wpcf7 .wpcf7-not-valid-tip {
	display: block;
	margin-top: 6px;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.6;
	color: var(--bc-error);
}

.wpcf7 .bc-form [aria-invalid="true"]:not([type="radio"]):not([type="checkbox"]) {
	border-color: var(--bc-error);
	background: #fef2f2;
}

.wpcf7 form .wpcf7-response-output {
	margin: 28px 0 0;
	padding: 14px 18px;
	font-size: 14px;
	line-height: 1.7;
	color: var(--bc-text);
	background: var(--bc-field-bg);
	border: 1px solid var(--bc-border-light);
	border-left-width: 4px;
	border-radius: 6px;
}

.wpcf7 form.init .wpcf7-response-output,
.wpcf7 form.resetting .wpcf7-response-output,
.wpcf7 form.submitting .wpcf7-response-output {
	display: none;
}

.wpcf7 form.sent .wpcf7-response-output {
	color: #14532d;
	background: #f0fdf4;
	border-color: #86efac;
	border-left-color: #16a34a;
}

.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.aborted .wpcf7-response-output,
.wpcf7 form.spam .wpcf7-response-output {
	color: #7f1d1d;
	background: #fef2f2;
	border-color: #fecaca;
	border-left-color: #dc2626;
}

.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output,
.wpcf7 form.payment-required .wpcf7-response-output {
	color: #78350f;
	background: #fffbeb;
	border-color: #fde68a;
	border-left-color: #d97706;
}

/* ---------- 狭い画面 ---------- */

/* 幅300pxの Turnstile が入らない画面では縮小して収める */
@media (max-width: 359px) {
	.wpcf7 .bc-turnstile {
		min-height: 56px;
	}

	.wpcf7 .bc-turnstile .wpcf7-turnstile {
		transform: scale(0.85);
		transform-origin: center top;
	}

	.wpcf7 .bc-submit-area .wpcf7-acceptance label {
		gap: 8px;
		font-size: 14px;
	}
}
