/**
 * WP Mailform フロントスタイル。
 * テーマと衝突しにくいよう .wpmf- 接頭辞で限定し、控えめな見た目にする。
 */

.wpmf-form-wrap {
	max-width: 720px;
	margin: 0 auto;
}

.wpmf-form-wrap.wpmf-busy {
	opacity: 0.7;
	pointer-events: none;
}

/* ステップ進捗 */
.wpmf-progress {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none !important;
	list-style-type: none !important;
	counter-reset: none;
	margin: 0 0 1.5em;
	padding: 0;
}

/* テーマが li に付ける自動番号・マーカー・擬似要素の中黒を抑止する。 */
.wpmf-progress > li {
	list-style: none !important;
	list-style-type: none !important;
	text-indent: 0 !important;
}

.wpmf-progress > li::marker {
	content: "" !important;
}

/* テーマが li::before で「・」等を入れるケースを打ち消す。 */
.wpmf-progress > li::before {
	content: none !important;
	display: none !important;
}

.wpmf-progress-step {
	flex: 1 1 0;
	min-width: 48px;
	text-align: center;
	font-size: 0.85em;
	color: #888;
	padding: 6px 4px;
	border-bottom: 3px solid #ddd;
}

.wpmf-progress-step.is-active {
	color: #1a1a1a;
	font-weight: 600;
	border-bottom-color: #2271b1;
}

/*
 * 見出し
 * 見出しタグ（h2〜h6）のスタイルはテーマのものを使う。プラグインは
 * 見出し自体に font-size 等を当てず、ラッパの余白だけ最小限に整える。
 */
.wpmf-heading {
	margin: 1.5em 0 0.8em;
}

.wpmf-heading:first-child {
	margin-top: 0;
}

.wpmf-heading-desc {
	margin: 0.4em 0 0;
	color: #50575e;
	line-height: 1.6;
}

/* フィールド */
.wpmf-field {
	margin-bottom: 1.2em;
}

.wpmf-label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.3em;
}

.wpmf-required {
	color: #d63638;
	font-weight: 700;
}

.wpmf-input {
	width: 100%;
	box-sizing: border-box;
	padding: 0.6em 0.7em;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	font-size: 1em;
	line-height: 1.4;
}

/* フォント倍率（--wpmf-fs）が指定された項目は、入力欄・選択肢・ラベルを拡大。 */
.wpmf-field.wpmf-has-scale .wpmf-input,
.wpmf-field.wpmf-has-scale .wpmf-choice,
.wpmf-field.wpmf-has-scale .wpmf-acceptance {
	font-size: calc( 1em * var( --wpmf-fs, 1 ) );
}

.wpmf-input:focus {
	border-color: #2271b1;
	outline: 2px solid rgba( 34, 113, 177, 0.25 );
	outline-offset: 0;
}

textarea.wpmf-input {
	resize: vertical;
	min-height: 6em;
}

.wpmf-choices {
	display: flex;
	flex-direction: column;
	gap: 0.4em;
}

.wpmf-choice,
.wpmf-acceptance {
	display: inline-flex;
	align-items: flex-start;
	gap: 0.5em;
	cursor: pointer;
}

.wpmf-acceptance {
	align-items: center;
}

/* ===== プライバシーポリシー（スクロール枠） ===== */
.wpmf-policy-box {
	max-height: 240px;
	overflow-y: auto;
	border: 1px solid #ccc;
	border-radius: 4px;
	padding: 12px 16px;
	margin-bottom: 0.75em;
	background: #fff;
	font-size: 0.9em;
	line-height: 1.7;
	-webkit-overflow-scrolling: touch;
}

.wpmf-policy-box:focus {
	outline: 2px solid #1a73e8;
	outline-offset: 1px;
}

/* スクロール必須を読み終えた枠は枠線で完了を示す。 */
.wpmf-policy-box.is-read {
	border-color: #46b450;
}

.wpmf-policy-box p:first-child {
	margin-top: 0;
}

.wpmf-policy-box p:last-child {
	margin-bottom: 0;
}

/* 無効化中の同意チェックは薄く見せ、操作不可を伝える。 */
.wpmf-acceptance input[type="checkbox"]:disabled {
	cursor: not-allowed;
}

.wpmf-acceptance input[type="checkbox"]:disabled + span {
	opacity: 0.6;
}

