/**
 * Styles du composant global « Invitation B2Biz »
 * (Popup 1re visite + Carte flottante Desktop)
 *
 * Charte :
 * - Bleu #0691E2 et Mauve #9652DF
 * - Alumni Sans pour les titres
 * - Typographie du site (Inter) pour le corps de texte
 * - Fond clair, présentation aérée et sobre
 */

/* Verrouillage temporaire du défilement pendant l'ouverture de la popup */
html.os-b2biz-modal-open,
html.os-b2biz-modal-open body {
	overflow: hidden !important;
}

/* ==========================================================================
   1. POPUP MODALE (1re visite)
   ========================================================================== */
.os-b2biz-modal-backdrop {
	position: fixed;
	inset: 0;
	z-index: 999990;
	background: rgba(15, 23, 42, 0.54);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.28s ease, visibility 0.28s ease;
}

.os-b2biz-modal-backdrop[hidden] {
	display: none !important;
}

.os-b2biz-modal-backdrop.is-open {
	opacity: 1;
	visibility: visible;
}

.os-b2biz-modal {
	position: relative;
	width: 100%;
	max-width: 740px;
	max-height: calc(100vh - 48px);
	max-height: calc(100dvh - 48px);
	overflow-y: auto;
	background: #FFFFFF;
	color: #0F172A;
	border-radius: 18px;
	border: 1px solid rgba(6, 145, 226, 0.16);
	box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22), 0 4px 16px rgba(6, 145, 226, 0.08);
	font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
	opacity: 0;
	transform: translateY(14px);
	transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	outline: none;
}

