/*
 * session_management_demo.css
 * セッション管理の基本｜体験デモ（セッションID再生成の有無・モーダルでのログイン体験）
 * 既存サイトのクラスと衝突しないよう sess- を接頭辞にしています。
 */

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

#sess-demo *,
#sess-demo *::before,
#sess-demo *::after,
.sess-modal-backdrop *,
.sess-modal-backdrop *::before,
.sess-modal-backdrop *::after {
	box-sizing: border-box;
}

.sess-container {
	max-width: 660px;
	margin: 0 auto;
}

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

.sess-badge {
	display: inline-block;
	padding: .6rem 2rem;
	border-radius: 999px;
	background: #6a3f8f;
	color: #fff;
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: .06em;
	margin-bottom: .6rem;
	box-shadow: 0 0 0 0 rgba(106, 63, 143, .45);
	animation: sess-badge-pulse 2.2s ease-out infinite;
}

@keyframes sess-badge-pulse {
	0% { box-shadow: 0 0 0 0 rgba(106, 63, 143, .45); }
	70% { box-shadow: 0 0 0 .55rem rgba(106, 63, 143, 0); }
	100% { box-shadow: 0 0 0 0 rgba(106, 63, 143, 0); }
}

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

.sess-headline__mark {
	color: #6a3f8f;
}

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

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

.sess-mode-toggle {
	display: flex;
	gap: .5rem;
	margin-bottom: 1.1rem;
}

.sess-mode-btn {
	flex: 1;
	appearance: none;
	border: .1rem solid #e2d3ec;
	background: #fff;
	color: #556;
	padding: .55rem .4rem;
	border-radius: .7rem;
	font-size: .78rem;
	font-weight: 700;
	cursor: pointer;
}

.sess-mode-btn.is-active {
	background: #12233f;
	border-color: #12233f;
	color: #fff;
}

.sess-mode-btn--safe.is-active {
	background: #6a3f8f;
	border-color: #6a3f8f;
}

/* ---------- シナリオ導入（怪しいリンク） ---------- */

.sess-scenario {
	text-align: center;
	background: #f7f4fa;
	border-radius: .8rem;
	padding: 1rem .9rem;
	margin-bottom: 1rem;
}

.sess-scenario__text {
	font-size: .8rem;
	color: #556;
	margin: 0 0 .7rem;
}

.sess-fake-link {
	appearance: none;
	border: none;
	cursor: pointer;
	display: inline-block;
	padding: .7rem 1.3rem;
	border-radius: .7rem;
	font-size: .9rem;
	font-weight: 800;
	color: #fff;
	background: linear-gradient(90deg, #e08a1f, #e0473f);
	box-shadow: 0 .3rem .7rem rgba(224, 71, 63, .25);
	transition: transform .15s ease;
}

.sess-fake-link:hover {
	transform: translateY(-1px);
}

.sess-scenario__hint {
	font-size: .68rem;
	color: #999;
	margin: .6rem 0 0;
}

/* ---------- 結果エリア ---------- */

.sess-outcome {
	display: none;
}

.sess-outcome.is-visible {
	display: block;
	animation: sess-fade-in .3s ease;
}

@keyframes sess-fade-in {
	0% { opacity: 0; transform: translateY(-.4rem); }
	100% { opacity: 1; transform: translateY(0); }
}

.sess-id-row {
	display: flex;
	flex-direction: column;
	gap: .5rem;
	margin-bottom: .9rem;
}

.sess-id-box {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .6rem;
	background: #f7f4fa;
	border-radius: .6rem;
	padding: .6rem .8rem;
}

.sess-id-box__label {
	font-size: .74rem;
	color: #667;
}

.sess-id-box__value {
	font-family: 'Courier New', monospace;
	font-size: .84rem;
	font-weight: 700;
	color: #12233f;
}

.sess-arrow {
	text-align: center;
	font-size: 1.2rem;
	color: #999;
}

.sess-result {
	padding: .9rem 1rem;
	border-radius: .6rem;
	font-size: .84rem;
	font-weight: 700;
	line-height: 1.8;
	text-align: center;
	background: #f4f8fb;
	border-left: .25rem solid #cfd8e3;
	color: #445;
	margin-bottom: 1rem;
}

.sess-result.is-breach {
	background: #fff1f1;
	border-left-color: #c0473f;
	color: #a1352e;
}

.sess-result.is-blocked {
	background: #f2fbf4;
	border-left-color: #1f9e5c;
	color: #0d7a33;
}

/* ---------- 攻撃者パート ---------- */

.sess-attacker-section {
	border-top: .08rem dashed #e2d3ec;
	padding-top: 1rem;
}

.sess-attacker-note {
	font-size: .78rem;
	color: #556;
	line-height: 1.7;
	margin: .6rem 0 .8rem;
}

.sess-attacker-btn {
	appearance: none;
	border: none;
	cursor: pointer;
	display: block;
	width: 100%;
	padding: .65rem .5rem;
	border-radius: .7rem;
	font-size: .84rem;
	font-weight: 800;
	color: #fff;
	background: #c0473f;
	margin-bottom: .8rem;
}

.sess-attacker-btn:hover {
	opacity: .92;
}

.sess-attacker-btn:disabled {
	background: #ccc;
	cursor: not-allowed;
}

.sess-attacker-result {
	min-height: 1px;
}

.sess-attacker-mypage {
	border-radius: .6rem;
	padding: .8rem .9rem;
	font-size: .8rem;
	line-height: 1.8;
}

.sess-attacker-mypage.is-breach {
	background: #fff1f1;
	border: .1rem solid #f0b1b1;
	color: #a1352e;
}

.sess-attacker-mypage.is-blocked {
	background: #f2fbf4;
	border: .1rem solid #a8ddb5;
	color: #0d7a33;
}

.sess-attacker-mypage strong {
	display: block;
	font-size: .86rem;
	margin-bottom: .3rem;
}

/* ---------- 猫・リセット ---------- */

.sess-cat-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: .8rem;
	margin-top: 1.1rem;
}

