/*
 * needs_diagnosis_demo.css
 * 「◯◯診断」体験デモ ＋ パラメータ付きURL・QRコード発行ツール
 * 既存サイトのクラスと衝突しないよう、診断部分は ndg- 、URL/QRツール部分は pq- を接頭辞にしています。
 */

#needs-diagnosis-demo,
#param-qr-demo {
	box-sizing: border-box;
	margin: 1.4rem 0;
	padding: 1rem 1.1rem 2.4rem;
	background: #f4f8fb;
	border-radius: 1rem;
	scroll-margin-top: 90px;
}

#needs-diagnosis-demo *,
#needs-diagnosis-demo *::before,
#needs-diagnosis-demo *::after,
#param-qr-demo *,
#param-qr-demo *::before,
#param-qr-demo *::after {
	box-sizing: border-box;
}

/* ---------- 見出しエリア（キャッチーに） ---------- */

.ndg-head {
	text-align: center;
	margin-bottom: 1.4rem;
}

/* ---------- 共通：ラベルバッジ ---------- */

.ndg-badge,
.pq-badge {
	display: inline-block;
	padding: .6rem 2rem;
	border-radius: 999px;
	background: #0175d8;
	color: #fff;
	font-size: 1.56rem;
	font-weight: 700;
	letter-spacing: .06em;
	margin-bottom: .6rem;
}

.ndg-head .ndg-badge {
	position: relative;
	box-shadow: 0 0 0 0 rgba(1, 117, 216, .45);
	animation: ndg-badge-pulse 2.2s ease-out infinite;
}

@keyframes ndg-badge-pulse {
	0% { box-shadow: 0 0 0 0 rgba(1, 117, 216, .45); }
	70% { box-shadow: 0 0 0 .55rem rgba(1, 117, 216, 0); }
	100% { box-shadow: 0 0 0 0 rgba(1, 117, 216, 0); }
}

h3.ndg-headline {
	display: block;
	margin: .7rem auto 0;
	max-width: 32rem;
	font-size: 1.28rem;
	font-weight: 800;
	line-height: 1.6;
	color: #12233f;
	letter-spacing: .01em;
	background: none;
	padding: 0;
	box-decoration-break: initial;
	-webkit-box-decoration-break: initial;
}

.ndg-headline__icon {
	display: inline-block;
	margin-right: .15rem;
	animation: ndg-icon-swing 2.6s ease-in-out infinite;
	transform-origin: 70% 70%;
}

@keyframes ndg-icon-swing {
	0%, 100% { transform: rotate(0deg); }
	20% { transform: rotate(-12deg); }
	40% { transform: rotate(8deg); }
	60% { transform: rotate(-6deg); }
	80% { transform: rotate(0deg); }
}

.ndg-headline__mark {
	position: relative;
	color: #0175d8;
	white-space: nowrap;
}

