/* 2026年度 組合員モニターアンケート 専用スタイル（プレーンCSS・ビルド非依存） */

.jas {
	font-size: 16px;
	line-height: 1.8;
	color: #333;
	padding-bottom: 24px;
}

/* ---- 冒頭の案内 ---- */
.jas__intro {
	margin: 0 0 8px;
	font-size: 15px;
	color: #555;
}
.jas__notes {
	margin: 0 0 24px;
	padding: 14px 16px;
	background: #F7FAF4;
	border: 1px solid #D9E8D1;
	border-radius: 8px;
	font-size: 14px;
	color: #555;
}
.jas__notes p { margin: 0 0 6px; }
.jas__notes p:last-child { margin-bottom: 0; }

/* ---- 大問見出し ---- */
.jas__q {
	margin: 40px 0 12px;
	padding: 10px 16px;
	background: #EEF8E9;
	border-left: 5px solid #138A43;
	font-size: 19px;
	font-weight: 700;
	color: #075C30;
}
.jas__lead {
	margin: 0 0 20px;
	font-size: 15px;
	color: #555;
}

/* 親設問として使われているリード文（バッジを含むもの）は小見出し扱いにする。
   例：①問4の「４．JA松山市がオススメする以下の商品について、ご存じでしたか？」
   → 直後に続く（１）（２）（３）の親であることを示す。
   :has() 非対応環境では通常のリード文のまま（機能に影響なし）。 */
.jas__lead:has(.jas__badge) {
	margin: 0 0 14px;
	font-size: 16px;
	font-weight: 700;
	color: #333;
}

/* ---- 設問ブロック ---- */
.jas__item {
	margin: 0 0 28px;
	padding: 0 0 0 2px;
	scroll-margin-top: 24px;
}
.jas__item[hidden] { display: none !important; }
.jas__item.is-error {
	padding: 12px 14px;
	border-left: 4px solid #D8362A;
	background: #FEF6F5;
	border-radius: 0 8px 8px 0;
}

.jas__qtext {
	margin: 0 0 10px;
	font-weight: 700;
	font-size: 16px;
}
.jas__hint {
	display: block;
	margin: -4px 0 10px;
	font-size: 14px;
	font-weight: 400;
	color: #777;
}
.jas__errmsg {
	display: none;
	margin: 6px 0 0;
	font-size: 14px;
	font-weight: 700;
	color: #D8362A;
}
.jas__item.is-error .jas__errmsg { display: block; }

/* ---- 必須／任意バッジ ----
   39個並ぶため、赤ベタは画面がうるさくなる。薄赤＋濃赤文字で主張を抑える。 */
.jas__badge {
	display: inline-block;
	margin-left: 8px;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.6;
	vertical-align: middle;
	white-space: nowrap;
}
.jas__badge--req {
	background: #FCE9E7;
	border: 1px solid #F1C6C1;
	color: #BE2A1D;
}
.jas__badge--opt {
	background: #F2F2F2;
	border: 1px solid #E3E3E3;
	color: #767676;
}

