/**
 * Lead Magnet Express — styles front-end.
 *
 * Charte Site Signature v2 :
 *   --lme-primary:   #C96045 (terre cuite)
 *   --lme-secondary: #D3964D (ocre)
 *   --lme-text:      #291F0D (brun foncé)
 *   --lme-accent:    #687C65 (sauge)
 *   --lme-bg:        #FAF8F3 (ivoire)
 *   --lme-border:    #E0DBCB
 */

.lme-form {
	width: 100%;
	font-family: 'Raleway', sans-serif;
	color: #291F0D;
	box-sizing: border-box;
}

.lme-form *,
.lme-form *::before,
.lme-form *::after {
	box-sizing: border-box;
}

/* ==================== Honeypot (invisible) ==================== */

.lme-form__honeypot {
	position: absolute !important;
	left: -9999px !important;
	top: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

/* ==================== Layouts ==================== */

.lme-form .lme-form__fields {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* Spécificité doublée + !important pour gagner contre les overrides de thèmes / Elementor */
.lme-form.lme-form--layout-horizontal .lme-form__fields {
	flex-direction: row !important;
	flex-wrap: wrap;
}

.lme-form.lme-form--layout-horizontal .lme-form__field-group {
	flex: 1 1 200px;
	min-width: 0;
}

.lme-form.lme-form--layout-inline .lme-form__fields {
	flex-direction: row !important;
	gap: 8px;
}

.lme-form.lme-form--layout-inline .lme-form__field-group {
	flex: 1 1 auto;
}

.lme-form.lme-form--layout-inline .lme-form__label {
	display: none;
}

/* ====================================================================== */
/* Mode INLINE — email et bouton sur la même ligne, RGPD en dessous       */
/* On transforme le <form> lui-même en flex container avec wrap.          */
/* L'ordre visuel est défini via la propriété order :                     */
/*   1. .lme-form__fields    (email)                                      */
/*   2. .lme-form__submit-wrapper  (bouton)                               */
/*   3. .lme-form__rgpd       (consentement, sur sa propre ligne)         */
/*   4. .lme-form__message    (feedback succès/erreur)                    */
/* ====================================================================== */

.lme-form.lme-form--layout-inline {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 8px;
}

.lme-form.lme-form--layout-inline > .lme-form__fields {
	flex: 1 1 200px;
	min-width: 200px;
	order: 1;
	margin: 0;
}

.lme-form.lme-form--layout-inline > .lme-form__submit-wrapper {
	flex: 0 0 auto;
	order: 2;
	margin-top: 0;
	display: flex;
	align-items: stretch;
}

.lme-form.lme-form--layout-inline > .lme-form__submit-wrapper .lme-form__submit {
	height: 100%;
	width: auto;
}

.lme-form.lme-form--layout-inline > .lme-form__rgpd {
	flex: 1 1 100%;
	order: 3;
	margin-top: 4px;
}

.lme-form.lme-form--layout-inline > .lme-form__message {
	flex: 1 1 100%;
	order: 4;
	margin-top: 0;
}

/* ==================== Champs ==================== */

.lme-form__field-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.lme-form__label {
	font-size: 0.9em;
	font-weight: 500;
	color: #291F0D;
}

.lme-form__required {
	color: #C96045;
	font-weight: 600;
}

.lme-form__field {
	width: 100%;
	padding: 12px 14px;
	font-size: 1em;
	font-family: inherit;
	color: inherit;
	background-color: #FFFFFF;
	border: 1px solid #E0DBCB;
	border-radius: 6px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.lme-form__field:focus {
	outline: none;
	border-color: #C96045;
	box-shadow: 0 0 0 3px rgba(201, 96, 69, 0.15);
}

.lme-form__field--textarea,
textarea.lme-form__field {
	min-height: 100px;
	resize: vertical;
}

select.lme-form__field {
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23291F0D' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 36px;
}

.lme-form__radio-group,
.lme-form__checkbox-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.lme-form__radio,
.lme-form__checkbox {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-size: 0.95em;
	cursor: pointer;
}

.lme-form__radio input,
.lme-form__checkbox input {
	margin-top: 4px;
	flex-shrink: 0;
}

/* ==================== RGPD ==================== */

.lme-form__rgpd {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin-top: 14px;
	font-size: 0.85em;
	line-height: 1.5;
	color: #4A3F2A;
}

.lme-form__rgpd input {
	margin-top: 4px;
	flex-shrink: 0;
}

/* ==================== Bouton ==================== */

.lme-form__submit-wrapper {
	display: flex;
	margin-top: 16px;
}

.lme-form__submit-wrapper--left {
	justify-content: flex-start;
}
.lme-form__submit-wrapper--center {
	justify-content: center;
}
.lme-form__submit-wrapper--right {
	justify-content: flex-end;
}
.lme-form__submit-wrapper--stretch .lme-form__submit {
	width: 100%;
}

.lme-form__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 28px;
	font-size: 1em;
	font-weight: 600;
	font-family: inherit;
	color: #FFFFFF;
	background-color: #C96045;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.lme-form__submit-icon {
	display: inline-flex;
	align-items: center;
	line-height: 1;
}

.lme-form__submit-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.lme-form__submit-icon i {
	font-size: 1em;
}

.lme-form__title {
	margin: 0 0 16px 0;
	font-family: 'Raleway', sans-serif;
	color: #291F0D;
	font-weight: 700;
	line-height: 1.2;
}

.lme-form__description {
	margin: 0 0 20px 0;
	font-family: 'Raleway', sans-serif;
	font-size: 16px;
	line-height: 1.5;
	color: #4A3F2A;
}

.lme-form__description p {
	margin: 0 0 8px 0;
}

.lme-form__description p:last-child {
	margin-bottom: 0;
}

.lme-form__submit:hover:not(:disabled) {
	background-color: #B0533A;
}

.lme-form__submit:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ==================== Messages ==================== */

.lme-form__message {
	margin-top: 14px;
	padding: 0;
	font-size: 0.95em;
}

.lme-form__message:not(:empty) {
	padding: 12px 14px;
	border-radius: 6px;
}

.lme-form__message.is-success {
	background-color: rgba(104, 124, 101, 0.12);
	color: #4D5C4B;
	border-left: 3px solid #687C65;
}

.lme-form__message.is-error {
	background-color: rgba(201, 96, 69, 0.10);
	color: #8E4534;
	border-left: 3px solid #C96045;
}

/* ==================== Carte (encart fin d'article) ==================== */

.lme-card {
	display: flex;
	flex-direction: column;
	background-color: #FAF8F3;
	border: 1px solid #E0DBCB;
	border-radius: 12px;
	padding: 32px;
	overflow: hidden;
}

.lme-card__media {
	margin: -32px -32px 24px -32px;
}

.lme-card__media img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 280px;
	object-fit: cover;
}

.lme-card__body {
	flex: 1;
	font-family: 'Raleway', sans-serif;
}

.lme-card__title {
	margin: 0 0 12px 0;
	color: #C96045;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.2;
}

.lme-card__subtitle {
	margin: 0 0 20px 0;
	color: #4A3F2A;
	font-size: 16px;
	line-height: 1.5;
}

.lme-card__form {
	margin-top: 16px;
}

/* Layouts horizontaux : image à gauche / droite */

.lme-card--layout-image-left,
.lme-card--layout-image-right {
	flex-direction: row;
	align-items: stretch;
}

.lme-card--layout-image-left .lme-card__media,
.lme-card--layout-image-right .lme-card__media {
	flex: 0 0 40%;
	margin: -32px;
	margin-right: 32px;
	max-width: 40%;
}

.lme-card--layout-image-right .lme-card__media {
	order: 2;
	margin-right: -32px;
	margin-left: 32px;
}

.lme-card--layout-image-left .lme-card__media img,
.lme-card--layout-image-right .lme-card__media img {
	height: 100%;
	max-height: none;
}

@media (max-width: 760px) {
	.lme-card--layout-image-left,
	.lme-card--layout-image-right {
		flex-direction: column;
	}
	.lme-card--layout-image-left .lme-card__media,
	.lme-card--layout-image-right .lme-card__media {
		flex: 1 1 auto;
		max-width: none;
		margin: -32px -32px 24px -32px;
		order: 0;
	}
}

/* ==================== Pop-up modal (overlay) ==================== */

body.lme-popup-open {
	overflow: hidden;
}

.lme-popup {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

.lme-popup.is-visible {
	display: flex;
	animation: lmeFadeIn 0.2s ease-out;
}

@keyframes lmeFadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.lme-popup__overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(41, 31, 13, 0.65);
	backdrop-filter: blur(2px);
	cursor: pointer;
}

.lme-popup__container {
	position: relative;
	z-index: 1;
	max-width: 520px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	background: #FFFFFF;
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
	animation: lmePopIn 0.25s ease-out;
}

@keyframes lmePopIn {
	from { transform: scale(0.95); opacity: 0; }
	to   { transform: scale(1);    opacity: 1; }
}

.lme-popup__close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 36px;
	height: 36px;
	background: transparent;
	border: none;
	font-size: 28px;
	line-height: 1;
	color: #291F0D;
	cursor: pointer;
	border-radius: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.15s ease;
}

