/*
 * tenant_leak_demo.css
 * マルチテナントSaaSアーキテクチャとは｜tenant_id条件を書き忘れる体験デモ
 * 実際の通信・データは扱わず、分離方式ごとに同じミスの結果がどう変わるかを再現する。
 * 既存サイトのクラスと衝突しないよう tld- を接頭辞にしています。
 */

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

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

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

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

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

h3.tld-headline {
	display: block;
	background: none;
	margin: .7rem auto 0;
	max-width: 36rem;
	font-size: 1.15rem;
	font-weight: 800;
	line-height: 1.65;
	color: #12233f;
}

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

.tld-lead {
	font-size: .82rem;
	color: #555;
	line-height: 1.85;
	margin: .6rem auto 0;
	max-width: 36rem;
}

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

.tld-archs {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: .5rem;
	margin-bottom: 1.1rem;
}

.tld-arch-btn {
	appearance: none;
	cursor: pointer;
	border: .1rem solid #d8d5f5;
	background: #fff;
	color: #445;
	padding: .6rem .4rem;
	border-radius: .7rem;
	font-size: .78rem;
	font-weight: 700;
	line-height: 1.5;
	text-align: center;
}

.tld-arch-btn__sub {
	display: inline-block;
	margin-top: .15rem;
	font-size: .62rem;
	font-weight: 500;
	color: #889;
}

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

.tld-arch-btn.is-active .tld-arch-btn__sub {
	color: #e3e1ff;
}

.tld-mockapp {
	border: .1rem solid #e5e3f7;
	border-radius: .9rem;
	overflow: hidden;
}

.tld-mockapp__bar {
	display: flex;
	align-items: center;
	gap: .35rem;
	padding: .55rem .7rem;
	background: #f4f3ff;
	border-bottom: .08rem solid #e5e3f7;
}

.tld-mockapp__dot {
	width: .5rem;
	height: .5rem;
	border-radius: 50%;
	background: #d8d5f5;
}

.tld-mockapp__title {
	margin-left: .4rem;
	font-size: .7rem;
	font-weight: 700;
	color: #778;
}

.tld-mockapp__body {
	padding: 1.1rem .9rem 1.2rem;
}

.tld-bug-toggle {
	display: flex;
	align-items: center;
	gap: .5rem;
	padding: .7rem .8rem;
	border-radius: .7rem;
	background: #fff8ec;
	border: .08rem solid #efd8a1;
	font-size: .78rem;
	font-weight: 700;
	color: #8a611c;
	margin-bottom: .9rem;
	cursor: pointer;
}

.tld-bug-toggle input {
	width: 1.05rem;
	height: 1.05rem;
	accent-color: #b5811f;
	flex-shrink: 0;
}

.tld-run-btn {
	appearance: none;
	cursor: pointer;
	border: none;
	width: 100%;
	padding: .75rem .6rem;
	border-radius: .7rem;
	font-size: .88rem;
	font-weight: 800;
	color: #fff;
	background: #12233f;
	margin-bottom: 1.1rem;
}

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

.tld-code-label {
	font-size: .64rem;
	font-weight: 700;
	color: #9aa8c9;
	letter-spacing: .03em;
	margin-bottom: .4rem;
}

.tld-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;
}

.tld-result-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 1rem;
	font-size: .78rem;
}

.tld-result-table th,
.tld-result-table td {
	border: .06rem solid #e5e3f7;
	padding: .5rem .6rem;
	text-align: left;
}

.tld-result-table th {
	background: #f4f3ff;
	font-weight: 700;
	color: #445;
}

.tld-result-table tr.tld-row--own td {
	background: #fff;
	color: #334;
}

.tld-result-table tr.tld-row--leaked td {
	background: #fff1f1;
	color: #a1352e;
	font-weight: 700;
}

.tld-outcome {
	padding: .8rem .9rem;
	border-radius: .7rem;
	font-size: .8rem;
	font-weight: 700;
	line-height: 1.7;
}

.tld-outcome.is-safe {
	background: #f2fbf4;
	border: .08rem solid #bfe8cd;
	color: #0d7a33;
}

.tld-outcome.is-leak {
	background: #fff1f1;
	border: .08rem solid #f0c3bd;
	color: #a1352e;
	animation: tld-shake .4s ease;
}

@keyframes tld-shake {
	0% { transform: translateX(0); }
	20% { transform: translateX(-.35rem); }
	40% { transform: translateX(.35rem); }
	60% { transform: translateX(-.2rem); }
	80% { transform: translateX(.2rem); }
	100% { transform: translateX(0); }
}

@media screen and (max-width: 640px) {
	#tld-demo { padding: 1rem .8rem 1.8rem; border-radius: .7rem; }
	.tld-panel { padding: 1.1rem .9rem 1rem; border-radius: .7rem; }
	.tld-archs { grid-template-columns: 1fr; }
	.tld-badge { font-size: .8rem; padding: .5rem 1.1rem; }
	h3.tld-headline { font-size: 1.05rem; }
	.tld-result-table { font-size: .7rem; }
}
