:root {
	--text: #1f2430;
	--text-soft: #6b7280;
	--border: #e4e7ec;
	--card: #ffffff;
	--blue: #2563eb;
	--green: #16a34a;
	--orange: #ea580c;
	--red: #dc2626;
	--radius: 16px;
	--radius-sm: 10px;
	--shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 4px 16px rgba(16, 24, 40, 0.04);
	--font:
		-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
		sans-serif;
	--background-color: rgba(197, 238, 249, 0.698);
	--accent: #529bbd;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: var(--font);
	color: var(--text);
	background: var(--background-color);
	background-attachment: fixed;
	min-height: 100vh;
	line-height: 1.55;
}

header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 32px;
	background: rgba(255, 255, 255, 0.75);
	border-bottom: 1px solid var(--border);
}
.btn-back-accueil {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 18px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: #fff;
	color: var(--text);
	font-weight: 600;
	text-decoration: none;
	transition: 0.15s ease;
}
.btn-back-accueil:hover {
	box-shadow: var(--shadow);
}

.profil {
	display: flex;
	align-items: center;
	gap: 12px;
}
.profil-photo {
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: #e6eef9;
	display: grid;
	place-items: center;
	overflow: hidden;
}
.profil-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.profil-info {
	line-height: 1.2;
	text-align: right;
}
.profil-nom {
	font-weight: 700;
	font-size: 1.1rem;
}
.profil-ville {
	font-size: 0.9rem;
	color: var(--text-soft);
}

.scenario {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	padding: 18px 32px 12px;
	background: rgba(255, 255, 255, 0.55);
	border-bottom: 1px solid var(--border);
}
.scenario-optimiste {
	--s: var(--green);
}
.scenario-median {
	--s: var(--orange);
}
.scenario-pessimiste {
	--s: var(--red);
}

