/**
 * みつピタジョブ Core
 * 職業分析機能 質問画面
 */

/* =====================================================
 * 質問画面全体
 * ===================================================== */

.mj-ca-question {
	width: 100%;
	background:
		linear-gradient(
			180deg,
			#ffffff 0%,
			#fbfdfc 100%
		);
}

.mj-ca-question__inner {
	width: min(820px, 100%);
	margin: 0 auto;
}

/* =====================================================
 * 進捗表示
 * ===================================================== */

.mj-ca-progress {
	width: 100%;
	margin: 0 0 38px;
}

.mj-ca-progress__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin: 0 0 12px;
}

.mj-ca-progress__label {
	margin: 0;
	color: var(--mj-ca-text-light);
	font-size: 14px;
	font-weight: 700;
}

.mj-ca-progress__count {
	display: inline-flex;
	align-items: baseline;
	gap: 3px;
	color: var(--mj-ca-green);
	font-weight: 800;
}

.mj-ca-progress__current {
	font-size: 22px;
	line-height: 1;
}

.mj-ca-progress__separator,
.mj-ca-progress__total {
	font-size: 14px;
}

.mj-ca-progress__percent {
	min-width: 52px;
	margin: 0;
	color: var(--mj-ca-green);
	font-size: 14px;
	font-weight: 800;
	text-align: right;
}

.mj-ca-progress__track {
	position: relative;
	overflow: hidden;
	width: 100%;
	height: 10px;
	background: var(--mj-ca-green-light);
	border-radius: 999px;
}

.mj-ca-progress__bar {
	position: absolute;
	top: 0;
	left: 0;
	width: 0;
	height: 100%;
	background:
		linear-gradient(
			90deg,
			var(--mj-ca-green) 0%,
			#3d8b6b 100%
		);
	border-radius: inherit;
	transition: width 0.35s ease;
}

.mj-ca-progress__bar::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		linear-gradient(
			90deg,
			transparent 0%,
			rgba(255, 255, 255, 0.35) 50%,
			transparent 100%
		);
	transform: translateX(-100%);
	animation: mj-ca-progress-shine 2.4s ease-in-out infinite;
}

@keyframes mj-ca-progress-shine {

	0%,
	45% {
		transform: translateX(-100%);
	}

	75%,
	100% {
		transform: translateX(100%);
	}
}

/* =====================================================
 * 質問番号
 * ===================================================== */

.mj-ca-question__number-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	margin: 0 0 18px;
}

