/* =========================================================================
   RDV des Collectivités Territoriales — feuille de style principale
   ========================================================================= */

:root {
	--green-900: #032a1f;
	--green-800: #0b3b2c;
	--green-600: #1b7a57;
	--green-500: #2a9a70;
	--green-400: #679482; /* éléments d'interface inactifs, bordures : ≥ 3:1 sur blanc et sur --surface */
	--green-300: #9fd3bc; /* décoratif uniquement */
	--green-200: #cfe8db;
	--green-100: #cbf7c6;
	--step-inactive: #3f7a62; /* texte : ≥ 4,5:1 sur --surface */
	--placeholder: #5f716a; /* ≥ 4,5:1 sur blanc */
	--surface: #eff8f3;
	--surface-2: #ffffff;
	--ink: #0b1a14;
	--ink-soft: #3f524a;
	--danger: #b42318;
	--focus: #0b3b2c;
	--radius: 4px;
	--font-body: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-script: "Covered By Your Grace", "Segoe Script", "Bradley Hand", cursive;
	--hero-pad: clamp(2rem, 6.5vw, 7.75rem);
	--panel-pad-x: clamp(1.5rem, 6.3vw, 7.5rem);
	--panel-pad-y: clamp(2.5rem, 8vw, 7rem);
}

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	font-family: var(--font-body);
	font-size: 1.125rem;
	line-height: 1.55;
	color: var(--ink);
	background: var(--surface);
	-webkit-font-smoothing: antialiased;
}

img {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--green-600);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
	outline: 3px solid var(--focus);
	outline-offset: 2px;
}

.hero a:focus-visible {
	outline-color: var(--green-100);
}

main:focus {
	outline: none;
}

fieldset {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

legend {
	padding: 0;
}

abbr.required {
	text-decoration: none;
	border: 0;
	color: var(--danger);
	font-weight: 700;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
}

.skip-link:focus {
	position: fixed;
	top: 1rem;
	left: 1rem;
	z-index: 1000;
	width: auto;
	height: auto;
	clip: auto;
	clip-path: none;
	padding: 0.75rem 1rem;
	background: #fff;
	color: var(--ink);
	border-radius: var(--radius);
	box-shadow: 0 4px 16px rgb(0 0 0 / 0.2);
}

/* -------------------------------------------------------------------------
   Structure en deux colonnes
   ---------------------------------------------------------------------- */

.site {
	display: grid;
	grid-template-columns: 1fr 1fr;
	min-height: 100vh;
	min-height: 100dvh;
}

/* -------------------------------------------------------------------------
   Colonne gauche : présentation
   ---------------------------------------------------------------------- */

.hero {
	position: sticky;
	top: 0;
	display: flex;
	align-items: center;
	height: 100vh;
	height: 100dvh;
	padding: var(--hero-pad);
	background: var(--green-900);
	color: #fff;
}

.admin-bar .hero {
	top: 32px;
	height: calc(100vh - 32px);
	height: calc(100dvh - 32px);
}

.hero__inner {
	width: 100%;
	max-width: 46rem;
}

/* Logo défini dans « Identité du site » */

.hero__logo .custom-logo-link {
	display: inline-block;
	line-height: 0;
}

.hero__logo img {
	display: block;
	width: auto;
	max-width: min(100%, 34rem);
	height: auto;
	max-height: clamp(10rem, 26vw, 16rem);
}

@media (min-width: 1201px) {
	.hero__logo .custom-logo-link {
		display: block;
		width: 80%;
	}

	.hero__logo img {
		width: 100%;
		max-width: none;
		max-height: none;
	}
}

/* Repli si aucun logo n'est défini */

.hero__name {
	margin: 0;
	font-size: clamp(2.25rem, 4vw, 3.5rem);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.01em;
}

.hero__name a {
	color: inherit;
	text-decoration: none;
}

.hero__text {
	margin-top: clamp(2rem, 4vw, 3.5rem);
	font-size: clamp(1.0625rem, 1.25vw, 1.3125rem);
	line-height: 1.55;
	max-width: 44rem;
}

.hero__text p {
	margin: 0 0 1em;
}

.hero__text p:last-child {
	margin-bottom: 0;
}

.hero__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin: clamp(2rem, 4vw, 3.5rem) 0 0;
	padding: 0;
	list-style: none;
}

.pill dd {
	margin: 0;
}

.pill {
	display: inline-flex;
	align-items: center;
	padding: 0.45rem 1rem;
	border: 1.5px solid var(--green-100);
	border-radius: 999px;
	color: var(--green-100);
	font-size: clamp(1rem, 1.15vw, 1.25rem);
	line-height: 1.3;
	white-space: nowrap;
}

/* -------------------------------------------------------------------------
   Colonne droite : formulaire / contenu
   ---------------------------------------------------------------------- */

.panel {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	padding: var(--panel-pad-y) var(--panel-pad-x) 2.75rem;
	background: var(--surface);
}

.panel__inner {
	flex: 1 0 auto;
}

