/**
 * Fenêtre modale « Parlons de votre projet » (formulaire Fotostudio) — bp-modal.js.
 * Voile noir encre, panneau blanc qui monte en fondu avec la courbe des calques du
 * template (0.68, 0, 0.05, 0.99).
 */

.aml-modal {
	position: fixed;
	inset: 0;
	z-index: 1100;
	display: grid;
	place-items: center;
	padding: clamp(16px, 3vw, 48px);
}

.aml-modal[hidden] {
	display: none;
}

.aml-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(17, 17, 18, 0.72);
	opacity: 0;
	transition: opacity 0.4s ease;
	cursor: pointer;
}

.aml-modal__panel {
	position: relative;
	width: min(760px, 100%);
	max-height: min(90vh, 960px);
	overflow: auto;
	overscroll-behavior: contain;
	background: var(--aml-white);
	color: var(--aml-ink);
	border-radius: 12px;
	padding: clamp(20px, 3vw, 40px);
	opacity: 0;
	transform: translateY(32px) scale(0.98);
	transition: opacity 0.45s cubic-bezier(0.68, 0, 0.05, 0.99), transform 0.7s cubic-bezier(0.68, 0, 0.05, 0.99);
}

.aml-modal.is-open .aml-modal__backdrop { opacity: 1; }
.aml-modal.is-open .aml-modal__panel { opacity: 1; transform: none; }

.aml-modal__close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	background:
		linear-gradient(45deg, transparent calc(50% - 1px), var(--aml-ink) calc(50% - 1px), var(--aml-ink) calc(50% + 1px), transparent calc(50% + 1px)) center / 14px 14px no-repeat,
		linear-gradient(-45deg, transparent calc(50% - 1px), var(--aml-ink) calc(50% - 1px), var(--aml-ink) calc(50% + 1px), transparent calc(50% + 1px)) center / 14px 14px no-repeat,
		var(--aml-mist);
	transition: transform 0.45s cubic-bezier(0.34, 1.35, 0.64, 1);
}

.aml-modal__close:hover,
.aml-modal__close:focus-visible {
	transform: rotate(90deg);
}

.aml-modal__title {
	margin: 0 56px 10px 0;
	font-size: clamp(30px, 3.2vw, 46px);
	font-weight: 500;
	letter-spacing: -0.07em;
	line-height: 0.96;
}

.aml-modal__intro {
	margin: 0 0 28px;
	font-size: 16px;
	line-height: 22px;
	letter-spacing: -0.04em;
	color: rgba(17, 17, 18, 0.6);
}

.aml-modal__frame {
	display: block;
	width: 100%;
	height: min(72vh, 820px);
	border: 0;
}

.aml-modal__fallback p {
	margin: 0 0 18px;
	font-size: 18px;
	line-height: 26px;
	letter-spacing: -0.04em;
}

.aml-modal__fallback .aml-roll {
	color: var(--aml-ink);
	font-weight: 600;
}

html.aml-modal-open,
html.aml-modal-open body {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.aml-modal__backdrop,
	.aml-modal__panel,
	.aml-modal__close { transition: none; }
}

/* --- Variante vidéo : panneau noir 16:9, sans marges, croix blanche ------------------ */

.aml-modal--video .aml-modal__backdrop {
	background: rgba(0, 0, 0, 0.88);
}

.aml-modal--video .aml-modal__panel {
	width: min(1200px, 100%, calc((100vh - 96px) * 16 / 9));
	padding: 0;
	overflow: visible;
	background: #000;
	border-radius: 12px;
}

.aml-modal__video {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	border: 0;
	border-radius: 12px;
}

.aml-modal--video .aml-modal__close {
	top: -52px;
	right: 0;
	background:
		linear-gradient(45deg, transparent calc(50% - 1px), var(--aml-white) calc(50% - 1px), var(--aml-white) calc(50% + 1px), transparent calc(50% + 1px)) center / 14px 14px no-repeat,
		linear-gradient(-45deg, transparent calc(50% - 1px), var(--aml-white) calc(50% - 1px), var(--aml-white) calc(50% + 1px), transparent calc(50% + 1px)) center / 14px 14px no-repeat,
		rgba(255, 255, 255, 0.14);
}

/* --- Un formulaire dans une fenêtre (liste d'attente Honeymoon) ------------------------ */

.aml-modal__panel--court { max-width: 560px; }

.aml-modal .gform_wrapper { margin: 8px 0 0; }

.aml-modal .gform_wrapper input[type='email'] {
	width: 100%;
	padding: 16px 18px;
	border: 1px solid transparent;
	border-radius: 14px;
	background: var(--aml-mist);
	color: var(--aml-ink);
	font: 500 17px/1.35 var(--aml-font);
	letter-spacing: -0.03em;
}

.aml-modal .gform_wrapper input[type='email']:focus {
	border-color: var(--aml-ink);
	background: var(--aml-white);
	box-shadow: 0 0 0 4px rgba(17, 17, 18, 0.07);
	outline: none;
}

.aml-modal .gform_wrapper .gform_footer { margin: 18px 0 0; padding: 0; }

.aml-modal .gform_wrapper .gform_button {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	min-height: 52px;
	padding: 0 30px;
	border: 0;
	border-radius: 50px;
	background: var(--aml-ink);
	color: var(--aml-white);
	font: 600 16px/1 var(--aml-font);
	letter-spacing: -0.04em;
	cursor: pointer;
}

.aml-modal .gform_required_legend { display: none; }

.aml-modal .gform_confirmation_message {
	margin: 8px 0 0;
	font-size: 18px;
	font-weight: 500;
	letter-spacing: -0.04em;
	line-height: 1.45;
}

/* Le libellé fait doublon avec le texte d'invite : masqué à l'œil, gardé pour les
   lecteurs d'écran (Gravity Forms l'affiche malgré le réglage « libellé masqué »). */
.aml-modal .gform_wrapper .gfield_label {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Vidéos verticales (celles tournées pour les réseaux) */
.aml-modal--portrait .aml-modal__panel { width: min(520px, 100%, calc((100vh - 96px) * 9 / 16)); }
.aml-modal--portrait .aml-modal__video { aspect-ratio: 9 / 16; }

/* --- Une seule barre de défilement dans les fenêtres à cadre ----------------------------
 * Les pages de réservation de Fotostudio n'annoncent pas leur hauteur (contrairement à
 * leurs formulaires de prospect) : impossible de dimensionner le cadre sur son contenu.
 * On donne donc une hauteur ferme au panneau, qui ne défile plus, et c'est le cadre seul
 * qui défile — au lieu des deux ascenseurs côte à côte.
 */

.aml-modal__panel:has(.aml-modal__frame) {
	display: flex;
	flex-direction: column;
	height: min(90vh, 960px);
	overflow: hidden;
}

/* Le cadre est enveloppé par Bricks : c'est l'enveloppe qui doit s'étirer */
.aml-modal__panel:has(.aml-modal__frame) > *:has(> .aml-modal__frame) {
	display: flex;
	flex: 1 1 auto;
	min-height: 0;
}

.aml-modal__panel:has(.aml-modal__frame) .aml-modal__frame {
	flex: 1 1 auto;
	height: auto;
	min-height: 0;
}