.ndg-headline__mark::after {
	content: "";
	position: absolute;
	left: -.05em;
	right: -.05em;
	bottom: -.06em;
	height: .32em;
	background: linear-gradient(90deg, #ffd23f, #ff9f43);
	border-radius: .2em;
	z-index: -1;
	opacity: .55;
}

.ndg-lead {
	font-size: .86rem;
	color: #555;
	line-height: 1.9;
	margin: .6rem auto 0;
	max-width: 34rem;
}

.ndg-notice,
.pq-notice {
	font-size: .8rem;
	line-height: 1.85;
	color: #55606c;
	background: #fff;
	border: 1px dashed #b9cde6;
	border-radius: .6rem;
	padding: .7rem .9rem;
	margin: .6rem 0 1.2rem;
}

/* ---------- 診断パネル全体 ---------- */

.ndg-container {
	max-width: 780px;
	margin: 0 auto;
}

.ndg-panel,
.ndg-result {
	background: #fff;
	border-radius: 1rem;
	box-shadow: 0 .6rem 1.8rem rgba(0, 30, 70, .08);
	padding: 1.6rem 1.3rem 1.3rem;
}

/* ---------- 進捗インジケーター ---------- */

.ndg-progress {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .4rem;
	margin: 0 auto 1.4rem;
	max-width: 90%;
}

.ndg-progress__step {
	flex: 0 0 auto;
	width: 1.6rem;
	height: 1.6rem;
	border-radius: 50%;
	background: #e6edf3;
	color: #97a3ae;
	font-size: .75rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .2s ease, color .2s ease;
}

.ndg-progress__step.is-active {
	background: #0175d8;
	color: #fff;
}

.ndg-progress__step.is-done {
	background: #7bb8f2;
	color: #fff;
}

.ndg-progress__bar {
	flex: 1 1 auto;
	height: 2px;
	background: #e6edf3;
}

.ndg-progress__bar.is-done {
	background: #7bb8f2;
}

/* ---------- 質問 ---------- */

.ndg-question__head {
	width: 92%;
	margin: 0 auto 1rem;
	text-align: center;
}

.ndg-question__no {
	display: block;
	font-size: .74rem;
	font-weight: 700;
	color: #0175d8;
	letter-spacing: .08em;
	margin-bottom: .35rem;
}

.ndg-question__title {
	font-size: 1.08rem;
	font-weight: 700;
	color: #1a1a1a;
	line-height: 1.6;
	margin: 0 0 .25rem;
}

.ndg-question__subtitle {
	font-size: .76rem;
	color: #8a8a8a;
	margin: 0;
}

.ndg-question__options {
	width: 92%;
	margin: 0 auto;
	display: grid;
	gap: .6rem;
}

.ndg-option {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: .6rem;
	padding: .75rem .85rem;
	border: 1px solid #dfe6ec;
	border-radius: .6rem;
	background: #fbfcfe;
	cursor: pointer;
	transition: border-color .15s ease, background .15s ease;
}

.ndg-option:hover {
	border-color: #7bb8f2;
	background: #f2f9ff;
}

.ndg-option.is-selected {
	border-color: #0175d8;
	background: #eaf2fc;
}

.ndg-option__input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.ndg-option__mark {
	flex: 0 0 auto;
	width: 1.1rem;
	height: 1.1rem;
	margin-top: .1rem;
	border-radius: 50%;
	border: 2px solid #c3cdd6;
	position: relative;
	transition: border-color .15s ease;
}

.ndg-option.is-selected .ndg-option__mark {
	border-color: #0175d8;
}

.ndg-option.is-selected .ndg-option__mark::after {
	content: "";
	position: absolute;
	top: .18rem;
	left: .18rem;
	width: .5rem;
	height: .5rem;
	border-radius: 50%;
	background: #0175d8;
}

.ndg-option__text {
	flex: 1 1 auto;
	font-size: .86rem;
	line-height: 1.7;
	color: #333;
}

/* ---------- 戻るボタン ---------- */

.ndg-nav {
	width: 92%;
	margin: 1rem auto 0;
	display: flex;
	justify-content: flex-start;
}

.ndg-btn--ghost {
	appearance: none;
	border: none;
	cursor: pointer;
	font-weight: 700;
	border-radius: 999px;
	padding: .5rem 1.2rem;
	background: #eef2f5;
	color: #667;
	font-size: .8rem;
	transition: background .15s ease, opacity .15s ease;
}

.ndg-btn--ghost:disabled {
	opacity: .4;
	cursor: not-allowed;
}

.ndg-btn--ghost:not(:disabled):hover {
	background: #e2e8ed;
}

/* ---------- 結果 ---------- */

.ndg-result__block {
	width: 92%;
	margin: 0 auto 1.4rem;
}

.ndg-score-row {
	display: flex;
	justify-content: center;
	gap: .9rem;
	margin: 0 0 1.2rem;
	flex-wrap: wrap;
}

.ndg-score-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .3rem;
	opacity: 0;
	transform: scale(.6);
	animation: ndg-score-pop .45s cubic-bezier(.34, 1.56, .64, 1) forwards;
	animation-delay: var(--ndg-score-delay, 0s);
}