.wpmf-policy-scroll-hint {
	display: block;
	font-size: 0.85em;
	color: #777;
	margin-top: 0.25em;
}

/* ボタン型の同意チェック: スクロール未読（disabled）の間は操作不可を伝える。 */
.wpmf-acceptance-button .wpmf-choice:has( input:disabled ) {
	opacity: 0.5;
	cursor: not-allowed;
}

/* :has 非対応ブラウザ向けフォールバック（少なくともポインタは無効化）。 */
.wpmf-acceptance-button .wpmf-choice input:disabled {
	cursor: not-allowed;
}

/* 標準スタイルでは独自の丸マークは隠す（ネイティブの input を使う）。 */
.wpmf-choices:not( .wpmf-choices-button ) .wpmf-choice-mark {
	display: none;
}

/* ===== ボタン型の選択肢 ===== */
.wpmf-choices-button {
	flex-direction: row;
	flex-wrap: wrap;
	gap: 0.6em;
}

/* ネイティブの input は視覚的に隠す（操作・フォーカスは維持）。 */
.wpmf-choices-button .wpmf-choice input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	pointer-events: none;
}

/*
 * 配色は CSS 変数で受け取る（render 側で項目ごとに指定）。
 * 未指定時の既定はグレー枠→青塗り。
 */
.wpmf-choices-button {
	--wpmf-btn-border: #c3c4c7;
	--wpmf-btn-text: #2c3338;
	--wpmf-btn-active: #2271b1;
	--wpmf-btn-active-text: #ffffff;
}

.wpmf-choices-button .wpmf-choice {
	align-items: center;
	gap: 0.5em;
	padding: 0.6em 1.1em;
	border: 1.5px solid var( --wpmf-btn-border );
	background: #fff;
	color: var( --wpmf-btn-text );
	border-radius: 6px;
	font-weight: 600;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
	user-select: none;
}

.wpmf-choices-button .wpmf-choice:hover {
	background: color-mix( in srgb, var( --wpmf-btn-active ) 8%, #fff );
}

/* ボタン内のマーク（未選択：枠色の輪郭）。 */
.wpmf-choices-button .wpmf-choice-mark {
	display: inline-block;
	position: relative;
	width: 1em;
	height: 1em;
	border: 2px solid var( --wpmf-btn-border );
	background: transparent;
	flex: 0 0 auto;
	box-sizing: border-box;
}

/* ラジオは丸、チェックボックスは角丸の四角。 */
.wpmf-choices-button .wpmf-mark-radio {
	border-radius: 50%;
}

.wpmf-choices-button .wpmf-mark-check {
	border-radius: 3px;
}

/* 選択中のボタン。 */
.wpmf-choices-button .wpmf-choice:has( input:checked ),
.wpmf-choices-button .wpmf-choice.is-checked {
	background: var( --wpmf-btn-active );
	border-color: var( --wpmf-btn-active );
	color: var( --wpmf-btn-active-text );
}

/* 選択中：マークの枠を白（active-text）にする。 */
.wpmf-choices-button .wpmf-choice input:checked ~ .wpmf-choice-mark,
.wpmf-choices-button .wpmf-choice.is-checked .wpmf-choice-mark {
	border-color: var( --wpmf-btn-active-text );
}

/* ラジオ選択中：中を塗りつぶした丸（●）。 */
.wpmf-choices-button .wpmf-choice input:checked ~ .wpmf-mark-radio,
.wpmf-choices-button .wpmf-choice.is-checked .wpmf-mark-radio {
	background: var( --wpmf-btn-active-text );
	box-shadow: inset 0 0 0 2.5px var( --wpmf-btn-active );
}

/* チェックボックス選択中：チェックマーク（☑）を描く。 */
.wpmf-choices-button .wpmf-choice input:checked ~ .wpmf-mark-check::after,
.wpmf-choices-button .wpmf-choice.is-checked .wpmf-mark-check::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 46%;
	width: 0.3em;
	height: 0.58em;
	border: solid var( --wpmf-btn-active-text );
	border-width: 0 0.18em 0.18em 0;
	transform: translate( -50%, -55% ) rotate( 45deg );
	box-sizing: border-box;
}