/* ---- 選択肢（CF7のリスト構造を縦積みに） ---- */
.jas .wpcf7-list-item {
	display: block;
	margin: 0 0 6px;
}
.jas .wpcf7-list-item label {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	border: 1px solid #D9E8D1;
	border-radius: 8px;
	background: #fff;
	cursor: pointer;
	transition: background .15s, border-color .15s;
}
.jas .wpcf7-list-item label:hover { background: #F4FAF1; }
.jas .wpcf7-list-item input[type="radio"],
.jas .wpcf7-list-item input[type="checkbox"] {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin: 0;
}
/* 選択中：枠と背景は外側の label に当てる（:has() 対応環境） */
.jas .wpcf7-list-item label:has(input:checked) {
	background: #EEF8E9;
	border-color: #138A43;
}
/* :has() 非対応環境向けのフォールバック（文字を太くするだけ） */
.jas .wpcf7-list-item input:checked + .wpcf7-list-item-label { font-weight: 700; }

.jas .wpcf7-list-item.is-disabled label {
	opacity: .45;
	cursor: not-allowed;
	background: #F5F5F5;
}
.jas .wpcf7-list-item-label { flex: 1 1 auto; }

/* ---- 入力欄 ----
   選択肢と横幅を揃えるため max-width は設けない（全幅）。 */
.jas input[type="text"],
.jas input[type="email"],
.jas input[type="tel"],
.jas input[type="number"],
.jas select,
.jas textarea {
	display: block;
	width: 100%;
	padding: 12px 14px;
	border: 1px solid #D9E8D1;
	border-radius: 8px;
	font-size: 16px;
	line-height: 1.7;
	background: #fff;
	box-sizing: border-box;
}
.jas input:focus,
.jas select:focus,
.jas textarea:focus {
	outline: 2px solid #138A43;
	outline-offset: 1px;
}
/* CF7既定の rows=10 だと縦280pxになりスクロール量が膨らむ。
   160pxに抑え、足りない場合は回答者が右下から伸ばせるようにする。 */
.jas textarea {
	height: 160px;
	min-height: 160px;
	resize: vertical;
}

/* CF7が入力欄を包むラッパー。幅の指定は入れない（内側の要素が全幅になる） */
.jas .wpcf7-form-control-wrap { display: block; }

/* 「その他」記入欄 */
.jas__other {
	display: block;
	margin: 8px 0 0;
}
.jas__other[hidden] { display: none !important; }
.jas__other-label {
	display: block;
	margin: 0 0 4px;
	font-size: 14px;
	color: #666;
}

/* 商品ごとの感想欄など、選択肢のあとに続く記入欄 */
.jas__sub {
	margin: 10px 0 0;
}
.jas__sub-label {
	display: block;
	margin: 0 0 4px;
	font-size: 14px;
	font-weight: 700;
	color: #555;
}

.jas__maxnote {
	display: block;
	margin: 8px 0 0;
	font-size: 14px;
	color: #C05621;
}

/* ---- 表（問8の取り組み一覧） ---- */
.jas__table {
	width: 100%;
	margin: 0 0 14px;
	border-collapse: collapse;
	font-size: 14px;
}
.jas__table th,
.jas__table td {
	padding: 8px 10px;
	border: 1px solid #D9E8D1;
	text-align: left;
	vertical-align: top;
}
.jas__table th { background: #EEF8E9; color: #075C30; white-space: nowrap; }

/* ---- 別添資料リンク ---- */
.jas__doclink {
	display: inline-block;
	margin: 0 0 12px;
	font-weight: 700;
	color: #138A43;
	text-decoration: underline;
}
.jas__doclink--pending {
	color: #777;
	text-decoration: none;
}
.jas__doclink-note { font-size: 13px; font-weight: 400; }

/* ---- 同意・送信 ---- */
.jas__consent {
	margin: 32px 0 0;
	padding: 16px;
	background: #F7FAF4;
	border: 1px solid #D9E8D1;
	border-radius: 8px;
}
.jas__consent .wpcf7-list-item { margin: 0; }
.jas__actions {
	margin: 24px 0 0;
	text-align: center;
}

/* ---- 進捗バー（画面下に固定） ---- */
.jas-progress {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9000;
	padding: 9px 16px calc(9px + env(safe-area-inset-bottom));
	background: #fff;
	border-top: 1px solid #C8DEBB;
	box-shadow: 0 -2px 10px rgba(0, 0, 0, .1);
}
.jas-progress__label {
	display: block;
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 700;
	color: #075C30;
	text-align: center;
	line-height: 1.4;
}
.jas-progress__track {
	height: 12px;
	border-radius: 6px;
	background: #DCEAD3;
	overflow: hidden;
}
.jas-progress__bar {
	height: 100%;
	width: 0;
	border-radius: 6px;
	background: #138A43;
	transition: width .25s ease;
}
/* 完了時：オレンジは警告に見えるため濃緑にする。
   ラベル側で「すべて回答しました」と文言でも伝えるため、色だけに依存しない。 */
.jas-progress.is-complete .jas-progress__bar { background: #075C30; }

/* 進捗バーぶんの余白（JSが body に付ける） */
body.jas-has-progress { padding-bottom: 82px; }

/* ---- 未回答トースト ---- */
.jas-toast {
	position: fixed;
	left: 50%;
	bottom: 100px;
	z-index: 9100;
	transform: translateX(-50%);
	max-width: 92vw;
	padding: 12px 18px;
	border-radius: 8px;
	background: #D8362A;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
}
.jas-toast[hidden] { display: none !important; }

@media (max-width: 768px) {
	.jas { font-size: 15px; }
	.jas__q { font-size: 17px; margin-top: 32px; }
	.jas__lead:has(.jas__badge) { font-size: 15px; }
	.jas .wpcf7-list-item label { padding: 12px; }
	.jas textarea { height: 140px; min-height: 140px; }
	.jas__table { font-size: 13px; }
	.jas__table th { white-space: normal; }
}

/* ===============================================================
   v1.4：エラー表示の強化
   =============================================================== */

/* ---- CF7のサーバー検証エラー ---- */
.jas .wpcf7-not-valid {
	border-color: #D8362A !important;
	background: #FFF8F7;
}
.jas .wpcf7-not-valid-tip {
	display: block;
	margin: 8px 0 0;
	font-size: 14px;
	font-weight: 700;
	color: #C0271B;
}

/* 選択肢グループがエラーのとき（wpcf7-not-valid は外側spanに付くため、
   枠線ではなく設問ブロック全体の is-error で示す） */
.jas .wpcf7-checkbox.wpcf7-not-valid,
.jas .wpcf7-radio.wpcf7-not-valid,
.jas .wpcf7-acceptance.wpcf7-not-valid {
	background: transparent;
	border: 0 !important;
}

/* ---- 同意ブロックのエラー ---- */
.jas__consent.is-error {
	border-color: #D8362A;
	background: #FEF6F5;
}

/* ---- 設問ブロックのエラーを目立たせる ---- */
.jas__item.is-error {
	padding: 14px 16px;
	border-left: 5px solid #D8362A;
	background: #FEF6F5;
	border-radius: 0 8px 8px 0;
	scroll-margin-top: 24px;
}
.jas__item.is-error .jas__qtext { color: #A81E12; }

/* ---- 送信ボタン下の全体メッセージ ---- */
.jas .wpcf7-response-output {
	margin: 20px 0 0;
	padding: 14px 16px;
	border-width: 2px;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.7;
	text-align: left;
}

/* ---- 進捗バー：ジャンプボタンを横に並べる ---- */
.jas-progress__inner {
	display: flex;
	align-items: center;
	gap: 14px;
	max-width: 1200px;
	margin: 0 auto;
}
.jas-progress__meter {
	flex: 1 1 auto;
	min-width: 0;
}
.jas-progress__jump {
	flex: 0 0 auto;
	padding: 10px 16px;
	border: 0;
	border-radius: 8px;
	background: #D8362A;
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
	white-space: nowrap;
	cursor: pointer;
}
.jas-progress__jump:hover { background: #BE2A1D; }
.jas-progress__jump[hidden] { display: none !important; }

@media (max-width: 768px) {
	.jas-progress__inner { gap: 10px; }
	.jas-progress__jump {
		padding: 10px 12px;
		font-size: 13px;
	}
	.jas-progress__label { font-size: 12px; }
}

/* ===============================================================
   v1.5：条件分岐設問の単一選択（[checkbox exclusive]）をラジオに見せる
   CF7は [radio] を * の有無に関わらず必須扱いするため、条件分岐する設問だけ
   [checkbox … exclusive]（* なし）に変更している。見た目は他の単一選択と揃える。
   =============================================================== */

.jas__item[data-jas-single] input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	position: relative;
	width: 20px;
	height: 20px;
	margin: 0;
	border: 2px solid #9BB394;
	border-radius: 50%;
	background: #fff;
	cursor: pointer;
}
.jas__item[data-jas-single] input[type="checkbox"]:checked {
	border-color: #138A43;
}
.jas__item[data-jas-single] input[type="checkbox"]:checked::after {
	content: "";
	position: absolute;
	top: 3px;
	right: 3px;
	bottom: 3px;
	left: 3px;
	border-radius: 50%;
	background: #138A43;
}
.jas__item[data-jas-single] input[type="checkbox"]:focus-visible {
	outline: 2px solid #138A43;
	outline-offset: 2px;
}

/* ===============================================================
   v1.6：送信完了パネル ／ エラーメッセージの重複解消
   =============================================================== */

/* ---- 送信完了パネル ---- */
.jas-done {
	margin: 24px 0;
	padding: 40px 24px;
	border: 2px solid #138A43;
	border-radius: 12px;
	background: #F2FAEE;
	text-align: center;
	scroll-margin-top: 40px;
}
.jas-done[hidden] { display: none !important; }

.jas-done__title {
	margin: 0 0 14px;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.5;
	color: #075C30;
}
.jas-done__title::before {
	content: "✓";
	display: block;
	margin: 0 auto 10px;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: #138A43;
	color: #fff;
	font-size: 30px;
	line-height: 52px;
}
.jas-done__text {
	margin: 0;
	font-size: 16px;
	line-height: 1.9;
	color: #333;
}

/* ---- エラーメッセージの重複解消 ----
   CF7が項目ごとに .wpcf7-not-valid-tip（例：「入力してください。」）を出すため、
   同じ設問に自前の .jas__errmsg を重ねると2行になる。CF7側がある場合は自前を隠す。
   :has() 非対応環境では従来どおり2行出る（実害なし）。 */
.jas__item.is-error:has(.wpcf7-not-valid-tip) .jas__errmsg {
	display: none;
}

@media (max-width: 768px) {
	.jas-done { padding: 32px 18px; }
	.jas-done__title { font-size: 20px; }
	.jas-done__text { font-size: 15px; }
}