.sess-clerk {
	width: 2.6rem;
	flex-shrink: 0;
	filter: drop-shadow(0 .2rem .3rem rgba(0, 30, 70, .15));
	transform-origin: 50% 100%;
}

.sess-clerk svg {
	width: 100%;
	height: auto;
	display: block;
}

.sess-clerk.is-legit {
	animation: sess-clerk-nod .4s ease;
}

.sess-clerk.is-blocked {
	animation: sess-clerk-shield .5s ease;
}

.sess-clerk.is-breach {
	animation: sess-clerk-shake-no .45s ease;
}

@keyframes sess-clerk-nod {
	0% { transform: translateY(0); }
	45% { transform: translateY(.3rem); }
	100% { transform: translateY(0); }
}

@keyframes sess-clerk-shield {
	0% { transform: scale(1) rotate(0); }
	30% { transform: scale(1.12) rotate(-4deg); }
	60% { transform: scale(1.12) rotate(4deg); }
	100% { transform: scale(1) rotate(0); }
}

@keyframes sess-clerk-shake-no {
	0% { transform: translateX(0); }
	20% { transform: translateX(-.4rem); }
	40% { transform: translateX(.4rem); }
	60% { transform: translateX(-.25rem); }
	80% { transform: translateX(.25rem); }
	100% { transform: translateX(0); }
}

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

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

/* ---------- モーダル（ブラウザ風） ---------- */

.sess-modal-backdrop {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(18, 24, 40, .55);
	z-index: 9999;
	align-items: center;
	justify-content: center;
	padding: 1.2rem;
}

.sess-modal-backdrop.is-open {
	display: flex;
	animation: sess-backdrop-in .2s ease;
}

@keyframes sess-backdrop-in {
	0% { opacity: 0; }
	100% { opacity: 1; }
}

.sess-modal {
	width: 100%;
	max-width: 420px;
	background: #fff;
	border-radius: .8rem;
	overflow: hidden;
	box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, .3);
	animation: sess-modal-in .25s ease;
}

@keyframes sess-modal-in {
	0% { opacity: 0; transform: translateY(.8rem) scale(.97); }
	100% { opacity: 1; transform: translateY(0) scale(1); }
}

.sess-browser-chrome {
	display: flex;
	align-items: center;
	gap: .4rem;
	background: #e9edf2;
	padding: .55rem .7rem;
	border-bottom: .06rem solid #d5dae2;
}

.sess-browser-chrome--small {
	border-radius: .5rem;
	border-bottom: none;
	margin-bottom: .5rem;
}

.sess-browser-dot {
	width: .5rem;
	height: .5rem;
	border-radius: 50%;
	background: #c7cdd6;
	flex-shrink: 0;
}

.sess-browser-url {
	flex: 1;
	background: #fff;
	border-radius: .3rem;
	padding: .25rem .55rem;
	font-family: 'Courier New', monospace;
	font-size: .68rem;
	color: #445;
	margin-left: .3rem;
	white-space: nowrap;
	overflow-x: auto;
}

.sess-modal-body {
	padding: 1rem 1.1rem 1.2rem;
}

.sess-modal-note {
	font-size: .78rem;
	color: #556;
	line-height: 1.7;
	margin: 0 0 .9rem;
}

.sess-login-form {
	background: #f7f8fc;
	border-radius: .5rem;
	padding: .6rem .7rem;
	display: flex;
	flex-direction: column;
	gap: .4rem;
	margin-bottom: .9rem;
}

.sess-login-field {
	display: flex;
	align-items: center;
	gap: .6rem;
	font-size: .8rem;
}

.sess-login-field span:first-child {
	width: 1.8rem;
	flex-shrink: 0;
	font-weight: 700;
	color: #889;
	font-size: .68rem;
}

.sess-login-field span:last-child {
	font-family: 'Courier New', monospace;
	color: #223;
}

.sess-modal-login-btn {
	appearance: none;
	border: none;
	cursor: pointer;
	display: block;
	width: 100%;
	padding: .65rem .5rem;
	border-radius: .6rem;
	font-size: .86rem;
	font-weight: 800;
	color: #fff;
	background: #0175d8;
}

.sess-modal-login-btn:hover {
	opacity: .92;
}

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