/* キーボードフォーカス時の見やすさ。 */
.wpmf-choices-button .wpmf-choice input:focus-visible ~ .wpmf-choice-mark {
	outline: 2px solid var( --wpmf-btn-active );
	outline-offset: 2px;
}

/* ===== 氏名パーツ ===== */
.wpmf-name {
	display: flex;
	flex-direction: column;
	gap: 0.5em;
}

/* 姓・名（およびセイ・メイ）を横並びにする。 */
.wpmf-name-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
}

.wpmf-name-row .wpmf-input {
	flex: 1 1 0;
	min-width: 8em;
}

/* フォント倍率を氏名欄にも反映。 */
.wpmf-field.wpmf-has-scale .wpmf-name .wpmf-input {
	font-size: calc( 1em * var( --wpmf-fs, 1 ) );
}

/* ===== 住所パーツ ===== */
.wpmf-address {
	display: flex;
	flex-direction: column;
	gap: 0.5em;
}

.wpmf-address-zip-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em;
}

/* 郵便番号欄は住所欄より狭く。 */
.wpmf-address-zip {
	flex: 0 1 12em;
	max-width: 14em;
}

.wpmf-address-search {
	flex: 0 0 auto;
	appearance: none;
	border: 1px solid #2271b1;
	background: #fff;
	color: #135e96;
	border-radius: 4px;
	padding: 0.55em 1em;
	font-size: 0.95em;
	line-height: 1.2;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s ease, color 0.15s ease;
}

.wpmf-address-search:hover:not( :disabled ) {
	background: #2271b1;
	color: #fff;
}

.wpmf-address-search:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.wpmf-address-status {
	font-size: 0.85em;
	color: #50575e;
	min-height: 1em;
}

.wpmf-address-status:empty {
	display: none;
}

/* フォント倍率を住所欄にも反映。 */
.wpmf-field.wpmf-has-scale .wpmf-address .wpmf-input {
	font-size: calc( 1em * var( --wpmf-fs, 1 ) );
}

/* エラー */
.wpmf-field.wpmf-has-error .wpmf-input {
	border-color: #d63638;
}

.wpmf-field-error {
	display: block;
	color: #d63638;
	font-size: 0.85em;
	margin-top: 0.3em;
	min-height: 1em;
}

.wpmf-field-error:empty {
	display: none;
}

.wpmf-form-error {
	background: #fcf0f1;
	border: 1px solid #d63638;
	color: #8a1f21;
	padding: 0.8em 1em;
	border-radius: 4px;
	margin-top: 1em;
}

/* ナビゲーション */
.wpmf-nav {
	display: flex;
	justify-content: space-between;
	gap: 1em;
	margin-top: 1.5em;
}

.wpmf-nav .wpmf-next,
.wpmf-nav .wpmf-submit {
	margin-left: auto;
}

.wpmf-btn {
	appearance: none;
	border: none;
	border-radius: 4px;
	padding: 0.7em 1.6em;
	font-size: 1em;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	background: #2271b1;
	color: #fff;
	transition: background 0.15s ease;
}

.wpmf-btn:hover:not( :disabled ) {
	background: #135e96;
}

.wpmf-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.wpmf-prev {
	background: #f0f0f1;
	color: #2c3338;
}

.wpmf-prev:hover:not( :disabled ) {
	background: #dcdcde;
}

/* 確認画面 */
.wpmf-confirm-list {
	margin: 0;
	border-top: 1px solid #e0e0e0;
}

.wpmf-confirm-label {
	font-weight: 600;
	margin-top: 1em;
	color: #50575e;
	font-size: 0.9em;
}

.wpmf-confirm-value {
	margin: 0.2em 0 1em;
	padding-bottom: 1em;
	border-bottom: 1px solid #e0e0e0;
	word-break: break-word;
}

.wpmf-empty {
	color: #999;
}

.wpmf-turnstile-wrap {
	margin: 1.5em 0 0.5em;
}

/* 完了 */
.wpmf-success-message {
	background: #edfaef;
	border: 1px solid #46b450;
	color: #1a531d;
	padding: 1.2em 1.4em;
	border-radius: 4px;
	text-align: center;
}

/* 管理者向けの注意書き */
.wpmf-error-notice {
	background: #fcf9e8;
	border: 1px solid #dba617;
	padding: 0.8em 1em;
	border-radius: 4px;
}