.panel__title {
	margin: 0 0 2.75rem;
	font-size: clamp(1.75rem, 2.4vw, 2.5rem);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.panel__footer {
	margin-top: 4rem;
	font-size: 1.0625rem;
}

.panel__footer .legal-nav{
	border-top: 1px solid var(--green-200);
    padding-top: 16px;
}

.legal-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.legal-links li {
	display: inline-flex;
	align-items: center;
}

.legal-links li + li::before {
	content: "•";
	margin-right: 0.5rem;
	color: var(--ink);
	font-size: 0.7em;
}

.legal-links a {
	color: var(--ink);
	text-decoration: none;
}

.legal-links a:hover,
.legal-links a:focus-visible {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.back-link {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin-bottom: 1.5rem;
	font-size: 1rem;
	font-weight: 500;
	text-decoration: none;
}

.back-link:hover {
	text-decoration: underline;
}

/* Contenu éditorial (pages légales) */

.content {
	max-width: 44rem;
	font-size: 1.0625rem;
}

.content > * + * {
	margin-top: 1.25em;
}

.content h2,
.content h3,
.content h4 {
	margin-bottom: 0.5em;
	line-height: 1.25;
}

.content h2 {
	font-size: 1.5rem;
}

.content h3 {
	font-size: 1.25rem;
}

.content ul,
.content ol {
	padding-left: 1.4em;
}

/* -------------------------------------------------------------------------
   Indicateur d'étapes
   ---------------------------------------------------------------------- */

.steps {
	position: relative;
	margin: 0 0 clamp(3rem, 6vw, 6rem);
}

.steps__list {
	display: flex;
	gap: 32px;
	margin: 0;
	padding: 0 calc(100% / 6);
	list-style: none;
}

.steps__item {
	position: relative;
	z-index: 1;
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	gap: 0.35rem;
}

.steps__label {
	font-family: var(--font-script);
	font-weight: 400;
	font-size: 1.5rem;
	line-height: 1;
	color: var(--green-300);
	transition: color 0.25s;
}

.steps__dot {
	width: 0.75rem;
	height: 0.75rem;
	border-radius: 50%;
	background: var(--green-300);
	transition: background 0.25s, box-shadow 0.25s;
}

.steps__item.is-active .steps__label,
.steps__item.is-done .steps__label {
	color: var(--green-600);
}

/* Étape en cours :  anneau, pour ne pas reposer sur la seule couleur */
.steps__item.is-active .steps__dot,
.steps__item.is-done .steps__dot {
	background: var(--green-600);
}

.steps__item.is-active .steps__dot {
	box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--green-600);
}

.steps__track {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0.3rem;
	height: 2px;
	background: var(--green-300);
}

.steps__fill {
	display: block;
	width: var(--progress, 33.33%);
	height: 100%;
	background: var(--green-600);
	transition: width 0.35s ease;
}

/* -------------------------------------------------------------------------
   Formulaire
   ---------------------------------------------------------------------- */

.register {
	max-width: 46rem;
}

.step {
	display: none;
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.step.is-active {
	display: block;
	animation: step-in 0.3s ease;
}

@keyframes step-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

.field {
	margin-bottom: 1.5rem;
}

.field__label {
	display: block;
	margin: 0 0 0.75rem;
	font-size: 0.9375rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--ink);
}

.field__label em {
	font-style: normal;
	font-weight: 400;
	text-transform: none;
	letter-spacing: 0;
	color: var(--ink-soft);
}

.field__label--block {
	margin-bottom: 0.5rem;
}

.field__note {
	margin: 0 0 1.25rem;
	font-size: 0.9375rem;
	color: var(--ink-soft);
}

.field--check .field__note {
	margin: 0.5rem 0 0 2rem;
}

input[type="text"],
input[type="email"],
select,
textarea {
	display: block;
	width: 100%;
	padding: 0.95rem 1rem;
	font: inherit;
	font-size: 1.125rem;
	color: var(--ink);
	background: var(--surface-2);
	border: 1px solid var(--green-400);
	border-radius: var(--radius);
	box-shadow: 0 1px 2px rgb(3 42 31 / 0.05);
	transition: border-color 0.2s, box-shadow 0.2s;
	appearance: none;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	border-color: var(--green-600);
}

input::placeholder {
	color: var(--placeholder);
	opacity: 1;
}

.select {
	position: relative;
}

.select select {
	padding-right: 3rem;
	cursor: pointer;
}

.select::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 1.1rem;
	width: 0.6rem;
	height: 0.6rem;
	border-right: 2px solid var(--green-600);
	border-bottom: 2px solid var(--green-600);
	transform: translateY(-70%) rotate(45deg);
	pointer-events: none;
}

.field.has-error input,
.field.has-error select {
	border-color: var(--danger);
	border-width: 2px;
}

.field__error {
	display: none;
	margin: 0.5rem 0 0;
	font-size: 0.9375rem;
	color: var(--danger);
}

.field__error:not(:empty) {
	display: block;
}

