/* ==========================================================================
   Guacamole — Popup « Être prévenu de l'ouverture »
   Design system Guacamole v2 : Forêt / Amande / Lime, titre display,
   bulle 999px + queue, panneau 32px, CTA 10px, champs 12px.
   Tous les sélecteurs passent par #guac-popup pour l'emporter sur
   les styles Brevo et sur les règles .sib-form du thème enfant.
   ========================================================================== */

#guac-popup {
	--gp-forest: var(--guac-forest, #164031);
	--gp-forest-hover: var(--guac-forest-hover, #0E2E23);
	--gp-leaf: var(--guac-leaf, #3C8924);
	--gp-almond: var(--guac-almond, #BEE6A1);
	--gp-soft: var(--guac-almond-soft, #D4EEC2);
	--gp-lime: var(--guac-lime, #B9E15A);
	--gp-stone: var(--guac-stone, #667364);
	--gp-danger: var(--guac-danger, #C0452E);
	--gp-display: var(--font-display, "Kilimanjaro Sans", "Arial Black", Arial, sans-serif);
	--gp-sans: var(--font-sans, "Inter", system-ui, -apple-system, sans-serif);
	--gp-focus: 0 0 0 4px rgba(185, 225, 90, .55);

	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
	transition: opacity .25s ease, visibility 0s linear .25s;
}
#guac-popup.is-open {
	visibility: visible;
	opacity: 1;
	pointer-events: auto;
	transition: opacity .25s ease;
}
html.guac-popup-lock,
html.guac-popup-lock body { overflow: hidden; }

#guac-popup .guac-popup__overlay {
	position: absolute;
	inset: 0;
	background: rgb(185, 225, 90, .72);
	-webkit-backdrop-filter: blur(3px);
	backdrop-filter: blur(3px);
}

/* ---------- Boîte ---------- */
#guac-popup .guac-popup__dialog {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
	width: 100%;
	max-width: 900px;
	max-height: calc(100vh - 48px);
	overflow: auto;
	background: #fff;
	border-radius: 32px;
	box-shadow: 0 30px 80px rgba(14, 46, 35, .35);
	font-family: var(--gp-sans);
	color: var(--gp-forest);
	outline: none;
	transform: translateY(18px) scale(.98);
	transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
#guac-popup.is-open .guac-popup__dialog { transform: none; }

#guac-popup .guac-popup__close {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: var(--gp-soft);
	color: var(--gp-forest);
	cursor: pointer;
	transition: background .2s ease;
}
#guac-popup .guac-popup__close:hover { background: var(--gp-almond); }

/* ---------- Colonne Forêt : la voix de Guacamole ---------- */
#guac-popup .guac-popup__aside {
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 20px;
	padding: 56px 40px 72px;
	background: var(--gp-forest);
}
#guac-popup .guac-popup__title {
	position: relative;
	z-index: 1;
	margin: 0;
	padding: 0;
	font-family: var(--gp-display);
	font-weight: 400;
	font-size: clamp(38px, 4.6vw, 54px);
	line-height: 1.02;
	letter-spacing: 0;
	text-transform: uppercase;
	color: var(--gp-almond);
}
#guac-popup .guac-popup__bulle {
	position: relative;
	z-index: 1;
	align-self: flex-start;
	margin: 0 0 14px;
	padding: 14px 26px;
	border-radius: 999px;
	background: var(--gp-lime);
	color: var(--gp-forest);
	font-family: var(--gp-sans);
	font-weight: 700;
	font-size: 16px;
	line-height: 1.3;
	white-space: nowrap;
}
#guac-popup .guac-popup__bulle::after {
	content: "";
	position: absolute;
	left: 26px;
	top: 96%;
	width: 22px;
	height: 16px;
	background: inherit;
	clip-path: path("M 0 0 L 22 0 A 22 16 0 0 1 0 16 Z");
}