.mj-ca-question__number-label {
	color: var(--mj-ca-text-light);
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.mj-ca-question__number {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 48px;
	height: 34px;
	padding: 0 13px;
	color: var(--mj-ca-white);
	background: var(--mj-ca-green);
	border-radius: 999px;
	font-size: 15px;
	font-weight: 800;
	line-height: 1;
}

.mj-ca-question__total {
	color: var(--mj-ca-text-light);
	font-size: 13px;
	font-weight: 700;
}

/* =====================================================
 * 質問文
 * ===================================================== */

.mj-ca-question__header {
	margin: 0 0 32px;
	text-align: center;
}

.mj-ca-question__eyebrow {
	margin: 0 0 10px;
	color: var(--mj-ca-green);
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.08em;
}

.mj-ca-question__title,
.mj-ca-question__text {
	margin: 0;
	color: var(--mj-ca-text);
	font-size: clamp(23px, 4vw, 34px);
	font-weight: 800;
	line-height: 1.55;
	letter-spacing: -0.015em;
}

.mj-ca-question__description {
	margin: 14px 0 0;
	color: var(--mj-ca-text-light);
	font-size: 14px;
	line-height: 1.8;
}

/* =====================================================
 * 回答選択肢
 * ===================================================== */

.mj-ca-question__answers,
.mj-ca-question__options {
	display: grid;
	grid-template-columns: 1fr;
	gap: 14px;
	width: min(680px, 100%);
	margin: 0 auto;
	padding: 0;
	border: 0;
}

.mj-ca-question__options legend,
.mj-ca-question__answers legend {
	padding: 0;
}

.mj-ca-answer {
	position: relative;
	display: flex;
	align-items: center;
	gap: 16px;
	width: 100%;
	min-height: 72px;
	margin: 0;
	padding: 16px 20px;
	color: var(--mj-ca-text);
	background: var(--mj-ca-white);
	border: 2px solid var(--mj-ca-border);
	border-radius: 16px;
	cursor: pointer;
	box-shadow:
		0 5px 16px rgba(38, 53, 47, 0.04);
	transition:
		transform 0.2s ease,
		border-color 0.2s ease,
		background-color 0.2s ease,
		box-shadow 0.2s ease;
}

.mj-ca-answer:hover {
	transform: translateY(-2px);
	background: var(--mj-ca-green-pale);
	border-color: #9fc8b6;
	box-shadow:
		0 10px 24px rgba(38, 53, 47, 0.08);
}

.mj-ca-answer.is-selected,
.mj-ca-answer:has(.mj-ca-answer__input:checked) {
	color: var(--mj-ca-green-dark);
	background: var(--mj-ca-green-light);
	border-color: var(--mj-ca-green);
	box-shadow:
		0 10px 24px rgba(23, 98, 71, 0.12);
}

.mj-ca-answer__input {
	position: absolute;
	overflow: hidden;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.mj-ca-answer__indicator {
	position: relative;
	flex: 0 0 auto;
	width: 25px;
	height: 25px;
	background: var(--mj-ca-white);
	border: 2px solid #b8cbc2;
	border-radius: 50%;
	transition:
		border-color 0.2s ease,
		background-color 0.2s ease,
		box-shadow 0.2s ease;
}

.mj-ca-answer__indicator::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 11px;
	height: 11px;
	background: var(--mj-ca-white);
	border-radius: 50%;
	transform: translate(-50%, -50%) scale(0);
	transition: transform 0.2s ease;
}

.mj-ca-answer.is-selected .mj-ca-answer__indicator,
.mj-ca-answer:has(.mj-ca-answer__input:checked)
	.mj-ca-answer__indicator {
	background: var(--mj-ca-green);
	border-color: var(--mj-ca-green);
	box-shadow:
		0 0 0 4px rgba(23, 98, 71, 0.12);
}

.mj-ca-answer.is-selected
	.mj-ca-answer__indicator::after,
.mj-ca-answer:has(.mj-ca-answer__input:checked)
	.mj-ca-answer__indicator::after {
	transform: translate(-50%, -50%) scale(1);
}

.mj-ca-answer__text {
	display: block;
	flex: 1 1 auto;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.65;
}

.mj-ca-answer__input:focus-visible
	+ .mj-ca-answer__indicator {
	outline: 3px solid rgba(23, 98, 71, 0.24);
	outline-offset: 4px;
}

/* =====================================================
 * 選択肢の強弱表示
 * ===================================================== */

.mj-ca-answer:first-child {
	border-left-color: var(--mj-ca-green);
}

.mj-ca-answer:last-child {
	border-left-color: #c9d5d0;
}

/* =====================================================
 * 回答案内
 * ===================================================== */

.mj-ca-question__hint {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	gap: 8px;
	margin: 22px auto 0;
	color: var(--mj-ca-text-light);
	font-size: 13px;
	text-align: center;
}

.mj-ca-question__hint-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	color: var(--mj-ca-green);
	background: var(--mj-ca-green-light);
	border-radius: 50%;
	font-size: 12px;
	font-weight: 800;
}

/* =====================================================
 * 回答エラー
 * ===================================================== */

.mj-ca-question__error,
[data-mj-ca-answer-error] {
	width: min(680px, 100%);
	margin: 18px auto 0;
	text-align: center;
}

[data-mj-ca-answer-error]:focus {
	outline: none;
}

/* =====================================================
 * 操作ボタン
 * ===================================================== */

.mj-ca-question__navigation,
.mj-ca-question__actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: min(680px, 100%);
	margin: 34px auto 0;
	padding-top: 26px;
	border-top: 1px solid var(--mj-ca-border);
}

.mj-ca-question__previous,
.mj-ca-question__next {
	min-width: 190px;
}

.mj-ca-question__previous {
	color: var(--mj-ca-green);
	background: var(--mj-ca-white);
	border: 1px solid var(--mj-ca-green);
}

