/*
 * stripe_webhook_flow_demo.css
 * アプリに決済機能を実装する｜スポット決済とサブスク決済でのWebhook到着タイミングの体験デモ
 * 実際の通信は発生させず、決済完了とWebhook受信のタイムラグをタイムライン＋コード表示で疑似再現する。
 * 既存サイトのクラスと衝突しないよう swf- を接頭辞にしています。
 */

#swf-demo {
	box-sizing: border-box;
	margin: 1.4rem 0;
	padding: 1rem 1.1rem 2.2rem;
	background: #f1f0fb;
	border-radius: 1rem;
	scroll-margin-top: 90px;
}

#swf-demo *,
#swf-demo *::before,
#swf-demo *::after {
	box-sizing: border-box;
}

.swf-container {
	max-width: 720px;
	margin: 0 auto;
}

.swf-head {
	text-align: center;
	padding-top: 1.6rem;
	margin-bottom: 1.4rem;
}

.swf-badge {
	display: inline-block;
	padding: .6rem 2rem;
	border-radius: 999px;
	background: #635bff;
	color: #fff;
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: .04em;
	margin-bottom: .6rem;
}

h3.swf-headline {
	display: block;
	background: none;
	margin: .7rem auto 0;
	max-width: 34rem;
	font-size: 1.24rem;
	font-weight: 800;
	line-height: 1.6;
	color: #12233f;
}

.swf-headline__mark {
	color: #635bff;
}

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

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

.swf-toggle {
	display: flex;
	gap: .5rem;
	margin-bottom: 1rem;
}

.swf-toggle-btn {
	flex: 1;
	appearance: none;
	border: .1rem solid #d8d5f5;
	background: #fff;
	color: #556;
	padding: .6rem .5rem;
	border-radius: .7rem;
	font-size: .8rem;
	font-weight: 700;
	cursor: pointer;
}

.swf-toggle-btn.is-active {
	background: #635bff;
	border-color: #635bff;
	color: #fff;
}

.swf-submit-btn {
	appearance: none;
	border: none;
	cursor: pointer;
	width: 100%;
	padding: .8rem .6rem;
	border-radius: .7rem;
	font-size: .92rem;
	font-weight: 800;
	color: #fff;
	background: #12233f;
	margin-bottom: 1.2rem;
}

.swf-submit-btn:disabled {
	opacity: .55;
	cursor: not-allowed;
}

.swf-timeline {
	list-style: none;
	margin: 0 0 1rem;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: .1rem;
}

.swf-step {
	display: flex;
	align-items: flex-start;
	gap: .7rem;
	padding: .6rem .2rem;
	position: relative;
	opacity: .45;
	transition: opacity .3s ease;
}

.swf-step::before {
	content: "";
	position: absolute;
	left: .42rem;
	top: 1.6rem;
	bottom: -.4rem;
	width: .12rem;
	background: #e2e0f5;
}

.swf-step:last-child::before {
	display: none;
}

.swf-step__dot {
	flex-shrink: 0;
	width: 1rem;
	height: 1rem;
	border-radius: 50%;
	background: #d8d5f5;
	margin-top: .15rem;
	position: relative;
	z-index: 1;
	transition: background .25s ease, transform .25s ease;
}

.swf-step__body {
	display: flex;
	flex-direction: column;
	gap: .1rem;
}

.swf-step__title {
	font-size: .86rem;
	font-weight: 800;
	color: #445;
}

.swf-step__desc {
	font-size: .74rem;
	color: #778;
	line-height: 1.6;
}

.swf-step.is-done {
	opacity: 1;
}

.swf-step.is-done .swf-step__dot {
	background: #1f9e5c;
}

.swf-step.is-done .swf-step__title {
	color: #0d7a33;
}

.swf-step.is-active {
	opacity: 1;
}

.swf-step.is-active .swf-step__dot {
	background: #e08a1f;
	animation: swf-pulse 1s ease-in-out infinite;
}

.swf-step.is-active .swf-step__title {
	color: #a1671c;
}

@keyframes swf-pulse {
	0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(224, 138, 31, .45); }
	70% { transform: scale(1.15); box-shadow: 0 0 0 .4rem rgba(224, 138, 31, 0); }
	100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(224, 138, 31, 0); }
}

.swf-app-status {
	display: flex;
	align-items: center;
	gap: .5rem;
	padding: .8rem 1rem;
	border-radius: .7rem;
	background: #fff1f1;
	border-left: .25rem solid #c0473f;
	margin-bottom: 1rem;
	font-size: .84rem;
	font-weight: 700;
	color: #a1352e;
	transition: background .3s ease, color .3s ease, border-color .3s ease;
}

.swf-app-status.is-unlocked {
	background: #f2fbf4;
	border-left-color: #1f9e5c;
	color: #0d7a33;
}

.swf-app-status__icon {
	font-size: 1.1rem;
}

.swf-code-wrap {
	background: #12233f;
	border-radius: .8rem;
	padding: .9rem 1rem 1rem;
	margin-bottom: 1rem;
}

.swf-code-label {
	font-size: .68rem;
	font-weight: 700;
	color: #9aa8c9;
	letter-spacing: .04em;
	margin-bottom: .5rem;
}

.swf-code {
	margin: 0;
	font-family: 'Courier New', monospace;
	font-size: .74rem;
	line-height: 1.7;
	color: #d6e0ff;
	white-space: pre-wrap;
	word-break: break-word;
}

.swf-reset-btn {
	appearance: none;
	border: none;
	cursor: pointer;
	display: block;
	margin: 0 auto;
	padding: .5rem 1.2rem;
	border-radius: 999px;
	background: #eef2f5;
	color: #667;
	font-size: .78rem;
	font-weight: 700;
}

.swf-reset-btn:hover {
	background: #e2e8ed;
}

@media screen and (max-width: 640px) {
	#swf-demo { padding: 1rem .8rem 1.8rem; border-radius: .7rem; }
	.swf-panel { padding: 1.1rem .9rem 1rem; border-radius: .7rem; }
	.swf-badge { padding: .45rem 1.2rem; font-size: .92rem; white-space: normal; text-align: center; }
	.swf-code { font-size: .68rem; }
}