/* Barre d'accent supérieure aux couleurs de la charte (#0691E2 -> #9652DF) */
.os-b2biz-modal::before {
	content: "";
	display: block;
	height: 5px;
	width: 100%;
	background: linear-gradient(90deg, #0691E2 0%, #9652DF 100%);
}

/* Adaptation propre lorsque aucune illustration n'est renseignée (aucun espace vide) */
.os-b2biz-modal.os-b2biz-modal--no-image {
	max-width: 600px;
}

.os-b2biz-modal-backdrop.is-open .os-b2biz-modal {
	opacity: 1;
	transform: translateY(0);
}

/* Bouton de fermeture (Croix bien visible et toujours accessible) */
.os-b2biz-modal__close {
	position: absolute;
	top: 18px;
	right: 18px;
	z-index: 3;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 1px solid #E2E8F0;
	background: #F8FAFC;
	color: #334155;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.os-b2biz-modal__close:hover {
	background: #EFF6FF;
	border-color: rgba(6, 145, 226, 0.35);
	color: #0691E2;
}

.os-b2biz-modal__close:focus-visible {
	outline: 2px solid #0691E2;
	outline-offset: 2px;
}

/* Mise en page interne */
.os-b2biz-modal__inner {
	display: grid;
	grid-template-columns: 1fr;
}

.os-b2biz-modal--has-image .os-b2biz-modal__inner {
	grid-template-columns: 260px 1fr;
	align-items: stretch;
}

.os-b2biz-modal__media {
	background: linear-gradient(145deg, rgba(6, 145, 226, 0.07) 0%, rgba(150, 82, 223, 0.09) 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	border-right: 1px solid rgba(226, 232, 240, 0.8);
}

.os-b2biz-modal__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.os-b2biz-modal__content {
	padding: 36px 40px 34px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

/* Surversion (Eyebrow) B2Biz */
.os-b2biz-modal__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #0691E2;
	margin-bottom: 12px;
	padding-right: 36px;
}

.os-b2biz-modal__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: linear-gradient(135deg, #0691E2 0%, #9652DF 100%);
	flex-shrink: 0;
}

/* Titre en Alumni Sans */
.os-b2biz-modal__title {
	font-family: var(--font-display, 'Alumni Sans', sans-serif);
	font-size: clamp(2rem, 3.2vw, 2.55rem);
	font-weight: 800;
	line-height: 1.06;
	letter-spacing: -0.01em;
	color: #0F172A;
	margin: 0 0 16px 0;
	padding-right: 24px;
}

/* Corps de texte */
.os-b2biz-modal__text {
	font-family: var(--font-sans, 'Inter', sans-serif);
	font-size: 1.02rem;
	line-height: 1.62;
	color: #334155;
	margin: 0 0 26px 0;
}

/* Zone d'action (Bouton + Mention) */
.os-b2biz-modal__actions {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
}

.os-b2biz-modal__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 13px 26px;
	border-radius: 999px;
	background: linear-gradient(135deg, #0691E2 0%, #9652DF 100%);
	color: #FFFFFF !important;
	font-family: var(--font-sans, 'Inter', sans-serif);
	font-size: 0.96rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none !important;
	box-shadow: 0 8px 20px rgba(6, 145, 226, 0.24);
	transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.os-b2biz-modal__cta:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 24px rgba(150, 82, 223, 0.3);
	filter: brightness(1.04);
	color: #FFFFFF !important;
}

.os-b2biz-modal__cta:focus-visible {
	outline: 2px solid #0691E2;
	outline-offset: 3px;
}

.os-b2biz-modal__note {
	margin: 0;
	font-size: 0.82rem;
	color: #64748B;
	font-weight: 500;
	padding-left: 4px;
}

/* ==========================================================================
   2. CARTE FLOTTANTE SUR ORDINATEUR (Bas à droite, 290–320 px)
   ========================================================================== */
.os-b2biz-float-card {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 999980;
	width: 308px;
	background: #FFFFFF;
	color: #0F172A;
	border-radius: 14px;
	border: 1px solid rgba(6, 145, 226, 0.22);
	box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(6, 145, 226, 0.06);
	padding: 16px 18px 15px;
	font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s ease, bottom 0.25s ease;
}

/* Dégagement automatique lorsque le bouton flottant #os-cookie-trigger est présent en bas à droite */
.os-b2biz-float-card.os-b2biz-float-card--above-cookie {
	bottom: 72px;
}

.os-b2biz-float-card[hidden] {
	display: none !important;
}

.os-b2biz-float-card.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

/* Liseré latéral gauche aux couleurs B2Biz */
.os-b2biz-float-card::before {
	content: "";
	position: absolute;
	top: 12px;
	bottom: 12px;
	left: 0;
	width: 4px;
	border-radius: 0 4px 4px 0;
	background: linear-gradient(180deg, #0691E2 0%, #9652DF 100%);
}

/* Petite croix de fermeture pour la session */
.os-b2biz-float-card__close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	border: 1px solid transparent;
	background: transparent;
	color: #64748B;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.os-b2biz-float-card__close:hover {
	background: #F1F5F9;
	color: #0F172A;
}

.os-b2biz-float-card__close:focus-visible {
	outline: 2px solid #0691E2;
	outline-offset: 2px;
}

.os-b2biz-float-card__badge {
	display: inline-block;
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #9652DF;
	background: rgba(150, 82, 223, 0.1);
	padding: 2px 8px;
	border-radius: 999px;
	margin-bottom: 6px;
}

.os-b2biz-float-card__title {
	font-family: var(--font-display, 'Alumni Sans', sans-serif);
	font-size: 1.38rem;
	font-weight: 700;
	line-height: 1.12;
	color: #0F172A;
	margin: 0 0 4px 0;
	padding-right: 22px;
}

.os-b2biz-float-card__text {
	font-size: 0.86rem;
	line-height: 1.45;
	color: #475569;
	margin: 0 0 10px 0;
}

.os-b2biz-float-card__link {
	display: inline-flex;
	align-items: center;
	font-size: 0.86rem;
	font-weight: 600;
	color: #0691E2 !important;
	text-decoration: none !important;
	transition: color 0.2s ease;
}

.os-b2biz-float-card__link:hover {
	color: #9652DF !important;
	text-decoration: underline !important;
}

.os-b2biz-float-card__link:focus-visible {
	outline: 2px solid #0691E2;
	outline-offset: 2px;
	border-radius: 4px;
}

/* ==========================================================================
   3. RESPONSIVE MOBILE & TABLETTE
   ========================================================================== */

/* Aucune carte flottante sous le breakpoint desktop du thème (900px) */
@media (max-width: 899px) {
	.os-b2biz-float-card {
		display: none !important;
	}
}

/* Adaptation mobile de la popup : une colonne compacte, illustration masquée */
@media (max-width: 767px) {
	.os-b2biz-modal-backdrop {
		padding: 16px;
	}

	.os-b2biz-modal,
	.os-b2biz-modal.os-b2biz-modal--has-image,
	.os-b2biz-modal.os-b2biz-modal--no-image {
		max-width: 100%;
		max-height: calc(100vh - 32px);
		max-height: calc(100dvh - 32px);
		border-radius: 16px;
	}

	.os-b2biz-modal--has-image .os-b2biz-modal__inner {
		grid-template-columns: 1fr;
	}

	/* Ne jamais laisser l'illustration repousser le bouton hors écran sur mobile */
	.os-b2biz-modal__media {
		display: none !important;
	}

	.os-b2biz-modal__content {
		padding: 26px 22px 24px;
	}

	.os-b2biz-modal__close {
		top: 12px;
		right: 12px;
		width: 34px;
		height: 34px;
	}

	.os-b2biz-modal__title {
		font-size: 1.85rem;
		margin-bottom: 12px;
	}

	.os-b2biz-modal__text {
		font-size: 0.95rem;
		line-height: 1.55;
		margin-bottom: 20px;
	}

	.os-b2biz-modal__actions {
		align-items: stretch;
	}

	.os-b2biz-modal__cta {
		width: 100%;
		text-align: center;
		padding: 13px 20px;
	}

	.os-b2biz-modal__note {
		text-align: center;
		padding-left: 0;
	}
}

/* ==========================================================================
   4. ACCESSIBILITÉ : PREFERS-REDUCED-MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	.os-b2biz-modal-backdrop,
	.os-b2biz-modal,
	.os-b2biz-modal__cta,
	.os-b2biz-modal__close,
	.os-b2biz-float-card,
	.os-b2biz-float-card__close {
		transition: none !important;
		transform: none !important;
	}
}
