/* 龍之口八幡宮 祈願申し込みフォーム スタイル
   ------------------------------------------------------------
   スマートフォンでの利用が全体の8割という前提に基づき、
   まずスマホでの見やすさ・タップのしやすさを基準に組み、
   その上でPC幅でも崩れないようにしている。
   ------------------------------------------------------------ */

.tkf-wrap {
	max-width: 640px;
	margin: 0 auto;
	font-size: 16px; /* iOSでズームが発生しない16px以上を基準にする */
	line-height: 1.7;
	color: #333;
}

.tkf-section {
	border: none;
	margin: 0 0 32px 0;
	padding: 0;
}

.tkf-section-title {
	font-size: 1.15em;
	font-weight: bold;
	padding: 0 0 8px 0;
	margin-bottom: 16px;
	border-bottom: 2px solid #1f5c3f;
	color: #1f5c3f;
	width: 100%;
}

.tkf-field {
	margin-bottom: 20px;
}

.tkf-field label,
.tkf-field-label {
	display: block;
	font-weight: bold;
	margin-bottom: 6px;
}

.tkf-required {
	background: #c0392b; /* 必須バッジは、一般的な赤のまま */
	color: #fff;
	font-size: 0.75em;
	font-weight: normal;
	padding: 2px 6px;
	border-radius: 3px;
	margin-left: 6px;
	vertical-align: middle;
}

.tkf-input,
.tkf-select,
.tkf-textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 12px;
	font-size: 16px;
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #fff;
}

.tkf-input::placeholder,
.tkf-textarea::placeholder {
	color: #b3b3b3; /* 薄い灰色。入力を始めると自動的に消える（placeholder標準の挙動） */
}

.tkf-input.is-error,
.tkf-textarea.is-error,
.tkf-select.is-error {
	border-color: #c0392b;
	background: #fff5f5;
}

.tkf-note {
	font-size: 0.85em;
	color: #666;
	margin: 4px 0 0 0;
}

.tkf-error {
	font-size: 0.85em;
	color: #c0392b;
	margin: 4px 0 0 0;
	min-height: 1em;
}

.tkf-general-error {
	background: #fdecea;
	border: 1px solid #c0392b;
	color: #c0392b;
	padding: 12px;
	border-radius: 4px;
	margin-bottom: 20px;
}

/* --- 郵便番号・住所自動入力 --- */
.tkf-address-auto-wrap .tkf-input {
	margin-bottom: 8px;
}
.tkf-address-auto {
	background: #f7f7f7;
}
.tkf-kana-display {
	background: #f7f7f7;
	color: #555;
}

/* --- 送り先チェックボックス --- */
.tkf-checkbox-field label {
	font-weight: normal;
	display: flex;
	align-items: center;
	gap: 8px;
}
.tkf-checkbox-field input[type="checkbox"] {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}
.tkf-recipient-block {
	margin-top: 16px;
	padding: 16px;
	background: #fafafa;
	border-radius: 6px;
}

/* --- 祈願の種類（カード型ラジオボタン） --- */
.tkf-prayer-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.tkf-prayer-card {
	display: block;
	border: 2px solid #ddd;
	border-radius: 8px;
	padding: 14px 16px;
	cursor: pointer;
	transition: border-color 0.15s, background-color 0.15s;
	position: relative;
}

.tkf-prayer-card input[type="radio"] {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 20px;
	height: 20px;
}

.tkf-prayer-card-label {
	display: block;
	font-weight: bold;
	padding-right: 32px;
}

.tkf-prayer-card-desc {
	display: block;
	font-size: 0.85em;
	color: #666;
	font-weight: normal;
	margin-top: 4px;
	padding-right: 32px;
}

.tkf-prayer-card.is-selected,
.tkf-prayer-card:has(input:checked) {
	border-color: #1f5c3f;
	background: #eef5f0;
}

.tkf-prayer-item {
	margin: 0;
}

.tkf-prayer-detail {
	margin-top: 6px;
	padding: 16px;
	background: #fafafa;
	border-radius: 6px;
	border-left: 4px solid #1f5c3f;
}

