/* =========================================================
   人間ドック ご予約フォーム
   main.css / treatment.css のトンマナ（緑基調・角丸・Noto）を踏襲。
   入力 → 確認 → 完了 を同一ページ内で切り替える。
   ========================================================= */

.yo-container { max-width: 820px; margin: 0 auto; padding: 0 20px 20px; }

/* display を明示している要素にも hidden 属性を効かせる */
.yopage [hidden] { display: none !important; }

/* ---------- 導入 ---------- */
.yo-intro { margin-bottom: 40px; }
.yo-intro__lead { font-size: 16px; line-height: 1.9; color: var(--ink-2); }
.yo-intro__lead strong { color: var(--green-primary); }

.yo-flow { margin: 24px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; counter-reset: none; }
.yo-flow__item {
	position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px;
	padding: 18px 12px; background: var(--green-mist); border-radius: 12px; text-align: center;
}
.yo-flow__item + .yo-flow__item::before {
	content: ""; position: absolute; left: -8px; top: 50%; transform: translateY(-50%);
	width: 0; height: 0; border-left: 7px solid var(--green-accent);
	border-top: 6px solid transparent; border-bottom: 6px solid transparent;
}
.yo-flow__num {
	display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
	background: var(--green-primary); color: #fff; font-weight: 700; font-size: 15px;
}
.yo-flow__txt { font-size: 13px; line-height: 1.6; color: var(--ink-2); font-weight: 500; }

.yo-intro__tel {
	margin-top: 22px; padding: 16px 20px; border: 1px dashed var(--green-accent); border-radius: 10px;
	display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
	font-size: 14px; color: var(--ink-2);
}
.yo-intro__telnum {
	display: inline-flex; align-items: center; gap: 8px;
	font-size: 22px; font-weight: 700; color: var(--green-primary); text-decoration: none; letter-spacing: .02em;
}

/* ---------- ステップ ---------- */
.yo-step { margin-top: 46px; }
.yo-step:first-of-type { margin-top: 0; }
.yo-step__head {
	display: flex; align-items: center; gap: 12px;
	margin: 0 0 26px; padding-bottom: 14px; border-bottom: 2px solid var(--green-primary);
	font-size: 21px; font-weight: 700; color: var(--green-primary); line-height: 1.4;
}
.yo-step__no {
	flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
	background: var(--green-primary); color: #fff; font-size: 16px;
}