.lme-popup__close:hover,
.lme-popup__close:focus {
	background-color: rgba(41, 31, 13, 0.08);
	outline: none;
}

.lme-popup__content {
	padding: 8px;
}

/* Pop-up card (rendu du widget WidgetFormPopup à l'intérieur de la modal) */

.lme-popup-card {
	padding: 32px;
	font-family: 'Raleway', sans-serif;
}

.lme-popup-card__media {
	margin: -32px -32px 24px -32px;
	overflow: hidden;
	border-radius: 12px 12px 0 0;
}

.lme-popup-card__media img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 200px;
	object-fit: cover;
}

.lme-popup-card__title {
	margin: 0 0 12px 0;
	color: #C96045;
	font-size: 24px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
}

.lme-popup-card__subtitle {
	margin: 0 0 20px 0;
	color: #4A3F2A;
	font-size: 16px;
	line-height: 1.5;
	text-align: center;
}

@media (max-width: 600px) {
	.lme-popup__container {
		max-height: 95vh;
	}
	.lme-popup-card {
		padding: 24px;
	}
	.lme-popup-card__media {
		margin: -24px -24px 16px -24px;
	}
}

/* ==================== Auto-injection ==================== */

.lme-auto-injection {
	margin-top: 32px;
	margin-bottom: 32px;
}

.lme-auto-injection > * {
	margin-bottom: 0 !important;
}

/* ==================== Stub editor (Jalon 1 legacy) ==================== */

.lme-widget-stub {
	padding: 16px;
	background: #FAF8F3;
	border: 1px dashed #C96045;
	border-radius: 8px;
	color: #291F0D;
	font-family: 'Raleway', sans-serif;
	text-align: center;
}

/* ==================== Responsive ==================== */

@media (max-width: 600px) {
	.lme-form--layout-horizontal .lme-form__fields,
	.lme-form--layout-inline .lme-form__fields {
		flex-direction: column;
	}
	.lme-form--layout-inline .lme-form__label {
		display: block;
	}
}