.form-alert {
	margin: 0 0 1.5rem;
	padding: 0.9rem 1rem;
	border-left: 3px solid var(--danger);
	background: #fdf1ef;
	color: #7d2418;
	border-radius: var(--radius);
	font-size: 1rem;
}

.notice {
	padding: 1rem 1.25rem;
	border-left: 3px solid var(--green-600);
	background: #fff;
	border-radius: var(--radius);
}

.notice p:last-child {
	margin-bottom: 0;
}

/* Boutons */

.actions {
	display: flex;
	justify-content: flex-end;
	gap: 1rem;
	margin-top: clamp(2.5rem, 5vw, 5rem);
}

.actions--split {
	justify-content: space-between;
}

.btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.85rem 1.25rem;
	font: inherit;
	font-size: 1.125rem;
	font-weight: 500;
	line-height: 1.2;
	border: 1.5px solid transparent;
	border-radius: var(--radius);
	cursor: pointer;
	transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.1s;
}

.btn:active {
	transform: translateY(1px);
}

.btn:focus-visible {
	outline: 3px solid var(--focus);
	outline-offset: 2px;
}

.btn--primary {
	background: var(--green-600);
	color: #fff;
}

.btn--primary:hover {
	background: var(--green-800);
}

.btn--primary[disabled] {
	opacity: 0.65;
	cursor: wait;
}

.btn--ghost {
	background: transparent;
	color: var(--green-600);
	border-color: var(--green-600);
}

.btn--ghost:hover {
	background: rgb(27 122 87 / 0.08);
}

.btn--add {
	width: 100%;
	justify-content: center;
	margin: 0.25rem 0 2rem;
	border-style: dashed;
}

.btn--add[disabled] {
	opacity: 0.45;
	cursor: not-allowed;
}

.btn--add[disabled] + .field__hint {
	margin-top: -1.5rem;
}

.field__hint {
	margin: -1.25rem 0 2rem;
	font-size: 0.9375rem;
	color: var(--ink-soft);
}

.field__hint.is-reached {
	color: var(--green-600);
	font-weight: 500;
}

/* Participants */

.participants {
	display: grid;
	gap: 1.25rem;
	margin-bottom: 1.25rem;
}

.participant {
	position: relative;
	padding: 1.25rem 1.25rem 0;
	background: #fff;
	border: 1px solid var(--green-400);
	border-radius: 6px;
	animation: step-in 0.25s ease;
}

/* Le float sort la légende de la bordure du fieldset pour qu'elle se comporte comme un titre ordinaire */
.participant__index {
	float: left;
	width: calc(100% - 3rem);
	margin-bottom: 1rem;
	font-family: var(--font-script);
	font-weight: 400;
	font-size: 1.5rem;
	color: var(--green-600);
}

.participant__remove {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	font-size: 1.5rem;
	line-height: 1;
	color: var(--ink-soft);
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.participant__remove:hover {
	background: var(--surface);
	color: var(--danger);
}

.participant:only-child .participant__remove {
	visibility: hidden;
}

.participant__grid {
	clear: both;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 1.25rem;
}

.participant__grid .field__label {
	font-size: 0.8125rem;
}

.participant__grid input {
	padding: 0.75rem 0.9rem;
	font-size: 1.0625rem;
}

/* Consentement */

.field--check {
	margin-top: 0.5rem;
}

.check {
	display: flex;
	gap: 0.75rem;
	align-items: flex-start;
	font-size: 1rem;
	line-height: 1.5;
	cursor: pointer;
}

.check input {
	flex: 0 0 auto;
	width: 1.25rem;
	height: 1.25rem;
	margin: 0.15rem 0 0;
	accent-color: var(--green-600);
}

.field--check.has-error .check input {
	outline: 2px solid var(--danger);
	outline-offset: 2px;
}

.hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Confirmation */

.success {
	padding: 2rem;
	background: #fff;
	border: 1px solid var(--green-200);
	border-radius: 6px;
}

.success__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 3.5rem;
	height: 3.5rem;
	margin-bottom: 1.25rem;
	color: var(--green-900);
	background: var(--green-100);
	border-radius: 50%;
}

.success__title {
	margin: 0 0 0.75rem;
	font-size: 1.5rem;
}

.success__text p {
	margin: 0 0 1em;
}

.success__text p:last-child {
	margin-bottom: 0;
}

/* -------------------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------------- */

@media (max-width: 900px) {
	.site {
		grid-template-columns: 1fr;
	}

	.hero {
		position: static;
		height: auto;
		padding: clamp(5rem, 8vw, 4rem) var(--hero-pad);
	}

	.hero__logo img {
		max-height: clamp(7rem, 30vw, 11rem);
	}

	.panel {
		min-height: 0;
		padding-top: clamp(5rem, 8vw, 4rem);
	}

	.steps {
		padding: 0 10%;
	}

	.pill {
		white-space: normal;
	}
}

@media (max-width: 560px) {
	.participant__grid {
		grid-template-columns: 1fr;
	}

	.actions,
	.actions--split {
		flex-direction: column-reverse;
	}

	.actions .btn {
		justify-content: center;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation: none !important;
		transition: none !important;
	}
}