/* ---------- Colonne formulaire ---------- */
#guac-popup .guac-popup__main {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 14px;
	padding: 64px 44px 36px;
}
#guac-popup .guac-popup__text {
	margin: 0 0 6px;
	padding: 0;
	max-width: 38ch;
	font-size: 18px;
	line-height: 1.5;
	color: var(--gp-forest);
}
#guac-popup .guac-popup__note {
	margin: 0;
	padding: 0;
	font-size: 13px;
	line-height: 1.4;
	color: var(--gp-stone);
}
#guac-popup .guac-popup__later {
	align-self: flex-start;
	margin: 2px 0 0;
	padding: 4px 0;
	border: 0;
	background: none;
	font: 500 14px/1.3 var(--gp-sans);
	color: var(--gp-stone);
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}
#guac-popup .guac-popup__later:hover { color: var(--gp-forest); }
#guac-popup .guac-popup__sr {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* ---------- Formulaire Brevo, remis aux couleurs ---------- */
#guac-popup .sib-form,
#guac-popup #sib-container,
#guac-popup .sib-form-block {
	padding: 0 !important;
	margin: 0 !important;
	max-width: none !important;
	background: transparent !important;
	border: 0 !important;
	text-align: left !important;
	font-family: var(--gp-sans) !important;
}
#guac-popup #sib-form { margin: 0; }
#guac-popup .guac-popup__row { padding: 5px 0; }
#guac-popup .form__label-row { display: block; }

#guac-popup .sib-form .entry__field {
	margin: 0 !important;
	padding: 0 !important;
	border: 1.5px solid var(--gp-soft) !important;
	border-radius: 12px !important;
	background: #fff !important;
	box-shadow: none !important;
	transition: border-color .2s ease, box-shadow .2s ease;
}
#guac-popup .sib-form .entry__field:focus-within {
	border-color: var(--gp-leaf) !important;
	box-shadow: var(--gp-focus) !important;
}
#guac-popup .sib-form .entry__field input.input {
	width: 100%;
	min-height: 52px;
	margin: 0;
	padding: 0 16px !important;
	border: 0 !important;
	border-radius: 12px !important;
	background: transparent !important;
	box-shadow: none !important;
	outline: none;
	font: 500 16px/1.2 var(--gp-sans) !important;
	color: var(--gp-forest) !important;
}
#guac-popup .sib-form .entry__field input.input::placeholder {
	font-family: var(--gp-sans) !important;
	color: var(--gp-stone) !important;
	opacity: 1;
	text-transform: none;
}

/* Case de consentement */
#guac-popup .entry__choice { padding: 0 !important; }
#guac-popup .entry__choice label {
	position: relative;
	display: block;
	margin: 0;
	padding: 1px 0 0 32px !important;
	font-size: 13px;
	line-height: 1.45;
	color: var(--gp-stone);
	cursor: pointer;
}
#guac-popup .entry__choice .input_replaced {
	position: absolute;
	top: 1px;
	left: 0;
	z-index: 1;
	width: 20px;
	height: 20px;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}
#guac-popup .entry__choice .checkbox {
	position: absolute !important;
	top: 1px;
	left: 0;
	width: 20px !important;
	height: 20px !important;
	margin: 0 !important;
	border: 1.5px solid var(--gp-leaf) !important;
	border-radius: 6px !important;
	background: #fff !important;
	transition: background .15s ease, box-shadow .15s ease;
}
#guac-popup .entry__choice .checkbox::before { content: none !important; }
#guac-popup .entry__choice .input_replaced:checked + .checkbox {
	background: var(--gp-leaf) !important;
	border-color: var(--gp-leaf) !important;
}
#guac-popup .entry__choice .input_replaced:checked + .checkbox::after {
	content: "";
	position: absolute;
	left: 5.5px;
	top: 1.5px;
	width: 5px;
	height: 10px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}
#guac-popup .entry__choice .input_replaced:focus-visible + .checkbox { box-shadow: var(--gp-focus); }
#guac-popup .guac-popup__consent a {
	color: var(--gp-forest);
	text-decoration: underline;
	text-underline-offset: 2px;
}

span.guac-popup__consent {padding-left:20px;}

/* Captcha */
#guac-popup .cf-turnstile { min-height: 65px; }

/* Erreurs de champ */
#guac-popup .entry__error {
	display: block;
	margin: 6px 0 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	font: 500 13px/1.4 var(--gp-sans) !important;
	color: var(--gp-danger) !important;
	text-align: left !important;
}
#guac-popup .entry__error:empty { display: none; }

