/**
 * TOKOMU Webヒアリングフォーム
 * 色はテーマの CSS 変数（--c-primary など）を使い、無い場合はブルー系の既定値になります。
 */
.tkh {
	--tkh-primary: var(--c-primary, #1b62a8);
	--tkh-primary-soft: var(--c-tint, #e8f1fa);
	--tkh-ink: var(--c-ink, #1a2433);
	--tkh-body: var(--c-body, #334155);
	--tkh-muted: var(--c-muted, #566477);
	--tkh-line: var(--c-line, #d9e3ee);
	--tkh-bg: var(--c-alt, #f2f6fb);
	--tkh-danger: #c62828;
	--tkh-ok: #1e7d4f;
	--tkh-radius: 16px;

	background: var(--tkh-bg);
	color: var(--tkh-ink);
	font-size: 15px;
	line-height: 1.7;
}
.tkh *, .tkh *::before, .tkh *::after { box-sizing: border-box; }
.tkh [hidden] { display: none !important; }
.tkh p { margin: 0; }

.tkh-body { max-width: 880px; margin: 0 auto; padding: 24px 16px 64px; }
@media (min-width: 768px) { .tkh-body { padding: 32px 24px 96px; } }

/* ---------- Progress ---------- */
.tkh-progress {
	position: sticky;
	top: var(--form-header-h, 0px);
	z-index: 20;
	background: #fff;
	border-bottom: 1px solid var(--tkh-line);
}
.admin-bar .tkh-progress { top: calc(var(--form-header-h, 0px) + 32px); }
@media (max-width: 782px) { .admin-bar .tkh-progress { top: 0; } }
.tkh-progress__inner { max-width: 880px; margin: 0 auto; padding: 10px 16px 12px; }
.tkh-progress__meta { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 12px; font-weight: 700; color: var(--tkh-muted); }
.tkh-progress__track { height: 8px; overflow: hidden; border-radius: 999px; background: var(--tkh-line); }
.tkh-progress__bar { height: 100%; border-radius: 999px; background: var(--tkh-primary); transition: width 0.3s ease; }

/* ---------- Alerts ---------- */
.tkh-alert { margin-bottom: 20px; padding: 16px 18px; border-radius: 12px; font-size: 14px; }
.tkh-alert--error { border: 1px solid #f3b4b4; background: #fdecec; color: #8a1c1c; }
.tkh-alert__title { margin-bottom: 6px !important; font-weight: 700; }
.tkh-alert ul { margin: 0 0 8px; padding-left: 1.2em; }

.tkh-info {
	display: flex;
	gap: 12px;
	padding: 14px 16px;
	border: 1px solid color-mix(in srgb, var(--tkh-primary) 20%, transparent);
	border-radius: var(--tkh-radius);
	background: var(--tkh-primary-soft);
	font-size: 13px;
	color: var(--tkh-body);
}
.tkh-info > i { margin-top: 3px; color: var(--tkh-primary); }

/* ---------- Layout ---------- */
.tkh-form { display: flex; flex-direction: column; gap: 20px; }
.tkh-step { display: flex; flex-direction: column; gap: 20px; }
.tkh-card {
	display: flex;
	flex-direction: column;
	gap: 18px;
	padding: 20px;
	border: 1px solid var(--tkh-line);
	border-radius: var(--tkh-radius);
	background: #fff;
}
@media (min-width: 768px) { .tkh-card { padding: 28px; } }
.tkh-card__title {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding-left: 12px;
	border-left: 4px solid var(--tkh-primary);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.4;
}
.tkh-card__title i { font-size: 14px; color: var(--tkh-primary); }

.tkh-grid { display: grid; gap: 16px; }
@media (min-width: 768px) {
	.tkh-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.tkh-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.tkh-field { display: flex; flex-direction: column; gap: 6px; }
.tkh-label { display: block; margin: 0; font-size: 13px; font-weight: 700; color: var(--tkh-body); }
.tkh-req { color: var(--tkh-danger); }
.tkh-help { font-size: 12px; color: var(--tkh-muted); }

.tkh-input {
	width: 100%;
	min-height: 48px;
	padding: 10px 14px;
	border: 1px solid var(--tkh-line-strong, #b3c4d8);
	border-radius: 12px;
	background: #fff;
	font: inherit;
	font-size: 16px; /* iOSの自動ズーム防止 */
	color: var(--tkh-ink);
	transition: border-color 0.2s, box-shadow 0.2s;
}
textarea.tkh-input { min-height: 120px; resize: vertical; }
.tkh-input:focus { outline: none; border-color: var(--tkh-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tkh-primary) 20%, transparent); }
.tkh-input.is-invalid { border-color: var(--tkh-danger); background: #fffafa; }
.tkh-error { font-size: 12px; font-weight: 700; color: var(--tkh-danger); }

.tkh-sub { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--tkh-line); border-radius: 12px; background: var(--tkh-bg); }
.tkh-month { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.tkh-month .tkh-input { max-width: 220px; }

/* ---------- Choice cards ---------- */
.tkh-choices { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.tkh-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tkh-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 768px) {
	.tkh-cols-md-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.tkh-cols-md-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.tkh-cols-md-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.tkh-choice { position: relative; display: block; cursor: pointer; }
.tkh-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tkh-choice__box {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 100%;
	min-height: 48px;
	padding: 10px 12px;
	border: 1.5px solid var(--tkh-line);
	border-radius: 12px;
	background: #fff;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.45;
	text-align: center;
	transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.tkh-choice:hover .tkh-choice__box { border-color: color-mix(in srgb, var(--tkh-primary) 45%, #fff); }
.tkh-choice__icon { flex-shrink: 0; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--tkh-bg); color: var(--tkh-muted); font-size: 13px; }
.tkh-choice__text { display: flex; flex-direction: column; gap: 2px; }
.tkh-choice__note { font-size: 11px; font-weight: 400; color: var(--tkh-muted); }

.tkh-choice input:checked + .tkh-choice__box {
	border-color: var(--tkh-primary);
	background: var(--tkh-primary-soft);
	color: var(--tkh-primary);
	font-weight: 700;
}
.tkh-choice input:checked + .tkh-choice__box .tkh-choice__icon { background: #fff; color: var(--tkh-primary); }
.tkh-choice input:focus-visible + .tkh-choice__box { outline: 3px solid color-mix(in srgb, var(--tkh-primary) 35%, transparent); outline-offset: 2px; }

/* チェックボックス：左寄せ＋チェック印 */
.tkh-cols-md-2 .tkh-choice__box,
.tkh-choice input[type="checkbox"] + .tkh-choice__box { justify-content: flex-start; text-align: left; }
.tkh-choice input[type="checkbox"] + .tkh-choice__box::after {
	content: "";
	flex-shrink: 0;
	width: 18px; height: 18px;
	margin-left: auto;
	border: 1.5px solid var(--tkh-line-strong, #b3c4d8);
	border-radius: 5px;
	background: #fff center / 12px no-repeat;
}
.tkh-choice input[type="checkbox"]:checked + .tkh-choice__box::after {
	border-color: var(--tkh-primary);
	background-color: var(--tkh-primary);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E");
}
.tkh-cols-2 .tkh-choice input[type="checkbox"] + .tkh-choice__box,
.tkh-cols-md-4 .tkh-choice input[type="checkbox"] + .tkh-choice__box { justify-content: space-between; }

/* 大きいカード（目的） */
.tkh-choices--large .tkh-choice__box { flex-direction: column; padding: 18px 12px; border-width: 2px; border-radius: var(--tkh-radius); }
.tkh-choices--large .tkh-choice__icon { width: 44px; height: 44px; border-radius: 50%; font-size: 18px; background: var(--tkh-primary-soft); color: var(--tkh-primary); }
.tkh-choices--large .tkh-choice__label { font-size: 14px; font-weight: 700; color: var(--tkh-ink); }
@media (max-width: 767px) {
	.tkh-choices--large .tkh-choice__box { flex-direction: row; justify-content: flex-start; text-align: left; }
}

/* ---------- File upload ---------- */
.tkh-drop {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 28px 16px;
	border: 2px dashed var(--tkh-line-strong, #b3c4d8);
	border-radius: var(--tkh-radius);
	background: var(--tkh-bg);
	text-align: center;
	cursor: pointer;
	transition: border-color 0.2s, background 0.2s;
}
.tkh-drop:hover, .tkh-drop.is-dragover { border-color: var(--tkh-primary); background: var(--tkh-primary-soft); }
.tkh-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.tkh-drop > i { font-size: 30px; color: var(--tkh-primary); }
.tkh-drop__title { font-size: 13px; font-weight: 700; }
.tkh-drop__note { font-size: 11px; color: var(--tkh-muted); }
.tkh-file-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
.tkh-file-list li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; background: var(--tkh-bg); font-size: 12px; }
.tkh-file-list li.is-error { background: #fdecec; color: var(--tkh-danger); }

/* ---------- Summary / privacy ---------- */
.tkh-summary { margin: 0; padding: 4px 16px; border: 1px solid var(--tkh-line); border-radius: 12px; background: var(--tkh-bg); font-size: 13px; }
.tkh-summary div { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--tkh-line); }
.tkh-summary div:last-child { border-bottom: 0; }
@media (min-width: 768px) { .tkh-summary div { grid-template-columns: 180px 1fr; gap: 16px; } }
.tkh-summary dt { color: var(--tkh-muted); }
.tkh-summary dd { margin: 0; font-weight: 700; white-space: pre-wrap; word-break: break-word; }

.tkh-privacy { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 1px solid var(--tkh-line); }
.tkh-privacy__text { max-height: 120px; overflow-y: auto; padding: 12px; border: 1px solid var(--tkh-line); border-radius: 8px; background: var(--tkh-bg); font-size: 12px; line-height: 1.8; color: var(--tkh-body); }
.tkh-consent { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; font-weight: 700; cursor: pointer; }
.tkh-consent input { width: 20px; height: 20px; accent-color: var(--tkh-primary); }

/* ---------- Buttons ---------- */
.tkh-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 20px; border-top: 1px solid var(--tkh-line); }
.tkh-nav .js-tkh-next, .tkh-nav .js-tkh-submit { margin-left: auto; }
.tkh-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 48px;
	padding: 0 22px;
	border: 1px solid transparent;
	border-radius: 12px;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition: opacity 0.2s, background 0.2s;
}
.tkh-btn--primary { background: var(--tkh-primary); color: #fff; }
.tkh-btn--submit { min-width: 180px; background: var(--c-cta, var(--tkh-primary)); color: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15); }
.tkh-btn--primary:hover, .tkh-btn--submit:hover { opacity: 0.88; }
.tkh-btn--ghost { border-color: var(--tkh-line-strong, #b3c4d8); background: #fff; color: var(--tkh-body); }
.tkh-btn--ghost:hover { background: var(--tkh-bg); }
.tkh-btn[disabled] { opacity: 0.6; cursor: wait; }

/* ---------- Proxy (staff) ---------- */
.tkh-proxy { padding: 14px 16px; border: 1px solid #f1d38a; border-radius: var(--tkh-radius); background: #fff8e6; color: #6b4a00; font-size: 13px; }
.tkh-proxy__toggle { display: flex; align-items: center; gap: 10px; font-weight: 700; cursor: pointer; }
.tkh-proxy__toggle input { position: absolute; opacity: 0; }
.tkh-switch { position: relative; width: 40px; height: 22px; border-radius: 999px; background: #d6c7a4; transition: background 0.2s; }
.tkh-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.tkh-proxy__toggle input:checked + .tkh-switch { background: #c28a00; }
.tkh-proxy__toggle input:checked + .tkh-switch::after { transform: translateX(18px); }
.tkh-proxy__toggle input:focus-visible + .tkh-switch { outline: 3px solid #f1d38a; outline-offset: 2px; }
.tkh-proxy__body { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #f1d38a; }

/* ---------- Complete ---------- */
.tkh-complete { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 40px 20px; border: 1px solid var(--tkh-line); border-radius: var(--tkh-radius); background: #fff; text-align: center; }
.tkh-complete__icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: #e3f4ea; color: var(--tkh-ok); font-size: 34px; }
.tkh-complete__title { margin: 0; font-size: 22px; font-weight: 700; }
.tkh-complete__next { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 520px; margin: 8px 0; padding: 16px; border-radius: 12px; background: var(--tkh-bg); list-style: none; text-align: left; font-size: 14px; }
.tkh-complete__next li { display: flex; gap: 10px; }
.tkh-complete__num { flex-shrink: 0; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--tkh-primary); color: #fff; font-size: 12px; font-weight: 700; }

/* ---------- Misc ---------- */
.tkh-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.tkh-toast {
	position: fixed;
	top: 16px;
	left: 50%;
	z-index: 1000;
	max-width: calc(100% - 32px);
	padding: 12px 18px;
	border-radius: 12px;
	background: var(--tkh-danger);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
	transform: translateX(-50%);
}
.tkh .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
