/**
 * Popup d'opt-in produit — styles front.
 *
 * Les couleurs reprennent la charte du site (vert #75BE4B, encre #2B2E34).
 * Le flou de l'image est piloté par --lacense-optin-blur, surchargeable
 * dans le CSS additionnel du thème si besoin.
 */

.lacense-optin-trigger,
.lacense-optin-overlay {
	--lacense-optin-green: #75be4b;
	--lacense-optin-green-dark: #67a942;
	--lacense-optin-ink: #2b2e34;
	--lacense-optin-muted: #85868a;
	--lacense-optin-blur: 5px;
}

/* Portée volontairement limitée aux éléments du module. */
.lacense-optin-trigger[hidden],
.lacense-optin-overlay[hidden],
.lacense-optin-content[hidden],
.lacense-optin-success[hidden],
.lacense-optin-error[hidden] {
	display: none !important;
}

/* ---------------------------------------------------------------------------
 * Bouton discret d'ouverture, toujours visible en bas à droite.
 * ------------------------------------------------------------------------ */

body .lacense-optin-trigger {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 99998;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	max-width: calc(100vw - 40px);
	margin: 0;
	padding: 11px 20px 11px 14px;
	border: 1px solid rgba(43, 46, 52, 0.1);
	border-radius: 999px;
	background: #fff;
	box-shadow: 0 6px 22px rgba(43, 46, 52, 0.18);
	color: var(--lacense-optin-ink);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-align: left;
	cursor: pointer;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

body .lacense-optin-trigger:hover,
body .lacense-optin-trigger:focus-visible {
	transform: translateY(-2px);
	box-shadow: 0 10px 28px rgba(43, 46, 52, 0.24);
}

.lacense-optin-trigger__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--lacense-optin-green);
	color: #fff;
}

.lacense-optin-trigger__label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ---------------------------------------------------------------------------
 * Voile et fenêtre modale.
 * ------------------------------------------------------------------------ */

.lacense-optin-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	overflow-y: auto;
	background: rgba(0, 0, 0, 0.62);
	animation: lacense-optin-fade 0.2s ease;
}

.lacense-optin-modal {
	position: relative;
	width: 100%;
	max-width: 570px;
	margin: auto;
	padding: 40px;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
	color: var(--lacense-optin-ink);
	font-family: inherit;
	animation: lacense-optin-pop 0.22s ease;
}

.lacense-optin-modal .lacense-optin-close {
	position: absolute;
	top: 16px;
	right: 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--lacense-optin-ink);
	cursor: pointer;
	transition: background 0.15s ease;
}

.lacense-optin-modal .lacense-optin-close:hover,
.lacense-optin-modal .lacense-optin-close:focus-visible {
	background: rgba(43, 46, 52, 0.07);
}

/* ---------------------------------------------------------------------------
 * Contenu : titre, description, illustration.
 * ------------------------------------------------------------------------ */

.lacense-optin-modal .lacense-optin-title {
	margin: 0 0 14px;
	padding: 0;
	color: var(--lacense-optin-ink);
	font-size: clamp(26px, 4.2vw, 34px);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.01em;
}

.lacense-optin-highlight {
	color: var(--lacense-optin-green);
	font-style: italic;
	font-weight: 800;
}

.lacense-optin-modal .lacense-optin-description {
	margin: 0 0 22px;
	color: var(--lacense-optin-ink);
	font-size: 16px;
	line-height: 1.5;
}

.lacense-optin-media {
	position: relative;
	margin: 0 0 24px;
	border-radius: 12px;
	overflow: hidden;
	background: #000;
	aspect-ratio: 16 / 9;
}

.lacense-optin-media__image,
.lacense-optin-media__image img {
	display: block;
	width: 100%;
	height: 100%;
}

.lacense-optin-media__image img {
	object-fit: cover;
	/* Flou « vidéo verrouillée » ; l'agrandissement masque les bords délavés. */
	filter: blur(var(--lacense-optin-blur));
	transform: scale(1.1);
}

.lacense-optin-media__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	line-height: 0;
	filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
	pointer-events: none;
}

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

.lacense-optin-form {
	margin: 0;
}

.lacense-optin-form input[type="text"],
.lacense-optin-form input[type="email"] {
	display: block;
	box-sizing: border-box;
	width: 100%;
	margin: 0 0 12px;
	padding: 15px 18px;
	border: 1px solid #d9d9d9;
	border-radius: 10px;
	background: #fff;
	color: var(--lacense-optin-ink);
	font-family: inherit;
	font-size: 16px;
	line-height: 1.3;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.lacense-optin-form input::placeholder {
	color: #9b9b9b;
	opacity: 1;
}

.lacense-optin-form input[type="text"]:focus,
.lacense-optin-form input[type="email"]:focus {
	border-color: var(--lacense-optin-green);
	box-shadow: 0 0 0 3px rgba(117, 190, 75, 0.18);
	outline: none;
}

.lacense-optin-modal .lacense-optin-submit {
	display: block;
	width: 100%;
	margin: 8px 0 0;
	padding: 16px 20px;
	border: 0;
	border-radius: 999px;
	background: var(--lacense-optin-green);
	color: #fff;
	font-family: inherit;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	transition: background 0.15s ease;
}

.lacense-optin-modal .lacense-optin-submit:hover,
.lacense-optin-modal .lacense-optin-submit:focus-visible {
	background: var(--lacense-optin-green-dark);
}

.lacense-optin-modal .lacense-optin-submit[disabled] {
	opacity: 0.65;
	cursor: default;
}

.lacense-optin-error {
	margin: 4px 0 0;
	color: #c0392b;
	font-size: 14px;
	line-height: 1.4;
}

/* Pot de miel : hors écran, invisible pour le visiteur, atteignable par un robot. */
.lacense-optin-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.lacense-optin-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ---------------------------------------------------------------------------
 * Confirmation.
 * ------------------------------------------------------------------------ */

.lacense-optin-success {
	padding: 24px 0 8px;
	text-align: center;
}

.lacense-optin-success__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	margin-bottom: 18px;
	border-radius: 50%;
	background: rgba(117, 190, 75, 0.14);
	color: var(--lacense-optin-green);
}

.lacense-optin-modal .lacense-optin-success p {
	margin: 0;
	font-size: 18px;
	line-height: 1.45;
}

/* ---------------------------------------------------------------------------
 * Divers.
 * ------------------------------------------------------------------------ */

body.lacense-optin-open {
	overflow: hidden;
}

@keyframes lacense-optin-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes lacense-optin-pop {
	from { opacity: 0; transform: translateY(12px) scale(0.98); }
	to { opacity: 1; transform: none; }
}

@media (max-width: 600px) {
	.lacense-optin-modal {
		padding: 32px 22px 26px;
	}

	body .lacense-optin-trigger {
		right: 12px;
		bottom: 12px;
		font-size: 13px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lacense-optin-overlay,
	.lacense-optin-modal,
	body .lacense-optin-trigger {
		animation: none;
		transition: none;
	}
}