/* Bouton : famille CTA, 10px, Forêt + Lime comme sur le site */
#guac-popup .sib-form-block__button {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 52px;
	margin: 4px 0 0;
	padding: 0 24px !important;
	border: 0 !important;
	border-radius: 10px !important;
	background: var(--gp-forest) !important;
	color: var(--gp-lime) !important;
	font: 700 16px/1.2 var(--gp-sans) !important;
	text-align: center !important;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
	transition: background .2s ease, color .2s ease;
}
#guac-popup .sib-form-block__button:hover {
	background: var(--gp-forest-hover) !important;
	color: #fff !important;
}
#guac-popup .sib-form-block__button .progress-indicator__icon {
	width: 18px;
	height: 18px;
	fill: currentColor;
}
#guac-popup .sib-hide-loader-icon { display: none; }
#guac-popup .input--hidden { display: none !important; }

/* Panneaux de message Brevo : masqués tant que Brevo ne les active pas */
#guac-popup .sib-form-message-panel { display: none; }
#guac-popup .sib-form-message-panel--active { display: block; }

#guac-popup #error-message {
	max-width: none !important;
	margin: 0 0 10px !important;
	padding: 12px 16px !important;
	border: 0 !important;
	border-left: 4px solid var(--gp-danger) !important;
	border-radius: 12px !important;
	background: #FBEDEA !important;
	font: 500 14px/1.45 var(--gp-sans) !important;
	color: #8A2E1D !important;
}
#guac-popup .sib-notification__icon { display: none; }
/* Le message de succès Brevo reste présent (le script le surveille) mais invisible : la confirmation Guacamole prend le relais. */
#guac-popup #success-message {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: 0 !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	border: 0 !important;
}

/* ---------- Confirmation ---------- */
#guac-popup .guac-popup__done {
	display: none;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	padding: 28px;
	/* border-left: 4px solid var(--gp-leaf);*/
	border-radius: 12px;
	/* background: var(--gp-soft);*/
}
#guac-popup .guac-popup__done-icon {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	margin-bottom: 4px;
	border-radius: 50%;
	background: var(--gp-leaf);
	color: #fff;
}
#guac-popup .guac-popup__done-title {
	margin: 0;
	padding: 0;
	font: 600 22px/1.22 var(--gp-sans);
	letter-spacing: -.01em;
	color: var(--gp-forest);
}
#guac-popup .guac-popup__done-text {
	margin: 0 0 10px;
	padding: 0;
	font-size: 16px;
	line-height: 1.5;
	color: var(--gp-forest);
}
#guac-popup .guac-popup__btn {
	min-height: 48px;
	padding: 0 24px;
	border: 0;
	border-radius: 10px;
	background: var(--gp-forest);
	color: var(--gp-lime);
	font: 700 16px/1.2 var(--gp-sans);
	cursor: pointer;
}
#guac-popup .guac-popup__btn:hover { background: var(--gp-forest-hover); color: #fff; }

#guac-popup.is-success .guac-popup__done { display: flex; }
#guac-popup.is-success .sib-form,
#guac-popup.is-success .guac-popup__text,
#guac-popup.is-success .guac-popup__note,
#guac-popup.is-success .guac-popup__later { display: none; }

/* ---------- Focus clavier ---------- */
#guac-popup button:focus-visible,
#guac-popup a:focus-visible {
	outline: none;
	box-shadow: var(--gp-focus);
}

/* ---------- Mobile : feuille qui monte depuis le bas ---------- */
@media (max-width: 760px) {
	#guac-popup {
		align-items: flex-end;
		padding: 0;
	}
	#guac-popup .guac-popup__dialog {
		grid-template-columns: 1fr;
		max-height: 92vh;
		border-radius: 24px 24px 0 0;
		transform: translateY(100%);
	}
	#guac-popup .guac-popup__aside {
		gap: 14px;
		padding: 32px 76px 36px 24px;
	}
	#guac-popup .guac-popup__title { font-size: 32px; }
	#guac-popup .guac-popup__bulle { font-size: 15px; padding: 11px 20px; margin-bottom: 8px; white-space: normal; }
	#guac-popup .guac-popup__shape { width: 140px; height: 140px; right: -48px; bottom: -56px; }
	#guac-popup .guac-popup__close { top: 14px; right: 14px; }
	#guac-popup .guac-popup__main { padding: 26px 24px 28px; gap: 10px; }
	#guac-popup .guac-popup__text { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
	#guac-popup,
	#guac-popup .guac-popup__dialog { transition: none; }
}