.mj-ca-question__previous:hover {
	color: var(--mj-ca-green-dark);
	background: var(--mj-ca-green-pale);
	border-color: var(--mj-ca-green-dark);
}

.mj-ca-question__previous .mj-ca-button__arrow {
	order: -1;
}

.mj-ca-question__previous:hover
	.mj-ca-button__arrow {
	transform: translateX(-3px);
}

.mj-ca-question__next {
	margin-left: auto;
}

/* =====================================================
 * 質問切り替えアニメーション
 * ===================================================== */

.mj-ca-question__header,
.mj-ca-question__options,
.mj-ca-question__answers {
	animation: mj-ca-question-enter 0.32s ease both;
}

.mj-ca-question__options,
.mj-ca-question__answers {
	animation-delay: 0.05s;
}

@keyframes mj-ca-question-enter {
	from {
		opacity: 0;
		transform: translateY(8px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* =====================================================
 * タブレット
 * ===================================================== */

@media (max-width: 768px) {

	.mj-ca-progress {
		margin-bottom: 30px;
	}

	.mj-ca-question__header {
		margin-bottom: 26px;
	}

	.mj-ca-question__title,
	.mj-ca-question__text {
		font-size: 25px;
	}

	.mj-ca-answer {
		min-height: 66px;
		padding: 14px 18px;
	}

	.mj-ca-question__navigation,
	.mj-ca-question__actions {
		margin-top: 28px;
	}
}

/* =====================================================
 * スマートフォン
 * ===================================================== */

@media (max-width: 640px) {

	.mj-ca-progress {
		margin-bottom: 25px;
	}

	.mj-ca-progress__header {
		margin-bottom: 9px;
	}

	.mj-ca-progress__current {
		font-size: 19px;
	}

	.mj-ca-progress__track {
		height: 8px;
	}

	.mj-ca-question__number-wrap {
		margin-bottom: 14px;
	}

	.mj-ca-question__header {
		margin-bottom: 22px;
	}

	.mj-ca-question__title,
	.mj-ca-question__text {
		font-size: 21px;
		line-height: 1.55;
	}

	.mj-ca-question__description {
		font-size: 13px;
	}

	.mj-ca-question__answers,
	.mj-ca-question__options {
		gap: 11px;
	}

	.mj-ca-answer {
		gap: 13px;
		min-height: 60px;
		padding: 13px 14px;
		border-radius: 13px;
	}

	.mj-ca-answer:hover {
		transform: none;
	}

	.mj-ca-answer__indicator {
		width: 23px;
		height: 23px;
	}

	.mj-ca-answer__indicator::after {
		width: 10px;
		height: 10px;
	}

	.mj-ca-answer__text {
		font-size: 14px;
		line-height: 1.55;
	}

	.mj-ca-question__navigation,
	.mj-ca-question__actions {
		flex-direction: column-reverse;
		gap: 11px;
		margin-top: 26px;
		padding-top: 22px;
	}

	.mj-ca-question__previous,
	.mj-ca-question__next {
		width: 100%;
		min-width: 0;
		margin: 0;
	}

	.mj-ca-question__previous {
		background: transparent;
	}
}

/* =====================================================
 * 古いブラウザ向け補助
 * ===================================================== */

@supports not selector(:has(*)) {

	.mj-ca-answer.is-selected {
		color: var(--mj-ca-green-dark);
		background: var(--mj-ca-green-light);
		border-color: var(--mj-ca-green);
	}

	.mj-ca-answer.is-selected
		.mj-ca-answer__indicator {
		background: var(--mj-ca-green);
		border-color: var(--mj-ca-green);
	}

	.mj-ca-answer.is-selected
		.mj-ca-answer__indicator::after {
		transform: translate(-50%, -50%) scale(1);
	}
}

/* =====================================================
 * 動きを減らす設定
 * ===================================================== */

@media (prefers-reduced-motion: reduce) {

	.mj-ca-progress__bar::after {
		animation: none;
	}

	.mj-ca-question__header,
	.mj-ca-question__options,
	.mj-ca-question__answers {
		animation: none;
	}

	.mj-ca-answer:hover {
		transform: none;
	}
}