/* --- 料金表示 --- */
.tkf-price-block {
	margin-bottom: 16px;
	padding-bottom: 16px;
	border-bottom: 1px dashed #ccc;
}

.tkf-price-fixed {
	font-size: 1.1em;
	margin: 0 0 8px 0;
}
.tkf-price-fixed strong {
	color: #1f5c3f;
}

.tkf-price-choice-label {
	font-weight: bold;
	margin-bottom: 6px;
}
.tkf-price-radio {
	display: block;
	font-weight: normal;
	padding: 8px 0;
}
.tkf-price-radio input {
	margin-right: 8px;
}

.tkf-payment-note {
	font-size: 0.85em;
	color: #555;
	background: #fff;
	border: 1px solid #e0d3b8;
	border-radius: 4px;
	padding: 10px 12px;
	margin-top: 10px;
}

/* --- ラジオ／チェックボックスグループ --- */
/* 選択肢は横に並べ、スマホは2列・PC幅は3列で折り返す（縦に長くなりすぎないように） */
.tkf-radio-group,
.tkf-checkbox-group {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px 12px;
}
@media (min-width: 560px) {
	.tkf-radio-group,
	.tkf-checkbox-group {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
/* 年回りは文字数が長いため、PC幅でも2列にとどめる */
.tkf-yaku-result .tkf-radio-group,
.tkf-yaku-result .tkf-checkbox-group {
	grid-template-columns: 1fr;
}
@media (min-width: 560px) {
	.tkf-yaku-result .tkf-radio-group,
	.tkf-yaku-result .tkf-checkbox-group {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
.tkf-radio-option,
.tkf-checkbox-option {
	font-weight: normal;
	display: flex;
	align-items: flex-start;
	gap: 8px;
	line-height: 1.5;
}
.tkf-radio-option input,
.tkf-checkbox-option input[type="checkbox"] {
	margin-top: 3px;
}
.tkf-checkbox-option.is-disabled {
	color: #aaa;
}
.tkf-radio-option input,
.tkf-checkbox-option input[type="checkbox"] {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}
.tkf-checkbox-other {
	flex-direction: column;
	align-items: stretch;
}

/* --- 進学希望校リスト --- */
.tkf-school-row {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 8px;
	margin-bottom: 10px;
	align-items: center;
}
.tkf-school-row-num {
	grid-column: 1 / -1;
	font-weight: bold;
	font-size: 0.9em;
	color: #555;
}
.tkf-school-date,
.tkf-school-name,
.tkf-school-kana {
	grid-column: 1 / -1;
}

/* --- ご家族欄 --- */
.tkf-family-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin-bottom: 8px;
}
.tkf-add-family-btn {
	background: #fff;
	border: 1px dashed #1f5c3f;
	color: #1f5c3f;
	padding: 8px 14px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.9em;
}

/* --- 備考欄の文字数カウンター --- */
.tkf-count-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.tkf-counter {
	font-size: 0.8em;
	color: #999;
	margin: 4px 0 0 0;
	white-space: nowrap;
}
.tkf-counter.is-over {
	color: #c0392b;
	font-weight: bold;
}

/* --- 送信ボタン --- */
.tkf-submit-field {
	text-align: center;
	margin-top: 32px;
}
.tkf-submit {
	background: #1f5c3f;
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 16px 48px;
	font-size: 1.1em;
	font-weight: bold;
	cursor: pointer;
	width: 100%;
	max-width: 320px;
}
.tkf-submit:disabled {
	opacity: 0.6;
	cursor: default;
}

.tkf-success {
	white-space: pre-line;
	text-align: center;
	padding: 32px 16px;
	background: #f4f9f4;
	border: 1px solid #a8c9a8;
	border-radius: 8px;
	font-size: 1.05em;
	line-height: 1.9;
}

/* --- v1.1 追加分 --- */

/* エラーのある項目は入力欄を赤く */
.tkf-field.is-error .tkf-input,
.tkf-field.is-error .tkf-select,
.tkf-field.is-error .tkf-textarea {
	border-color: #c0392b;
	background: #fff5f5;
}

.tkf-sub-label {
	margin-top: 12px;
}

.tkf-price-sub {
	font-size: 0.85em;
	color: #666;
}

/* 年間祈願の継続案内 */
.tkf-annual-notice {
	font-size: 0.9em;
	color: #7a4a00;
	background: #fff8e6;
	border: 1px solid #f0d9a0;
	border-radius: 4px;
	padding: 8px 12px;
	margin: 0 0 16px 0;
}

/* 願い事の選択数・一番重視する願い事 */
.tkf-wish-counter {
	font-size: 0.85em;
	color: #666;
	margin: 6px 0 0 0;
}
.tkf-checkbox-option.is-always {
	color: #555;
}
.tkf-other-wrap {
	margin-top: 8px;
}

/* 厄除系：該当なしの案内 */
.tkf-yaku-none {
	color: #c0392b;
	font-size: 0.9em;
	margin: 8px 0 0 0;
}
.tkf-yaku-result {
	margin-top: 12px;
}

/* 祈祷料の操作部（個人/団体・年間祈願・今の金額） */
.tkf-price-controls {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px dashed #ccc;
}
.tkf-live-price {
	font-size: 1.15em;
	margin: 8px 0 0 0;
}
.tkf-live-amount {
	color: #1f5c3f;
}

.tkf-school-date-label {
	grid-column: 1 / -1;
	font-size: 0.85em;
	font-weight: normal;
	color: #555;
}
.tkf-school-date-label .tkf-school-date {
	margin-top: 4px;
}

/* 祈願の項目の最後に出す、共通項目への案内 */
.tkf-next-guide {
	margin: 20px 0 0 0;
	padding: 10px 12px;
	background: #fff;
	border: 1px solid #1f5c3f;
	border-radius: 4px;
	font-size: 0.95em;
	font-weight: bold;
	color: #1f5c3f;
}
.tkf-jump {
	display: inline-block;
	margin-left: 6px;
	white-space: nowrap;
}

/* PC幅では2校目以降の行など、少し横並びにできる部分を余裕を持たせる */
@media (min-width: 600px) {
	.tkf-family-row {
		grid-template-columns: 1fr 1fr;
	}
}


/* ============================================================
   v1.1.2 選択ボタン（ラジオ・チェック）の見た目を自前で描画
   ------------------------------------------------------------
   テーマ（Affinger）側の input / label のスタイルに引っ張られて、
   ボタンと文字が離れてしまうのを防ぐため、ボタンはこちらで描画し、
   位置は「ラベルの左側に固定（absolute）」して、文字との距離を一定にする。
   ============================================================ */
.tkf-wrap .tkf-radio-option,
.tkf-wrap .tkf-checkbox-option,
.tkf-wrap .tkf-checkbox-field label {
	display: block !important;
	position: relative;
	box-sizing: border-box !important;
	width: auto !important;
	min-width: 0;
	margin: 0 !important;
	padding: 0 0 0 28px !important;
	text-align: left !important;
	font-weight: normal !important;
	line-height: 1.6;
	min-height: 22px;
	cursor: pointer;
}

.tkf-wrap .tkf-radio-option input[type="radio"],
.tkf-wrap .tkf-checkbox-option input[type="checkbox"],
.tkf-wrap .tkf-checkbox-field input[type="checkbox"] {
	-webkit-appearance: none;
	appearance: none;
	position: absolute !important;
	left: 0 !important;
	top: 2px !important;
	width: 20px !important;
	height: 20px !important;
	min-width: 20px;
	margin: 0 !important;
	padding: 0 !important;
	float: none !important;
	border: 2px solid #8a8a8a;
	background-color: #fff;
	background-repeat: no-repeat;
	background-position: center;
	background-size: 14px 14px;
	box-shadow: none;
	cursor: pointer;
}
.tkf-wrap .tkf-radio-option input[type="radio"] {
	border-radius: 50%;
}
.tkf-wrap .tkf-checkbox-option input[type="checkbox"],
.tkf-wrap .tkf-checkbox-field input[type="checkbox"] {
	border-radius: 4px;
}
.tkf-wrap .tkf-radio-option input[type="radio"]:checked {
	border-color: #1f5c3f;
	background-color: #fff;
	background-image: radial-gradient(circle, #1f5c3f 0, #1f5c3f 4.5px, transparent 5px);
	background-size: 100% 100%;
}
.tkf-wrap .tkf-checkbox-option input[type="checkbox"]:checked,
.tkf-wrap .tkf-checkbox-field input[type="checkbox"]:checked {
	border-color: #1f5c3f;
	background-color: #1f5c3f;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 7.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.tkf-wrap input[type="radio"]:focus-visible,
.tkf-wrap input[type="checkbox"]:focus-visible {
	outline: 2px solid #2b6cb0;
	outline-offset: 2px;
}
.tkf-wrap .tkf-checkbox-option input[type="checkbox"]:disabled {
	opacity: 1;
	cursor: default;
}
.tkf-wrap .tkf-checkbox-option.is-disabled input[type="checkbox"] {
	border-color: #ccc;
	background-color: #f3f3f3;
}

/* 祈願の種類カードのラジオは、これまでどおり右上に固定 */
.tkf-wrap .tkf-prayer-card input[type="radio"] {
	-webkit-appearance: none;
	appearance: none;
	position: absolute !important;
	top: 16px !important;
	right: 16px !important;
	left: auto !important;
	width: 20px !important;
	height: 20px !important;
	margin: 0 !important;
	border: 2px solid #8a8a8a;
	border-radius: 50%;
	background-color: #fff;
}
.tkf-wrap .tkf-prayer-card input[type="radio"]:checked {
	border-color: #1f5c3f;
	background-image: radial-gradient(circle, #1f5c3f 0, #1f5c3f 4.5px, transparent 5px);
}

/* 入試・試験の種類は2列（文字が長く、3列だと2行に折り返して読みにくいため） */
.tkf-wrap .tkf-checkbox-group.tkf-cols-2 {
	grid-template-columns: 1fr; /* 狭いスマホでは1列（2列だと文字が折り返して読みにくいため） */
}
@media (min-width: 480px) {
	.tkf-wrap .tkf-checkbox-group.tkf-cols-2 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* 性別・年回りの一覧 */
.tkf-wrap .tkf-gender-options {
	grid-template-columns: repeat(2, minmax(0, 160px));
	margin-bottom: 16px;
}
.tkf-wrap .tkf-yaku-list {
	grid-template-columns: 1fr !important;
}
.tkf-wrap .tkf-yaku-list .tkf-checkbox-option {
	color: #333;
}

/* 進学希望校：1校ごとのまとまりを点線で区切る */
.tkf-wrap .tkf-school-row {
	display: block;
	padding: 14px 0;
	margin: 0;
	border-top: 1px dashed #bbb;
}
.tkf-wrap .tkf-school-row:last-of-type {
	border-bottom: 1px dashed #bbb;
}
.tkf-wrap .tkf-school-row .tkf-input {
	margin-bottom: 8px;
}
.tkf-wrap .tkf-school-row-num {
	margin: 0 0 8px 0;
	font-weight: bold;
	color: #1f5c3f;
}
.tkf-wrap .tkf-school-date-label {
	display: block;
	margin: 6px 0 4px 0;
	font-size: 0.9em;
	font-weight: bold;
	color: #444;
}

/* 年間祈願を希望する：チェックすると、年間祈願の祈願と同じ黄色の枠で囲む */
.tkf-wrap .tkf-annual-field.is-on {
	background: #fff8e6;
	border: 1px solid #f0d9a0;
	border-radius: 4px;
	padding: 10px 12px;
}
.tkf-wrap .tkf-annual-note {
	margin: 8px 0 0 0;
	font-size: 0.9em;
	color: #7a4a00;
}