/* ---------- フィールド共通 ---------- */
.yo-field { margin-bottom: 26px; }
.yo-label {
	display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
	margin-bottom: 10px; font-size: 15px; font-weight: 700; color: var(--ink);
}
.yo-req, .yo-opt {
	flex: 0 0 auto; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 4px; line-height: 1.4;
}
.yo-req { background: #e2453a; color: #fff; }
.yo-opt { background: var(--line); color: var(--muted); }
.yo-hint { flex: 1 1 100%; font-size: 12.5px; font-weight: 500; color: var(--muted); line-height: 1.6; }

.yo-input {
	width: 100%; padding: 14px 16px; font-size: 16px; font-family: inherit; color: var(--ink);
	background: #fff; border: 1.5px solid var(--line-2); border-radius: 10px;
	transition: border-color .18s, box-shadow .18s;
	-webkit-appearance: none; appearance: none;
}
.yo-input::placeholder { color: #bbb; }
.yo-input:hover { border-color: var(--green-accent); }
.yo-input:focus {
	outline: none; border-color: var(--green-primary);
	box-shadow: 0 0 0 3px rgba(0,128,88,.14);
}
.yo-textarea { line-height: 1.8; resize: vertical; min-height: 140px; }
.yo-select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23008058' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right 16px center; background-size: 12px 8px;
	padding-right: 42px;
}
.yo-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.yo-count { margin-top: 6px; text-align: right; font-size: 12px; color: var(--muted); }
.yo-note { margin-top: 10px; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.yo-note--warn {
	margin: -12px 0 26px; padding: 12px 14px; border-radius: 8px;
	background: #fff8e6; border: 1px solid #f0d089; color: #8a6320; font-size: 13px;
}
.yo-subhead {
	margin: 4px 0 18px; padding-left: 12px; border-left: 4px solid var(--green-accent);
	font-size: 15px; font-weight: 700; color: var(--green-primary);
}

/* エラー */
.yo-error { display: none; margin-top: 8px; font-size: 13px; font-weight: 500; color: #d3392e; line-height: 1.6; }
.yo-field.is-error .yo-error { display: block; }
.yo-field.is-error .yo-input { border-color: #e2453a; background: #fff8f7; }
.yo-field.is-error .yo-card__box,
.yo-field.is-error .yo-agree__box { border-color: #e2453a; }
.yo-alert {
	margin-bottom: 28px; padding: 16px 18px; border-radius: 10px;
	background: #fff3f2; border: 1px solid #f0b4ae; color: #b83026;
	font-size: 14px; font-weight: 500; line-height: 1.7;
}

/* ---------- ご用件カード ---------- */
.yo-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.yo-card { position: relative; display: block; cursor: pointer; }
.yo-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.yo-card__box {
	display: flex; flex-direction: column; gap: 6px; height: 100%;
	padding: 18px 16px 16px 42px; background: #fff;
	border: 1.5px solid var(--line-2); border-radius: 12px;
	transition: border-color .18s, background .18s, box-shadow .18s, transform .18s;
}
.yo-card__box::before {
	content: ""; position: absolute; left: 16px; top: 19px; width: 18px; height: 18px;
	border: 1.5px solid var(--line-2); border-radius: 5px; background: #fff;
	transition: border-color .18s, background .18s;
}
.yo-card__box::after {
	content: ""; position: absolute; left: 21px; top: 24px; width: 9px; height: 5px;
	border-left: 2px solid #fff; border-bottom: 2px solid #fff;
	transform: rotate(-45deg) scale(.4); opacity: 0; transition: opacity .18s, transform .18s;
}
.yo-card:hover .yo-card__box { border-color: var(--green-accent); }
.yo-card input:focus-visible + .yo-card__box { box-shadow: 0 0 0 3px rgba(0,128,88,.18); }
.yo-card input:checked + .yo-card__box {
	border-color: var(--green-primary); background: var(--green-mist);
	box-shadow: 0 2px 10px rgba(0,128,88,.10);
}
.yo-card input:checked + .yo-card__box::before { background: var(--green-primary); border-color: var(--green-primary); }
.yo-card input:checked + .yo-card__box::after { opacity: 1; transform: rotate(-45deg) scale(1); }
.yo-card input:active + .yo-card__box { transform: scale(.985); }
.yo-card__title { font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.5; }
.yo-card__desc { font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* ---------- チップ（時間帯・曜日） ---------- */
.yo-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.yo-chip { position: relative; cursor: pointer; }
.yo-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.yo-chip span {
	display: inline-flex; align-items: center; justify-content: center; min-width: 52px;
	padding: 11px 20px; background: #fff; border: 1.5px solid var(--line-2); border-radius: 999px;
	font-size: 14.5px; font-weight: 600; color: var(--ink-2);
	transition: border-color .18s, background .18s, color .18s, transform .12s;
}
.yo-chip:hover span { border-color: var(--green-accent); }
.yo-chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(0,128,88,.18); }
.yo-chip input:checked + span { background: var(--green-primary); border-color: var(--green-primary); color: #fff; }
.yo-chip input:active + span { transform: scale(.96); }
.yo-chip--all input:checked + span { background: var(--green-accent); border-color: var(--green-accent); }

/* ---------- コース選択アコーディオン ---------- */
.yo-acc { border: 1.5px solid var(--line-2); border-radius: 12px; overflow: hidden; background: #fff; }
.yo-acc__item + .yo-acc__item { border-top: 1px solid var(--line); }
.yo-acc__btn {
	width: 100%; display: flex; align-items: center; gap: 12px;
	padding: 16px 18px; background: #fff; border: 0; cursor: pointer;
	font-family: inherit; font-size: 15px; font-weight: 700; color: var(--ink); text-align: left;
	transition: background .18s;
}
.yo-acc__btn:hover { background: var(--green-mist); }
.yo-acc__btn:focus-visible { outline: 2px solid var(--green-primary); outline-offset: -2px; }
.yo-acc__count { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); }
.yo-acc__chev { width: 12px; height: 8px; flex: 0 0 auto; color: var(--green-primary); transition: transform .25s; }
.yo-acc__btn[aria-expanded="true"] { background: var(--green-mist); }
.yo-acc__btn[aria-expanded="true"] .yo-acc__chev { transform: rotate(180deg); }
.yo-acc__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s ease; }
.yo-acc__panel.is-open { grid-template-rows: 1fr; }
.yo-acc__inner { overflow: hidden; display: grid; gap: 8px; padding: 0 18px; }
.yo-acc__panel.is-open .yo-acc__inner { padding: 4px 18px 18px; }

.yo-radio { position: relative; display: block; cursor: pointer; }
.yo-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.yo-radio__box {
	display: flex; align-items: center; gap: 12px;
	padding: 13px 16px 13px 42px; background: #fff;
	border: 1.5px solid var(--line-2); border-radius: 10px;
	transition: border-color .18s, background .18s, transform .12s;
}
.yo-radio__box::before {
	content: ""; position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
	width: 18px; height: 18px; border: 1.5px solid var(--line-2); border-radius: 50%; background: #fff;
	transition: border-color .18s, box-shadow .18s;
}
.yo-radio:hover .yo-radio__box { border-color: var(--green-accent); }
.yo-radio input:focus-visible + .yo-radio__box { box-shadow: 0 0 0 3px rgba(0,128,88,.18); }
.yo-radio input:checked + .yo-radio__box { border-color: var(--green-primary); background: var(--green-mist); }
.yo-radio input:checked + .yo-radio__box::before {
	border-color: var(--green-primary); box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 12px var(--green-primary);
}
.yo-radio input:active + .yo-radio__box { transform: scale(.99); }
.yo-radio__name { font-size: 14.5px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.yo-radio__yen {
	margin-left: auto; flex: 0 0 auto; display: inline-flex; align-items: baseline; gap: 4px;
	padding: 4px 12px; background: #fff; border: 1px solid var(--green-accent); border-radius: 999px;
	font-size: 14px; font-weight: 700; color: var(--green-primary); white-space: nowrap;
}
.yo-radio__yen small { font-size: 10px; font-weight: 500; }

/* 選択中バッジ */
.yo-picked {
	display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
	margin-bottom: 12px; padding: 12px 16px;
	background: var(--green-soft); border: 1px solid var(--green-accent); border-radius: 10px;
	animation: yoFade .25s ease both;
}
.yo-picked__label {
	flex: 0 0 auto; padding: 3px 9px; border-radius: 4px;
	background: var(--green-primary); color: #fff; font-size: 11px; font-weight: 700;
}
.yo-picked__name { flex: 1 1 auto; font-size: 14.5px; font-weight: 700; color: var(--green-primary); line-height: 1.5; }
.yo-picked__clear {
	flex: 0 0 auto; background: none; border: 0; padding: 4px 2px; cursor: pointer;
	font-family: inherit; font-size: 12.5px; color: var(--ink-2); text-decoration: underline;
}
.yo-picked__clear:hover { color: var(--green-primary); }

/* ---------- 郵便番号 ---------- */
.yo-ziprow { display: flex; gap: 10px; align-items: stretch; }
.yo-input--zip { max-width: 190px; }
.yo-zipbtn {
	flex: 0 0 auto; padding: 0 20px; background: #fff; cursor: pointer;
	border: 1.5px solid var(--green-accent); border-radius: 10px;
	font-family: inherit; font-size: 13.5px; font-weight: 700; color: var(--green-primary);
	transition: background .18s;
}
.yo-zipbtn:hover { background: var(--green-mist); }
.yo-zipbtn[disabled] { opacity: .5; cursor: default; }

/* ---------- 条件表示（資料送付先） ---------- */
.yo-reveal { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.yo-reveal[data-open="1"] { grid-template-rows: 1fr; }
.yo-reveal__inner { overflow: hidden; }
.yo-reveal[data-open="1"] .yo-reveal__inner {
	margin-top: 4px; padding: 24px 22px 4px;
	background: var(--green-mist); border-radius: 12px;
}

/* ---------- 同意 ---------- */
.yo-agree { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; padding: 18px 20px; background: var(--green-mist); border-radius: 10px; }
.yo-agree input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.yo-agree__box {
	position: relative; flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px;
	background: #fff; border: 1.5px solid var(--line-2); border-radius: 5px;
	transition: background .18s, border-color .18s;
}
.yo-agree__box::after {
	content: ""; position: absolute; left: 5px; top: 5px; width: 10px; height: 6px;
	border-left: 2px solid #fff; border-bottom: 2px solid #fff;
	transform: rotate(-45deg) scale(.4); opacity: 0; transition: opacity .18s, transform .18s;
}
.yo-agree input:checked + .yo-agree__box { background: var(--green-primary); border-color: var(--green-primary); }
.yo-agree input:checked + .yo-agree__box::after { opacity: 1; transform: rotate(-45deg) scale(1); }
.yo-agree input:focus-visible + .yo-agree__box { box-shadow: 0 0 0 3px rgba(0,128,88,.18); }
.yo-agree__txt { font-size: 14.5px; line-height: 1.7; color: var(--ink-2); display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.yo-agree__txt a { color: var(--green-primary); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- ボタン ---------- */
.yo-submit { margin-top: 34px; display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.yo-btn {
	position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	min-width: 260px; padding: 18px 34px; border: 0; border-radius: 999px; cursor: pointer;
	font-family: inherit; font-size: 16.5px; font-weight: 700; text-decoration: none; line-height: 1.4;
	transition: background .2s, color .2s, box-shadow .2s, transform .18s;
}
.yo-btn--primary { background: var(--green-primary); color: #fff; box-shadow: 0 4px 14px rgba(0,128,88,.24); }
.yo-btn--primary:hover { background: var(--green-primary-d); transform: translateY(-2px); box-shadow: 0 7px 20px rgba(0,128,88,.3); }
.yo-btn--ghost { min-width: 180px; background: #fff; color: var(--green-primary); border: 1.5px solid var(--green-accent); }
.yo-btn--ghost:hover { background: var(--green-mist); }
.yo-btn--tel { min-width: 220px; background: #fff; color: var(--ink); border: 1.5px solid var(--line-2); font-size: 20px; letter-spacing: .02em; }
.yo-btn:focus-visible { outline: 3px solid var(--green-accent); outline-offset: 3px; }
.yo-btn[disabled] { pointer-events: none; opacity: .7; }

.yo-spinner {
	display: none; width: 18px; height: 18px; border-radius: 50%;
	border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff;
	animation: yoSpin .7s linear infinite;
}
.yo-btn.is-sending .yo-spinner { display: block; }
.yo-btn.is-sending .yo-btn__label { opacity: .8; }
@keyframes yoSpin { to { transform: rotate(360deg); } }

/* ハニーポット */
.yo-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- 確認画面 ---------- */
.yo-confirm { animation: yoFade .3s ease both; }
.yo-confirm__title {
	margin: 0 0 10px; padding-bottom: 14px; border-bottom: 2px solid var(--green-primary);
	font-size: 22px; font-weight: 700; color: var(--green-primary);
}
.yo-confirm__lead { margin-bottom: 26px; font-size: 14.5px; color: var(--ink-2); }
.yo-summary { margin: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.yo-summary__row { display: grid; grid-template-columns: 210px 1fr; border-top: 1px solid var(--line); }
.yo-summary__row:first-child { border-top: 0; }
.yo-summary dt {
	padding: 15px 18px; background: var(--green-mist);
	font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.6;
}
.yo-summary dd {
	margin: 0; padding: 15px 18px; background: #fff;
	font-size: 15px; color: var(--ink-2); line-height: 1.8; word-break: break-word; white-space: pre-wrap;
}
.yo-summary dd.is-empty { color: #aaa; }

/* ---------- 完了画面 ---------- */
.yo-done { display: none; text-align: center; padding: 20px 0 10px; }
.yo-done.is-open { display: block; animation: yoFade .35s ease both; }
.yo-done__check { width: 84px; height: 84px; margin-bottom: 20px; }
.yo-done__circle, .yo-done__tick { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.yo-done__circle { stroke: var(--green-accent); stroke-width: 3; stroke-dasharray: 176; stroke-dashoffset: 176; animation: yoDraw .6s .05s ease forwards; }
.yo-done__tick { stroke: var(--green-primary); stroke-width: 4.5; stroke-dasharray: 48; stroke-dashoffset: 48; animation: yoDraw .35s .5s ease forwards; }
@keyframes yoDraw { to { stroke-dashoffset: 0; } }
.yo-done__title { margin: 0 0 16px; font-size: 26px; font-weight: 700; color: var(--green-primary); line-height: 1.5; }
.yo-done__lead { font-size: 16px; line-height: 1.9; color: var(--ink-2); }
.yo-done__note {
	margin: 24px auto 0; max-width: 620px; padding: 18px 20px; text-align: left;
	background: var(--green-mist); border-radius: 10px; font-size: 13.5px; line-height: 1.8; color: var(--ink-2);
}
.yo-done__btns { margin-top: 30px; display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

/* 完了表示中は入力側を隠す */
.yo-done.is-open ~ .yo-intro,
.yo-done.is-open ~ .yo-form,
.yo-done.is-open ~ .yo-confirm { display: none; }

@keyframes yoFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* エラー時のシェイク */
@keyframes yoShake {
	0%, 100% { transform: translateX(0); }
	20% { transform: translateX(-6px); }
	40% { transform: translateX(5px); }
	60% { transform: translateX(-3px); }
	80% { transform: translateX(2px); }
}
.yo-shake { animation: yoShake .4s ease; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 760px) {
	.yo-container { padding: 0 16px 16px; }
	.yo-cards { grid-template-columns: 1fr; }
	.yo-grid2 { grid-template-columns: 1fr; }
	.yo-flow { grid-template-columns: 1fr; gap: 8px; }
	.yo-flow__item { flex-direction: row; gap: 14px; text-align: left; padding: 14px 16px; }
	.yo-flow__item + .yo-flow__item::before {
		left: 50%; top: -7px; transform: translateX(-50%);
		border-left: 6px solid transparent; border-right: 6px solid transparent;
		border-top: 7px solid var(--green-accent); border-bottom: 0;
	}
	.yo-flow__txt br { display: none; }
	.yo-step__head { font-size: 18.5px; }
	.yo-summary__row { grid-template-columns: 1fr; }
	.yo-summary dt { padding: 12px 16px 8px; }
	.yo-summary dd { padding: 4px 16px 14px; }
	.yo-btn { width: 100%; min-width: 0; }
	.yo-radio__box { flex-wrap: wrap; }
	.yo-radio__yen { margin-left: 0; }
	.yo-done__title { font-size: 21px; }
	.yo-intro__tel { flex-direction: column; align-items: flex-start; }
}

/* 動きを控えたい設定の環境ではアニメーションを止める */
@media (prefers-reduced-motion: reduce) {
	.yo-acc__panel, .yo-reveal, .yo-input, .yo-btn, .yo-card__box, .yo-chip span,
	.yo-radio__box, .yo-agree__box, .yo-acc__chev { transition: none !important; }
	.yo-confirm, .yo-picked, .yo-done.is-open { animation: none !important; }
	.yo-done__circle, .yo-done__tick { animation: none !important; stroke-dashoffset: 0 !important; }
	.yo-shake { animation: none !important; }
	.yo-spinner { animation-duration: 1.4s; }
	.yo-btn--primary:hover, .yo-btn:hover { transform: none; }
}