.scenario-optimiste,
.scenario-median,
.scenario-pessimiste {
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 12px;
	border-radius: 12px;
	text-decoration: none;
	border: 2px solid color-mix(in srgb, var(--s) 35%, var(--border));
	background: color-mix(in srgb, var(--s) 9%, #fff);
	color: var(--s);
	transition: 0.15s ease;
}
.scenario-optimiste:hover,
.scenario-median:hover,
.scenario-pessimiste:hover {
	transform: translateY(-1px);
}

.scenario-optimiste.is-active,
.scenario-median.is-active,
.scenario-pessimiste.is-active {
	background: var(--s);
	border-color: var(--s);
	color: #fff;
	box-shadow: 0 6px 16px color-mix(in srgb, var(--s) 35%, transparent);
}

.scenario-titre {
	font-weight: 700;
	font-size: 1rem;
}
.scenario-temps {
	font-size: 0.9rem;
}

.scenario-info {
	flex-basis: 100%;
	text-align: center;
	color: var(--text-soft);
	font-size: 0.9rem;
	margin: 8px 0 0;
}

.layout {
	display: grid;
	grid-template-columns: 340px 1fr;
	gap: 40px;
	max-width: 1180px;
	margin: 0 auto;
	padding: 32px;
}

/* ===== Timeline ===== */
.timeline-title {
	font-size: 1.25rem;
	margin: 0 0 20px;
}
.timeline-liste {
	list-style: none;
	margin: 0;
	padding: 0;
}

.step {
	position: relative;
	padding-left: 36px;
	padding-bottom: 18px;
}
.step::before {
	content: "";
	position: absolute;
	left: 7px;
	top: 14px;
	bottom: -4px;
	width: 2px;
	background: #d6dde6;
}
.step:last-child::before {
	display: none;
}

.step-dot {
	position: absolute;
	left: 0;
	top: 10px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid #cbd5e1;
}
.step.is-active .step-dot {
	background: var(--blue);
	border-color: var(--blue);
}

.step-card {
	display: block;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 14px;
	padding: 16px;
	text-decoration: none;
	color: var(--text);
	box-shadow: var(--shadow);
	transition: 0.15s ease;
}
.step-card:hover {
	transform: translateY(-1px);
	border-color: #c9d4e3;
}
.step.is-active .step-card {
	border: 2px solid var(--blue);
}

.step-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.step-name {
	font-weight: 600;
	font-size: 1rem;
}
.step-meta {
	display: block;
	color: var(--text-soft);
	font-size: 0.9rem;
	margin-top: 4px;
}

/* ===== Badges ===== */
.badge {
	font-size: 0.8rem;
	font-weight: 700;
	padding: 5px 12px;
	border-radius: 999px;
	color: #fff;
	white-space: nowrap;
}
.badge-current {
	background: var(--blue);
}
.badge-rcp {
	background: var(--orange);
} /* peut être lié au scénario choisi */

/* ===== Récit ===== */
.story {
	display: block;
}
.card {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.story-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	padding: 22px 26px;
	margin-bottom: 20px;
}
.story-title {
	margin: 0;
	font-size: 1.5rem;
}
.story-sub {
	margin: 6px 0 0;
	color: var(--text-soft);
}

.story-figure {
	position: relative;
	margin: 0 0 20px;
}
.illustration {
	width: 100%;
	height: auto;
	display: block;
	border-radius: var(--radius);
	border: 1px solid var(--border);
}
.figure-tag {
	position: absolute;
	top: 18px;
	left: 24px;
	color: #fff;
	font-size: 1.4rem;
	line-height: 1.1;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.figure-tag strong {
	font-size: 1.9rem;
}

.story-text {
	padding: 26px 30px;
}
.story-text p {
	margin: 0 0 18px;
	font-size: 1rem;
}
.story-text p:last-child {
	margin-bottom: 0;
}

/* ===== Navigation bas ===== */
.story-nav {
	display: flex;
	justify-content: space-between;
	margin-top: 24px;
}
.btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 22px;
	border-radius: var(--radius-sm);
	font-weight: 600;
	text-decoration: none;
	border: 1px solid var(--border);
	background: #fff;
	color: var(--text);
	cursor: pointer;
	transition: 0.15s ease;
}
.btn:hover {
	box-shadow: var(--shadow);
	transform: translateY(-1px);
}
.btn-prev {
	color: var(--text-soft);
}
.btn-next {
	background: var(--accent);
	color: #fff;
	border: none;
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* ===== Responsive ===== */
@media (max-width: 880px) {
	.layout {
		grid-template-columns: 1fr;
		gap: 28px;
	}
	.scenario-optimiste,
	.scenario-median,
	.scenario-pessimiste {
		flex-basis: 100%;
	}

	.scenario-label {
		font-weight: 600;
		color: var(--text-soft);
		white-space: nowrap;
	}

	/* étapes déjà franchies : pastille verte */
	.step.done .step-dot {
		background: var(--green);
		border-color: var(--green);
	}
}

/* ===== Impacts ===== */
.impacts-titre {
	font-size: 1.05rem;
	margin: 28px 0 14px;
}
.impacts-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}
.impact-card {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	padding: 16px;
	box-shadow: var(--shadow);
}
.impact-picto {
	width: 36px;
	height: 36px;
	object-fit: contain;
	flex: none;
}
.impact-name {
	font-weight: 600;
}
.impact-desc {
	color: var(--text-soft);
	font-size: 0.9rem;
}

/* ===== Fin du parcours ===== */
.story-end-wrap {
	max-width: 1180px;
	margin: 0 auto;
	padding: 0 32px 56px;
}
.story-end {
	max-width: 840px;
	margin: 24px auto 0;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 32px;
	text-align: center;
}
.checkmark {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	display: grid;
	place-items: center;
	margin: 0 auto 16px;
	color: #fff;
	font-size: 1.8rem;
	background: var(--accent);
}
.story-end h3 {
	margin: 0 0 10px;
}
.story-end > p {
	color: var(--text-soft);
	max-width: 560px;
	margin: 0 auto 20px;
}
.sources-box {
	text-align: left;
	background: #eff6ff;
	border: 1px solid #dbeafe;
	border-radius: var(--radius-sm);
	padding: 16px;
	margin-bottom: 20px;
	font-size: 0.9rem;
}
.sources-box strong {
	display: block;
	margin-bottom: 6px;
}
.sources-box a {
	color: var(--blue);
}
.btn-block {
	display: block;
	width: 100%;
	padding: 14px;
	border-radius: var(--radius-sm);
	background: var(--accent);
	color: #fff;
	font-weight: 600;
	text-decoration: none;
	text-align: center;
	margin-bottom: 10px;
}

.btn-back-accueil {
	display: inline-flex;
	width: auto;
	align-items: center;
	padding: 10px 18px;
	gap: 8px;
	border-radius: var(--radius-sm);
	background: #fff;
	border: 1px solid var(--border);
	color: var(--text);
	font-weight: 600;
	text-decoration: none;
	text-align: center;
}
