/*
 * Pop-up Studio Audrey Guillou
 * Couleurs, polices et dimensions viennent des réglages (variables --agp-…) :
 * inutile de modifier ce fichier pour changer l'apparence.
 */

.agp[hidden],
.agp [hidden] {
	display: none !important;
}

.agp {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 99990;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
	font-size: 16px;
	line-height: 1.6;
}

.agp *,
.agp *::before,
.agp *::after {
	box-sizing: border-box;
	font-family: inherit;
	line-height: inherit;
}

.agp__voile {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background: var(--agp-voile, #1A1A1A);
	opacity: var(--agp-voile-opacite, 0.55);
	animation: agp-fondu 0.3s ease-out;
}

/* ---------- Fenêtre ---------- */

.agp .agp__boite {
	position: relative;
	display: flex;
	width: 100%;
	max-width: var(--agp-largeur, 760px);
	max-height: calc(100vh - 40px);
	max-height: calc(100dvh - 40px);
	margin: 0;
	overflow: hidden;
	border: 0 solid var(--agp-lisere, #7F673A);
	border-radius: var(--agp-arrondi, 0);
	background: var(--agp-fond, #F0EDE8);
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.25);
	color: var(--agp-texte, #2B2B2B);
	font-family: var(--agp-police-texte);
	font-size: var(--agp-taille-texte, 15px);
	text-align: left;
	-webkit-backdrop-filter: blur(var(--agp-flou));
	backdrop-filter: blur(var(--agp-flou));
	animation: agp-entree 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.agp .agp__boite:focus {
	outline: none;
}

.agp--lisere-haut .agp__boite {
	border-top-width: var(--agp-lisere-epaisseur, 3px);
}

.agp--lisere-cadre .agp__boite {
	border-width: var(--agp-lisere-epaisseur, 3px);
}

.agp--sans-ombre .agp__boite {
	box-shadow: none;
}

.agp--anim-fondu .agp__boite {
	animation-name: agp-fondu;
}

.agp--anim-aucune .agp__boite,
.agp--anim-aucune .agp__voile {
	animation: none;
}

/* ---------- Place de l'image ---------- */

.agp--sans .agp__boite {
	max-width: min(var(--agp-largeur, 760px), 560px);
}

.agp--droite .agp__boite {
	flex-direction: row-reverse;
}

.agp--haut .agp__boite {
	flex-direction: column;
	max-width: min(var(--agp-largeur, 760px), 520px);
}

.agp--fond .agp__boite {
	max-width: min(var(--agp-largeur, 760px), 620px);
}

.agp__visuel {
	position: relative;
	flex: 0 0 40%;
	min-height: 340px;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.06);
}

.agp--haut .agp__visuel {
	flex: 0 0 auto;
	min-height: 0;
	height: 190px;
}

.agp .agp__image {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	border: 0;
	border-radius: 0;
	object-fit: cover;
	object-position: var(--agp-image-position, center center);
}

/* Image en fond : elle couvre toute la fenêtre, sous un voile qui garde le texte lisible. */
.agp.agp--fond .agp__visuel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 0;
	display: block;
	flex: none;
	width: auto;
	height: auto;
	min-height: 0;
}

.agp--fond .agp__visuel::after {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	background: var(--agp-photo-voile, #1A1A1A);
	opacity: var(--agp-photo-opacite, 0.45);
}

.agp--fond .agp__contenu {
	position: relative;
	z-index: 1;
}

/* ---------- Contenu ---------- */

.agp__contenu {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 0;
	overflow-y: auto;
	padding: 48px 40px 28px;
}

.agp .agp__surtitre {
	margin: 0 0 14px;
	padding: 0 44px 0 0;
	color: var(--agp-surtitre, #7F673A);
	font-family: var(--agp-police-surtitre);
	font-size: var(--agp-taille-surtitre, 12px);
	font-weight: var(--agp-graisse-surtitre, 600);
	letter-spacing: 0.22em;
	line-height: 1.4;
	text-transform: uppercase;
}

.agp--surtitre-normal .agp__surtitre {
	letter-spacing: 0.04em;
	text-transform: none;
}

.agp .agp__titre {
	margin: 0 0 12px;
	padding: 0 44px 0 0;
	border: 0;
	background: none;
	color: var(--agp-titre, #1A1A1A);
	font-family: var(--agp-police-titre);
	font-size: var(--agp-taille-titre, 34px);
	font-style: normal;
	font-weight: var(--agp-graisse-titre, 400);
	letter-spacing: 0;
	line-height: 1.12;
	text-transform: none;
}

.agp .agp__titre::before,
.agp .agp__titre::after {
	content: none;
}

.agp .agp__titre:focus {
	outline: none;
}

.agp .agp__texte {
	margin: 0 0 20px;
	padding: 0;
	color: inherit;
	font-size: var(--agp-taille-texte, 15px);
	line-height: 1.65;
	white-space: pre-line;
}

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

.agp .agp__formulaire {
	margin: 0;
	padding: 0;
}

.agp .agp__champ {
	display: block;
	width: 100%;
	height: auto;
	margin: 0 0 10px;
	padding: 12px 14px;
	border: 1px solid var(--agp-champ-bordure, #C9C3B8);
	border-radius: min(var(--agp-arrondi, 0px), 6px);
	background: var(--agp-champ-fond, #FFFFFF);
	box-shadow: none;
	color: var(--agp-champ-texte, #1A1A1A);
	font: inherit;
	font-size: var(--agp-taille-champs, 16px);
	line-height: 1.3;
}

.agp .agp__champ::placeholder {
	color: var(--agp-champ-texte, #1A1A1A);
	opacity: 0.6;
}

.agp .agp__champ:focus {
	border-color: var(--agp-accent, #7F673A);
	outline: none;
	box-shadow: 0 0 0 1px var(--agp-accent, #7F673A);
}

.agp--champs-ligne .agp__champ {
	padding: 12px 0;
	border-width: 0 0 1px;
	border-radius: 0;
	background: transparent;
}

.agp--champs-ligne .agp__champ:focus {
	box-shadow: 0 1px 0 0 var(--agp-accent, #7F673A);
}

.agp .agp__case {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin: 10px 0 0;
	padding: 0;
	color: var(--agp-mention, #2B2B2B);
	font-family: var(--agp-police-petits);
	font-size: var(--agp-taille-petits, 13px);
	font-weight: 400;
	letter-spacing: 0;
	line-height: 1.5;
	text-transform: none;
	cursor: pointer;
}

.agp .agp__case input[type="checkbox"] {
	position: static;
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 1px 0 0;
	opacity: 1;
	-webkit-appearance: checkbox;
	appearance: auto;
	accent-color: var(--agp-accent, #7F673A);
	cursor: pointer;
}

.agp .agp__case-texte {
	white-space: pre-line;
}

.agp .agp__bouton {
	display: block;
	width: 100%;
	height: auto;
	margin: 18px 0 0;
	padding: 15px 22px;
	border: 0;
	border-radius: min(var(--agp-arrondi, 0px), 6px);
	background: var(--agp-bouton, #1A1A1A);
	box-shadow: none;
	color: var(--agp-bouton-texte, #FFFFFF);
	font: inherit;
	font-family: var(--agp-police-bouton);
	font-size: var(--agp-taille-bouton, 15px);
	font-weight: var(--agp-graisse-bouton, 500);
	letter-spacing: 0.04em;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	text-transform: none;
	cursor: pointer;
	transition: filter 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.agp .agp__bouton:hover {
	filter: brightness(1.18);
}

.agp .agp__bouton:focus-visible {
	outline: 2px solid var(--agp-accent, #7F673A);
	outline-offset: 3px;
}

.agp--bouton-contour .agp__bouton {
	background: transparent;
	box-shadow: inset 0 0 0 1px var(--agp-bouton, #1A1A1A);
	color: var(--agp-bouton, #1A1A1A);
}

.agp--bouton-contour .agp__bouton:hover {
	background: var(--agp-bouton, #1A1A1A);
	color: var(--agp-bouton-texte, #FFFFFF);
	filter: none;
}

.agp .agp__phrase {
	margin: 10px 0 0;
	padding: 0;
	color: var(--agp-mention, #2B2B2B);
	font-family: var(--agp-police-petits);
	font-size: var(--agp-taille-petits, 13px);
	line-height: 1.5;
	white-space: pre-line;
}

.agp .agp__erreur {
	margin: 12px 0 0;
	padding: 2px 0 2px 10px;
	border-left: 3px solid #B42318;
	color: var(--agp-titre, #1A1A1A);
	font-family: var(--agp-police-petits);
	font-size: var(--agp-taille-petits, 13px);
	line-height: 1.5;
}

.agp .agp__erreur:empty {
	display: none;
}

.agp .agp__mention {
	margin: 14px 0 0;
	padding: 0;
	color: var(--agp-mention, #2B2B2B);
	font-family: var(--agp-police-petits);
	font-size: var(--agp-taille-petits, 13px);
	line-height: 1.55;
}

.agp .agp__mention a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.agp .agp__non-merci {
	display: block;
	width: auto;
	height: auto;
	margin: 10px auto 0;
	padding: 4px 6px;
	border: 0;
	background: none;
	box-shadow: none;
	color: var(--agp-mention, #2B2B2B);
	font: inherit;
	font-family: var(--agp-police-petits);
	font-size: var(--agp-taille-petits, 13px);
	letter-spacing: 0;
	text-decoration: underline;
	text-transform: none;
	text-underline-offset: 3px;
	cursor: pointer;
}

.agp .agp__fermer {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0 0 3px;
	border: 0;
	border-radius: 50%;
	background: var(--agp-fond, #F0EDE8);
	box-shadow: none;
	color: var(--agp-titre, #1A1A1A);
	font: 400 26px/1 Arial, Helvetica, sans-serif;
	text-transform: none;
	cursor: pointer;
}

.agp .agp__fermer:focus-visible,
.agp .agp__non-merci:focus-visible {
	outline: 2px solid var(--agp-accent, #7F673A);
	outline-offset: 2px;
}

/* Textes réservés aux lecteurs d'écran, et champ piège anti-robots */
.agp .agp__cache,
.agp .agp__piege {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0 0 0 0) !important;
	border: 0 !important;
	white-space: nowrap !important;
}

/* ---------- Questions et réponses ---------- */

.agp .agp__question {
	margin: 6px 0 12px;
	padding: 0;
}

.agp .agp__groupe {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.agp .agp__question-libelle {
	display: block;
	float: none;
	width: auto;
	margin: 0 0 6px;
	padding: 0;
	border: 0;
	color: var(--agp-texte, #2B2B2B);
	font-size: var(--agp-taille-texte, 15px);
	font-weight: 500;
	letter-spacing: 0;
	line-height: 1.4;
	text-transform: none;
}

.agp .agp__option {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin: 6px 0 0;
	padding: 0;
	color: var(--agp-mention, #2B2B2B);
	font-family: var(--agp-police-petits);
	font-size: var(--agp-taille-petits, 13px);
	font-weight: 400;
	letter-spacing: 0;
	line-height: 1.5;
	text-transform: none;
	cursor: pointer;
}

.agp .agp__option input {
	position: static;
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 1px 0 0;
	opacity: 1;
	-webkit-appearance: auto;
	appearance: auto;
	accent-color: var(--agp-accent, #7F673A);
	cursor: pointer;
}

.agp select.agp__champ {
	cursor: pointer;
}

.agp textarea.agp__champ {
	min-height: 84px;
	resize: vertical;
}

.agp .agp__question .agp__champ {
	margin-bottom: 0;
}

/* ---------- Formats ---------- */

/* Coin et bandeau : pas de voile, la page reste utilisable. */
.agp--format-coin,
.agp--format-bandeau {
	pointer-events: none;
}

.agp--format-coin .agp__voile,
.agp--format-bandeau .agp__voile,
.agp--format-plein .agp__voile {
	display: none;
}

.agp--format-coin .agp__boite,
.agp--format-bandeau .agp__boite {
	pointer-events: auto;
}

/* Coin */
.agp--format-coin {
	align-items: flex-end;
	justify-content: flex-end;
	padding: 24px;
}

.agp--format-coin.agp--cote-gauche {
	justify-content: flex-start;
}

.agp--format-coin .agp__boite {
	flex-direction: column;
	max-width: min(var(--agp-largeur, 760px), 380px);
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
}

.agp--format-coin .agp__visuel {
	flex: 0 0 auto;
	min-height: 0;
	height: 160px;
}

.agp--format-coin .agp__contenu {
	padding: 30px 26px 20px;
}

.agp--format-coin .agp__titre {
	font-size: calc(var(--agp-taille-titre, 34px) * 0.78);
}

/* Bandeau */
.agp--format-bandeau {
	align-items: flex-end;
	padding: 0;
}

.agp--format-bandeau .agp__boite {
	max-width: none;
	max-height: 80vh;
	max-height: 80dvh;
	border-radius: 0;
	box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.18);
}

.agp--format-bandeau .agp__contenu {
	padding: 22px 64px 22px 32px;
}

.agp--format-bandeau .agp__etape {
	max-width: 1100px;
	margin: 0 auto;
}

.agp--format-bandeau [data-agp-etape="formulaire"] {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	column-gap: 32px;
}

.agp--format-bandeau .agp__surtitre,
.agp--format-bandeau .agp__titre,
.agp--format-bandeau .agp__texte {
	grid-column: 1;
}

.agp--format-bandeau .agp__titre {
	margin-bottom: 4px;
	font-size: calc(var(--agp-taille-titre, 34px) * 0.72);
}

.agp--format-bandeau .agp__texte {
	margin-bottom: 0;
}

.agp--format-bandeau .agp__deplier {
	grid-column: 2;
	grid-row: 1 / span 3;
	width: auto;
	margin: 0;
}

.agp--format-bandeau .agp__non-merci {
	grid-column: 2;
	margin-top: 6px;
}

.agp--format-bandeau .agp__detail {
	grid-column: 1 / -1;
	margin-top: 16px;
}

.agp--format-bandeau .agp__formulaire {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.agp--format-bandeau .agp__champ {
	flex: 1 1 200px;
	width: auto;
	margin: 0;
	order: 1;
}

.agp--format-bandeau .agp__formulaire .agp__bouton {
	flex: 0 0 auto;
	width: auto;
	margin: 0;
	order: 2;
}

.agp--format-bandeau .agp__case,
.agp--format-bandeau .agp__phrase,
.agp--format-bandeau .agp__erreur {
	flex: 1 1 100%;
	margin-top: 0;
}

.agp--format-bandeau .agp__case {
	order: 3;
}

.agp--format-bandeau .agp__phrase {
	order: 4;
}

.agp--format-bandeau .agp__erreur {
	order: 5;
}

.agp--format-bandeau .agp__question {
	flex: 1 1 100%;
	order: 3;
	margin: 0;
}

.agp--format-bandeau .agp__question .agp__champ {
	width: 100%;
}

/* Plein écran */
.agp--format-plein {
	padding: 0;
}

.agp--format-plein .agp__boite {
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	border-radius: 0;
}

.agp--format-plein .agp__visuel {
	flex-basis: 50%;
}

.agp--format-plein.agp--haut .agp__visuel {
	flex: 0 0 38vh;
	height: 38vh;
}

.agp--format-plein .agp__contenu {
	display: flex;
	flex-direction: column;
	padding: 64px 48px;
}

.agp--format-plein .agp__etape {
	width: 100%;
	max-width: 520px;
	margin: auto;
}

/* ---------- Animations ---------- */

@keyframes agp-fondu {
	from {
		opacity: 0;
	}
}

@keyframes agp-entree {
	from {
		opacity: 0;
		transform: translateY(18px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.agp__voile,
	.agp .agp__boite {
		animation: none;
	}
}

/* ---------- Téléphone ---------- */

@media (max-width: 640px) {
	.agp {
		padding: 12px;
	}

	.agp .agp__boite {
		flex-direction: column;
		max-width: none;
		max-height: calc(100vh - 24px);
		max-height: calc(100dvh - 24px);
	}

	.agp__visuel,
	.agp--haut .agp__visuel,
	.agp--format-coin .agp__visuel,
	.agp--format-plein .agp__visuel {
		flex: 0 0 auto;
		min-height: 0;
		height: 150px;
	}

	.agp__contenu {
		padding: 30px 22px 22px;
	}

	.agp .agp__titre {
		font-size: calc(var(--agp-taille-titre, 34px) * 0.82);
	}

	/* Sur téléphone, 16 px au minimum : en dessous, l'iPhone agrandit la page quand on touche le champ. */
	.agp .agp__champ {
		font-size: max(16px, var(--agp-taille-champs, 16px));
	}

	.agp--format-plein {
		padding: 0;
	}

	.agp--format-plein .agp__boite {
		height: 100%;
		max-height: none;
	}

	.agp--format-plein .agp__contenu {
		padding: 40px 24px;
	}

	/* Fenêtre compacte, coin et bandeau : en bas de l'écran, la page reste utilisable. */
	.agp--mobile-compact,
	.agp--format-coin,
	.agp--format-bandeau {
		align-items: flex-end;
		justify-content: center;
		padding: 0;
		pointer-events: none;
	}

	.agp--mobile-compact .agp__voile {
		display: none;
	}

	.agp--mobile-compact .agp__visuel,
	.agp--format-coin .agp__visuel,
	.agp--format-bandeau .agp__visuel {
		display: none;
	}

	.agp--mobile-compact .agp__boite,
	.agp--format-coin .agp__boite,
	.agp--format-bandeau .agp__boite {
		width: 100%;
		height: auto;
		max-width: none;
		max-height: 80vh;
		max-height: 80dvh;
		border-radius: var(--agp-arrondi, 0) var(--agp-arrondi, 0) 0 0;
		box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.18);
		pointer-events: auto;
	}

	.agp--mobile-compact .agp__contenu,
	.agp--format-coin .agp__contenu,
	.agp--format-bandeau .agp__contenu {
		display: block;
		padding: 24px 20px 16px;
	}

	.agp--mobile-compact .agp__titre,
	.agp--format-coin .agp__titre,
	.agp--format-bandeau .agp__titre {
		font-size: calc(var(--agp-taille-titre, 34px) * 0.74);
	}

	.agp--mobile-compact .agp__texte,
	.agp--format-coin .agp__texte,
	.agp--format-bandeau .agp__texte {
		margin-bottom: 16px;
		font-size: calc(var(--agp-taille-texte, 15px) * 0.93);
	}

	.agp--mobile-compact .agp__etape,
	.agp--format-coin .agp__etape {
		margin: 0;
	}

	.agp--mobile-compact .agp__deplier,
	.agp--format-coin .agp__deplier {
		margin-top: 0;
	}

	/* Bandeau sur téléphone : une seule colonne. */
	.agp--format-bandeau [data-agp-etape="formulaire"],
	.agp--format-bandeau .agp__formulaire {
		display: block;
	}

	.agp--format-bandeau .agp__deplier {
		width: 100%;
		margin: 0;
	}

	.agp--format-bandeau .agp__champ {
		width: 100%;
		margin-bottom: 10px;
	}

	.agp--format-bandeau .agp__formulaire .agp__bouton {
		width: 100%;
		margin-top: 14px;
	}

	.agp--format-bandeau .agp__case {
		margin-top: 10px;
	}

	.agp--format-bandeau .agp__phrase {
		margin-top: 10px;
	}
}
