/* Home popup — modal accueil */
body.home-popup-open {
	overflow: hidden;
}

.home-popup-root {
	--hp-radius: 24px;
	--hp-shadow: 0 32px 80px -12px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
	position: fixed;
	inset: 0;
	z-index: 99990;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: clamp(1rem, 4vw, 2rem);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.4s;
}

.home-popup-root.is-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.home-popup-root.is-closing {
	pointer-events: none;
}

.home-popup-root.is-closing .home-popup-overlay {
	opacity: 0;
}

.home-popup-root.is-closing .home-popup-dialog {
	opacity: 0;
	transform: translateY(12px) scale(0.96);
}

.home-popup-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(165deg, rgba(15, 23, 42, 0.72) 0%, rgba(30, 64, 127, 0.45) 100%);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	opacity: 0;
	transition: opacity 0.45s ease;
}

.home-popup-root.is-visible .home-popup-overlay {
	opacity: 1;
}

.home-popup-dialog {
	position: relative;
	z-index: 1;
	width: min(100%, 480px);
	max-height: min(92vh, 720px);
	outline: none;
	opacity: 0;
	transform: translateY(24px) scale(0.94);
	transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1), transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.home-popup-root.is-visible .home-popup-dialog {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.home-popup-card {
	position: relative;
	display: flex;
	flex-direction: column;
	max-height: min(92vh, 720px);
	overflow: hidden;
	background: #fff;
	border-radius: var(--hp-radius);
	box-shadow: var(--hp-shadow);
}

.home-popup-dialog--text-only .home-popup-card {
	background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

/* Close */
.home-popup-close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	z-index: 5;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	color: #1e293b;
	font-size: 1.4rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
	transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.home-popup-dialog--has-media .home-popup-close {
	top: 0.85rem;
	right: 0.85rem;
	background: rgba(255, 255, 255, 0.88);
	backdrop-filter: blur(8px);
}

.home-popup-close:hover {
	background: #fff;
	color: var(--webiste-primary-color, #1e407f);
	transform: rotate(90deg) scale(1.05);
}

.home-popup-close:focus-visible {
	outline: 2px solid var(--webiste-second-color, #1579be);
	outline-offset: 2px;
}

/* Image */
.home-popup-media {
	position: relative;
	flex-shrink: 0;
	padding: 0.65rem 0.65rem 0;
}

.home-popup-media-frame {
	position: relative;
	border-radius: calc(var(--hp-radius) - 6px);
	overflow: hidden;
	aspect-ratio: 16 / 10;
	background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);
}

.home-popup-media-frame img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: scale(1);
	transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.home-popup-root.is-visible .home-popup-media-frame img {
	animation: homePopupImageIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes homePopupImageIn {
	from {
		opacity: 0;
		transform: scale(1.06);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

.home-popup-media-glow {
	position: absolute;
	left: 50%;
	bottom: -20%;
	width: 70%;
	height: 40%;
	transform: translateX(-50%);
	background: radial-gradient(ellipse, rgba(30, 64, 127, 0.25) 0%, transparent 70%);
	pointer-events: none;
	filter: blur(20px);
}

/* Body */
.home-popup-body {
	position: relative;
	flex: 1;
	overflow-y: auto;
	padding: 1.75rem 2rem 2rem;
	text-align: center;
}

.home-popup-accent {
	width: 48px;
	height: 4px;
	margin: 0 auto 1.25rem;
	border-radius: 999px;
	background: linear-gradient(90deg, var(--webiste-primary-color, #1e407f), var(--webiste-second-color, #1579be));
	opacity: 0.9;
}

.home-popup-dialog--has-media .home-popup-accent {
	margin-top: 0.25rem;
}

.home-popup-text {
	font-family: Outfit, Montserrat, system-ui, sans-serif;
	font-size: clamp(1rem, 2.5vw, 1.125rem);
	font-weight: 400;
	line-height: 1.7;
	color: #475569;
	margin: 0 0 1.5rem;
	letter-spacing: 0.01em;
}

.home-popup-text p {
	margin: 0 0 0.65rem;
}

.home-popup-text p:last-child {
	margin-bottom: 0;
}

.home-popup-text strong,
.home-popup-text b {
	color: #0f172a;
	font-weight: 600;
}

/* Actions */
.home-popup-actions {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.85rem;
}

.home-popup-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	min-width: 200px;
	padding: 0.9rem 1.75rem;
	font-family: Outfit, Montserrat, sans-serif;
	font-size: 0.95rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-decoration: none;
	color: #fff !important;
	background: var(--webiste-second-color) !important;
	border-radius: 999px;
	box-shadow: 0 12px 28px -8px rgba(30, 64, 127, 0.45);
	transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.home-popup-cta ion-icon {
	font-size: 1.15rem;
	transition: transform 0.25s ease;
}

.home-popup-cta:hover {
	transform: translateY(-2px);
	box-shadow: 0 16px 36px -10px rgba(30, 64, 127, 0.55);
	filter: brightness(1.05);
	color: #fff !important;
}

.home-popup-cta:hover ion-icon {
	transform: translateX(4px);
}

.home-popup-cta:focus-visible {
	outline: 2px solid var(--webiste-third-color, #1579be);
	outline-offset: 3px;
}

.home-popup-dismiss {
	padding: 0.35rem 0.75rem;
	border: none;
	background: transparent;
	font-family: Outfit, Montserrat, sans-serif;
	font-size: 0.8125rem;
	font-weight: 500;
	color: #94a3b8;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 0.2s ease;
}

.home-popup-dismiss:hover {
	color: #64748b;
}

/* Text-only variant */
.home-popup-dialog--text-only .home-popup-body {
	padding-top: 2.5rem;
}

.home-popup-dialog--text-only .home-popup-close {
	background: #f1f5f9;
	box-shadow: none;
}

.home-popup-dialog--text-only .home-popup-close:hover {
	background: #e2e8f0;
}

/* Mobile */
@media (max-width: 575px) {
	.home-popup-root {
		align-items: flex-end;
		padding: 0;
	}

	.home-popup-dialog {
		width: 100%;
		max-height: 90vh;
	}

	.home-popup-card {
		border-radius: 20px 20px 0 0;
		max-height: 90vh;
	}

	.home-popup-media {
		padding: 0.5rem 0.5rem 0;
	}

	.home-popup-media-frame {
		aspect-ratio: 4 / 3;
		border-radius: 16px 16px 0 0;
	}

	.home-popup-body {
		padding: 1.35rem 1.35rem 1.5rem;
		padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
	}

	.home-popup-cta {
		width: 100%;
		min-width: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.home-popup-root,
	.home-popup-overlay,
	.home-popup-dialog,
	.home-popup-media-frame img,
	.home-popup-close,
	.home-popup-cta {
		transition: none !important;
		animation: none !important;
	}
}
