/* ==========================================================================
   BASE
   ========================================================================== */
body { overflow-x: clip; }

/* Liens ne contenant qu'une icône SVG : supprime l'espace fantôme sous l'icône */
a:has(> svg:only-child) { line-height: 0; }

/* Focus clavier visible et uniforme (contraste 3:1 minimum) */
body.bricks-is-frontend :focus-visible {
	outline: 2px solid var(--brand-600) !important;
	outline-offset: 2px;
	transition: none !important;
}

/* Ancres : laisse la place du header au-dessus de la section ciblée */
[id] { scroll-margin-top: calc(var(--navbar-height) + 1rem); }

/* ==========================================================================
   POPUPS BRICKS (fondu du fond + zoom depuis le centre)
   ========================================================================== */
.brx-popup-backdrop {
	transition: opacity .2s var(--ease-out), background-color .2s var(--ease-out) !important;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.brx-popup:not(.hide) .brx-popup-backdrop {
	animation: lumPopupFade .2s var(--ease-out) both;
}

.brx-popup:not(.hide) .brx-popup-content {
	transform-origin: center center;
	animation: lumPopupIn .22s var(--ease-out) both;
}

@keyframes lumPopupFade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes lumPopupIn {
	from { opacity: 0; transform: scale(.95); }
	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.brx-popup:not(.hide) .brx-popup-content,
	.brx-popup:not(.hide) .brx-popup-backdrop { animation: none; }
}

/* Hauteur visible réelle (barres de Safari et Chrome mobiles déduites) */
html body .brx-popup {
	top: 0;
	bottom: auto;
	height: 100vh;
	height: 100dvh;
}

html body .brx-popup-content > [id^="popup-"] {
	max-height: calc(100vh - 4rem);
	max-height: calc(100dvh - 4rem);
}

@media (max-width: 767px) {
	html body .brx-popup { padding-top: 1rem; padding-bottom: 1rem; }
	html body .brx-popup-content > [id^="popup-"] {
		max-height: calc(100vh - 2rem);
		max-height: calc(100dvh - 2rem);
		border-radius: 1.5rem;
	}
}

/* Bouton de fermeture (croix en haut à droite) */
.popup-close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background-color: transparent;
	color: var(--neutral-400);
	cursor: pointer;
	transition: background-color .2s var(--ease-out), color .2s var(--ease-out);
}

.popup-close::before,
.popup-close::after {
	content: "";
	position: absolute;
	width: 1rem;
	height: 1.5px;
	border-radius: 2px;
	background-color: currentColor;
}

.popup-close::before { transform: rotate(45deg); }
.popup-close::after { transform: rotate(-45deg); }

@media (hover: hover) {
	.popup-close:hover {
		background-color: var(--neutral-100);
		color: var(--neutral-600);
	}
}

/* Pied des formulaires : Annuler et Envoyer côte à côte (maquette) */
html body .brx-popup form .form-group:has(.popup-cancel),
html body .brx-popup form .submit-button-wrapper {
	flex: 1 1 12rem !important;
	width: auto;
	margin: .5rem 0 0 !important;
}

html body .brx-popup form .submit-button-wrapper .bricks-button {
	margin: 0 !important;
	min-height: 2.5rem;
}

.popup-cancel {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 2.5rem;
	padding: .5rem .875rem;
	border: 1px solid var(--neutral-300);
	border-radius: 999px;
	background-color: var(--white);
	color: var(--neutral-700);
	font: inherit;
	font-size: .875rem;
	font-weight: 600;
	line-height: 1.25rem;
	text-align: center;
	cursor: pointer;
	transition: background-color .2s var(--ease-out), border-color .2s var(--ease-out);
}

@media (hover: hover) {
	.popup-cancel:hover { background-color: var(--neutral-50); border-color: var(--neutral-400); }
}

@media (max-width: 478px) {
	html body .brx-popup form .form-group:has(.popup-cancel) { order: 2; margin-top: 0 !important; }
	html body .brx-popup form .submit-button-wrapper { order: 1; }
}

/* ==========================================================================
   TEXTES LÉGAUX (.legals-text)
   ========================================================================== */
.legals-text {
	color: var(--neutral-600);
	font-size: 1rem;
}

.legals-text a {
	color: var(--brand-700);
	transition: var(--t300);
}

.legals-text a:is(:hover, :focus-visible) {
	opacity: .7;
	text-decoration: underline;
}

.legals-text h2 {
	margin: 2.5rem 0 1.25rem;
	font-size: 1.875rem;
	font-weight: 600;
	color: var(--brand-900);
}

.legals-text h3,
.legals-text h4 {
	margin: 0 0 .75rem;
	font-size: 1.5rem;
	font-weight: 500;
}

.legals-text p { margin: 0 0 1rem; }

.legals-text ul,
.legals-text ol {
	margin: 0 0 1rem;
	padding-left: 1.25rem;
	list-style-position: outside;
}

.legals-text ul { list-style-type: disc; }
.legals-text ol { list-style-type: decimal; }
.legals-text li { margin-bottom: .5rem; }
.legals-text strong { font-weight: 600; }

.legals-text h2:first-child { margin-top: 0; }
.legals-text p:last-child { margin-bottom: 0; }

/* ==========================================================================
   UTILITAIRES
   ========================================================================== */
.nodrag,
.noselect {
	-webkit-user-select: none !important;
	user-select: none !important;
}

.nodrag { -webkit-user-drag: none !important; }
.noselect { -webkit-touch-callout: none !important; }

/* ==========================================================================
   RESPONSIVE (breakpoints Bricks)
   ========================================================================== */
@media (max-width: 991px) {
	:root {
		--padding-vertical: 5rem !important;
		--padding-horizontal: 2.5rem !important;
		--navbar-height: 72px !important;
	}
}

@media (max-width: 767px) {
	:root {
		--padding-vertical: 4rem !important;
		--padding-horizontal: 1.5rem !important;
	}
}

@media (max-width: 478px) {
	:root {
		--padding-vertical: 3.5rem !important;
		--padding-horizontal: 1.25rem !important;
	}
}