/* =====================================================
 * 相性診断ツール(cdir-shindan)
 * 既存トーン: ネイビー #2c3e50 / 金 #d4a017 / 銀 #8e9aa6 / 銅 #a9764b
 * 全セレクタを .cdir-shindan でスコープ化
 * ===================================================== */

.cdir-shindan,
.cdir-shindan * {
	box-sizing: border-box;
}

.cdir-shindan {
	max-width: 960px;
	margin: 0 auto;
	padding: 24px 16px 32px;
	background: #fff;
	border: 1px solid #e5e9ee;
	border-radius: 14px;
}

/* 質問ステップとプログレスバーは読みやすい幅に留める(結果は全幅を使う) */
.cdir-shindan .cdir-shindan-step[data-cdir-step-index],
.cdir-shindan .cdir-shindan-progress {
	max-width: 640px;
	margin-left: auto;
	margin-right: auto;
}

/* ---- プログレスバー ---- */
.cdir-shindan .cdir-shindan-progress {
	height: 6px;
	border-radius: 999px;
	background: #eef2f5;
	overflow: hidden;
	margin-bottom: 24px;
}

.cdir-shindan .cdir-shindan-progress-bar {
	display: block;
	height: 100%;
	width: 0;
	border-radius: 999px;
	background: linear-gradient(90deg, #2c3e50, #5b7a99);
	transition: width 0.3s ease;
}

/* ---- 質問 ---- */
.cdir-shindan .cdir-shindan-qnum {
	margin: 0 0 4px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: #d4a017;
}

.cdir-shindan .cdir-shindan-qtitle {
	margin: 0 0 6px;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.4;
	color: #2c3e50;
}

.cdir-shindan .cdir-shindan-qsub {
	margin: 0 0 18px;
	font-size: 13px;
	color: #777;
}

/* ---- 選択肢 ---- */
.cdir-shindan .cdir-shindan-options {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

.cdir-shindan .cdir-shindan-opt {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	width: 100%;
	padding: 14px 14px;
	border: 1px solid #dde5ec;
	border-radius: 10px;
	background: #fff;
	color: #333;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	text-align: left;
	cursor: pointer;
	transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.cdir-shindan .cdir-shindan-opt:hover {
	border-color: #2c3e50;
	background: #f7f9fb;
	transform: translateY(-1px);
	box-shadow: 0 3px 10px rgba(44, 62, 80, 0.1);
}

.cdir-shindan .cdir-shindan-opt:active {
	transform: translateY(0);
}

.cdir-shindan .cdir-shindan-opt-note {
	font-size: 11px;
	font-weight: 400;
	color: #999;
}

/* ---- ナビゲーション ---- */
.cdir-shindan .cdir-shindan-nav {
	margin-top: 18px;
}

.cdir-shindan .cdir-shindan-back {
	border: none;
	background: none;
	padding: 6px 4px;
	font-size: 13px;
	color: #777;
	cursor: pointer;
}

.cdir-shindan .cdir-shindan-back:hover {
	color: #2c3e50;
	text-decoration: underline;
}

/* ---- ローディング ---- */
.cdir-shindan .cdir-shindan-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin: 32px 0;
	font-size: 14px;
	color: #555;
}

.cdir-shindan .cdir-shindan-spinner {
	width: 18px;
	height: 18px;
	border: 3px solid #eef2f5;
	border-top-color: #2c3e50;
	border-radius: 50%;
	animation: cdir-shindan-spin 0.8s linear infinite;
}

@keyframes cdir-shindan-spin {
	to { transform: rotate(360deg); }
}

/* ---- 結果 ---- */
.cdir-shindan .cdir-shindan-result-title {
	margin: 0 0 16px;
	font-size: 18px;
	font-weight: 700;
	text-align: center;
	color: #2c3e50;
}

.cdir-shindan .cdir-shindan-result-list {
	display: grid;
	grid-template-columns: 1fr;
	gap: 18px;
}

/* PCでは3カラム(1行)で表示 */
@media (min-width: 768px) {
	.cdir-shindan .cdir-shindan-result-list {
		grid-template-columns: repeat(3, 1fr);
		align-items: stretch;
	}
	.cdir-shindan .cdir-shindan-result-item {
		display: flex;
		flex-direction: column;
	}
	.cdir-shindan .cdir-shindan-card.cdir-card-grid {
		flex: 1;
	}
	.cdir-shindan .cdir-shindan-card .cdir-card {
		height: 100%;
	}
}

.cdir-shindan .cdir-shindan-result-item {
	border: 1px solid #e5e9ee;
	border-radius: 12px;
	padding: 12px;
	background: #fafbfc;
}

.cdir-shindan .cdir-shindan-rank-1 {
	border-color: #d4a017;
	background: #fffdf5;
}

.cdir-shindan .cdir-shindan-result-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 10px;
}

.cdir-shindan .cdir-shindan-rank-badge {
	display: inline-block;
	padding: 3px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	color: #fff;
	background: #2c3e50;
}

.cdir-shindan .cdir-shindan-rank-1 .cdir-shindan-rank-badge { background: #d4a017; }
.cdir-shindan .cdir-shindan-rank-2 .cdir-shindan-rank-badge { background: #8e9aa6; }
.cdir-shindan .cdir-shindan-rank-3 .cdir-shindan-rank-badge { background: #a9764b; }

.cdir-shindan .cdir-shindan-match {
	font-size: 13px;
	color: #555;
}

.cdir-shindan .cdir-shindan-match strong {
	font-size: 18px;
	color: #2c3e50;
}

/* 結果カードは1枚を全幅で表示(既存グリッドを上書き) */
.cdir-shindan .cdir-shindan-card.cdir-card-grid {
	grid-template-columns: 1fr;
}

/* ---- 結果ナビ ---- */
.cdir-shindan .cdir-shindan-nav-result {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
	margin-top: 22px;
	flex-wrap: wrap;
}

.cdir-shindan .cdir-shindan-retry {
	padding: 10px 20px;
	border: 1px solid #dde5ec;
	border-radius: 999px;
	background: #fff;
	color: #333;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}

.cdir-shindan .cdir-shindan-retry:hover {
	background: #f5f5f5;
}

.cdir-shindan .cdir-shindan-all {
	display: inline-block;
	padding: 10px 22px;
	border-radius: 999px;
	background: #2c3e50;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.15s ease;
}

.cdir-shindan .cdir-shindan-all:hover {
	background: #3d5166;
	color: #fff;
}

/* ---- エラー・空 ---- */
.cdir-shindan .cdir-shindan-error {
	margin: 14px 0 0;
	font-size: 13px;
	color: #c0392b;
	text-align: center;
}

.cdir-shindan .cdir-shindan-empty {
	margin: 24px 0;
	text-align: center;
	font-size: 14px;
	color: #777;
}

/* ---- モバイル ---- */
@media (max-width: 480px) {
	.cdir-shindan {
		padding: 18px 12px 24px;
	}
	.cdir-shindan .cdir-shindan-options {
		grid-template-columns: 1fr;
	}
	.cdir-shindan .cdir-shindan-qtitle {
		font-size: 18px;
	}
}