.ndg-score-item__mark {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.6rem;
	height: 2.6rem;
	border-radius: 50%;
	font-size: 1.3rem;
	font-weight: 800;
	line-height: 1;
	border: 2px solid transparent;
}

.ndg-score-item--good .ndg-score-item__mark {
	background: #eafbf1;
	border-color: #29b16d;
	color: #1f9d5c;
}

.ndg-score-item--warn .ndg-score-item__mark {
	background: #fff8e6;
	border-color: #f0a202;
	color: #c97f00;
}

.ndg-score-item--bad .ndg-score-item__mark {
	background: #fdecec;
	border-color: #e0473f;
	color: #d1382f;
}

.ndg-score-item__label {
	font-size: .68rem;
	font-weight: 700;
	color: #8a8a8a;
	letter-spacing: .04em;
}

.ndg-score-row--single {
	margin: 0 0 1.4rem;
}

.ndg-score-item--overall .ndg-score-item__mark {
	width: 4.4rem;
	height: 4.4rem;
	font-size: 2.2rem;
	border-width: 3px;
}

.ndg-score-item--overall .ndg-score-item__label {
	font-size: .85rem;
	font-weight: 800;
	letter-spacing: .02em;
}

.ndg-score-item--overall.ndg-score-item--good .ndg-score-item__label { color: #1f9d5c; }
.ndg-score-item--overall.ndg-score-item--warn .ndg-score-item__label { color: #c97f00; }
.ndg-score-item--overall.ndg-score-item--bad .ndg-score-item__label { color: #d1382f; }

@keyframes ndg-score-pop {
	0% { opacity: 0; transform: scale(.6); }
	100% { opacity: 1; transform: scale(1); }
}

.ndg-result__tendency {
	font-size: .8rem;
	line-height: 1.85;
	color: #0a4a8f;
	background: #eaf4ff;
	border-left: 3px solid #0175d8;
	border-radius: .4rem;
	padding: .7rem .9rem;
	margin: 0;
}

.ndg-result__heading {
	margin: 0 0 .7rem;
	text-align: center;
}

.ndg-result__heading span {
	display: inline-block;
	padding: .2rem 1rem;
	border-bottom: 2px solid #0175d8;
	font-size: .92rem;
	font-weight: 700;
	color: #0175d8;
	letter-spacing: .05em;
}

.ndg-issue-list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: .5rem;
}

.ndg-issue-list li {
	position: relative;
	padding: .6rem .8rem .6rem 1.9rem;
	background: #f7fafc;
	border-left: 3px solid #7bb8f2;
	border-radius: .35rem;
	font-size: .82rem;
	line-height: 1.8;
	color: #333;
}

.ndg-issue-list li::before {
	content: "!";
	position: absolute;
	left: .65rem;
	top: .62rem;
	width: 1rem;
	height: 1rem;
	border-radius: 50%;
	background: #7bb8f2;
	color: #fff;
	font-size: .68rem;
	font-weight: 700;
	line-height: 1rem;
	text-align: center;
}

.ndg-proposal-lead {
	font-size: .95rem;
	font-weight: 700;
	color: #0175d8;
	line-height: 1.8;
	margin: 0 0 .7rem;
}

.ndg-proposal-text {
	font-size: .82rem;
	line-height: 1.85;
	color: #333;
	margin: 0 0 .7rem;
}

.ndg-proposal-note {
	font-size: .78rem;
	line-height: 1.8;
	color: #556;
	background: #f4f8fb;
	border-radius: .5rem;
	padding: .65rem .8rem;
	margin: 0 0 .6rem;
}

.ndg-restart {
	display: block;
	margin: 1rem auto 0;
	background: none;
	border: none;
	color: #8a8a8a;
	font-size: .76rem;
	text-decoration: underline;
	cursor: pointer;
}

/* ============================================================
   パラメータ付きURL・QRコード発行ツール（pq-）
   ============================================================ */

.pq-container {
	max-width: 640px;
	margin: 0 auto;
}

.pq-panel {
	background: #fff;
	border-radius: 1rem;
	box-shadow: 0 .6rem 1.8rem rgba(0, 30, 70, .08);
	padding: 1.5rem 1.3rem;
}

.pq-field {
	margin-bottom: 1rem;
}

.pq-field label {
	display: block;
	font-size: .82rem;
	font-weight: 700;
	color: #333;
	margin-bottom: .35rem;
}

.pq-field small {
	display: block;
	font-size: .74rem;
	color: #8a8a8a;
	margin-top: .3rem;
	line-height: 1.6;
}

.pq-field input[type="text"],
.pq-field select {
	width: 100%;
	padding: .6rem .7rem;
	border: 1px solid #d5dee7;
	border-radius: .5rem;
	font-size: .88rem;
	background: #fbfcfe;
	color: #222;
}

.pq-field input[type="text"]:focus,
.pq-field select:focus {
	outline: none;
	border-color: #0175d8;
	background: #fff;
}

.pq-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

.pq-generate-btn {
	appearance: none;
	border: none;
	cursor: pointer;
	width: 100%;
	padding: .8rem 1rem;
	border-radius: 999px;
	background: #0175d8;
	color: #fff;
	font-size: .92rem;
	font-weight: 700;
	box-shadow: 0 .5rem 1.1rem rgba(1, 117, 216, .28);
	transition: opacity .15s ease, transform .15s ease;
}

.pq-generate-btn:hover {
	opacity: .92;
	transform: translateY(-1px);
}

.pq-result {
	margin-top: 1.4rem;
	padding-top: 1.2rem;
	border-top: 1px dashed #dfe6ec;
}

.pq-result__label {
	font-size: .78rem;
	font-weight: 700;
	color: #0175d8;
	margin: 0 0 .4rem;
}

.pq-url-box {
	display: flex;
	align-items: center;
	gap: .6rem;
	background: #f4f8fb;
	border: 1px solid #dfe6ec;
	border-radius: .5rem;
	padding: .6rem .7rem;
	margin-bottom: .5rem;
}

.pq-url-output {
	flex: 1 1 auto;
	font-size: .78rem;
	color: #222;
	word-break: break-all;
	font-family: 'Courier New', monospace;
}

.pq-copy-btn {
	flex: 0 0 auto;
	appearance: none;
	border: 1px solid #0175d8;
	background: #fff;
	color: #0175d8;
	border-radius: .4rem;
	padding: .35rem .8rem;
	font-size: .76rem;
	font-weight: 700;
	cursor: pointer;
}

.pq-copy-btn:hover {
	background: #eaf4ff;
}

.pq-copy-state {
	display: block;
	min-height: 1.2em;
	font-size: .74rem;
	color: #0175d8;
	margin-bottom: .8rem;
}

.pq-hint {
	font-size: .8rem;
	line-height: 1.8;
	color: #55606c;
	background: #eaf4ff;
	border-radius: .5rem;
	padding: .6rem .8rem;
	margin: 0 0 1rem;
}

.pq-qr-wrap {
	display: flex;
	justify-content: center;
	align-items: center;
	background: #fff;
	border: 1px solid #dfe6ec;
	border-radius: .6rem;
	padding: 1rem;
	min-height: 120px;
}

.pq-qr-wrap svg {
	max-width: 200px;
	height: auto;
}

.pq-qr-caption {
	text-align: center;
	font-size: .74rem;
	color: #8a8a8a;
	margin: .5rem 0 0;
}

/* ---------- レスポンシブ ---------- */

@media screen and (max-width: 640px) {

	#needs-diagnosis-demo,
	#param-qr-demo {
		padding: 1rem .8rem 1.8rem;
		border-radius: .7rem;
	}

	.ndg-panel,
	.ndg-result,
	.pq-panel {
		padding: 1.1rem .9rem 1rem;
		border-radius: .7rem;
	}

	.ndg-question__options,
	.ndg-question__head,
	.ndg-nav,
	.ndg-result__block {
		width: 100%;
	}

	.pq-row {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.ndg-badge,
	.pq-badge {
		padding: .45rem 1.2rem;
		font-size: 1.1rem;
		white-space: normal;
		text-align: center;
	}

}
