:root {
	--emcmp-border: rgba(80,4,93,.14);
	--emcmp-card: rgba(255,255,255,.88);
	--emcmp-font: Inter, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
	--emcmp-muted: #554b4f;
	--emcmp-radius-lg: 18px;
	--emcmp-radius-xl: 22px;
	--emcmp-rose-soft: #faedef;
	--emcmp-rose: #e11a63;
	--emcmp-shadow-lg: 0 26px 70px rgba(80,4,93,.20);
	--emcmp-shadow-md: 0 14px 35px rgba(80,4,93,.12);
	--emcmp-shadow-sm: 0 10px 22px rgba(80,4,93,.10);
	--emcmp-text: #262626;
	--emcmp-violet: #50045d;
}

.em-cmp {
	display: none;
	font-family: var(--emcmp-font);
	inset: 0;
	position: fixed;
	z-index: 120000;
}

.em-cmp-reopen {
	background: rgba(255,255,255,.86);
	border-radius: 999px;
	border: 1px solid rgba(80,4,93,.18);
	bottom: 14px;
	color: var(--emcmp-violet);
	cursor: pointer;
	font-size: 12.8px;
	font-weight: 600;
	padding: 10px 12px;
	position: fixed;
	right: 14px;
}

.em-cmp-reopen:hover {
	filter: brightness(1.3);
}

.em-cmp.is-open {
	display: block;
}

.em-cmp__backdrop {
	backdrop-filter: blur(10px);
	background: radial-gradient(900px 520px at 12% 6%, rgba(225,26,99,.22), transparent 62%), radial-gradient(780px 460px at 88% 10%, rgba(80,4,93,.16), transparent 62%), rgba(15,10,18,.18);
	inset: 0;
	position: absolute;
}

.em-cmp__brand {
	align-items: center;
	display: flex;
	gap: 12px;
}

.em-cmp__btn {
	background: rgba(255,255,255,.86);
	border-radius: 999px;
	border: 1px solid rgba(80,4,93,.18);
	box-shadow: var(--emcmp-shadow-sm);
	color: var(--emcmp-violet);
	cursor: pointer;
	font-size: 15px;
	font-weight: 600;
	padding: 12px 18px;
	transition: filter .12s ease, transform .12s ease;
}

.em-cmp__btn--primary {
	background: var(--emcmp-rose);
	border-color: rgba(225,26,99,.35);
	color: #fff;
}

.em-cmp__btn:active {
	transform: translateY(1px);
}

.em-cmp__btn:hover {
	filter: brightness(1.3);
}

.em-cmp__card {
	background: var(--emcmp-card);
	border-radius: var(--emcmp-radius-lg);
	border: 1px solid rgba(80,4,93,.12);
	box-shadow: var(--emcmp-shadow-md);
	padding: 14px;
}

.em-cmp__carddesc {
	color: var(--emcmp-muted);
	font-size: 12.9px;
}

.em-cmp__cards {
	display: grid;
	gap: 12px;
}

.em-cmp__cardtitle {
	color: var(--emcmp-violet);
	font-size: 15px;
	font-weight: 900;
}

.em-cmp__content {
	overflow: auto;
	padding: 14px 18px 12px;
}

.em-cmp__footer {
	background: rgba(255,255,255,.35);
	border-top: 1px solid rgba(80,4,93,.10);
	display: flex;
	gap: 12px;
	justify-content: flex-end;
	padding: 14px 18px 18px;
}

.em-cmp__header {
	align-items: center;
	background: rgba(255,255,255,.35);
	border-bottom: 1px solid rgba(80,4,93,.10);
	display: flex;
	gap: 14px;
	justify-content: space-between;
	padding: 14px 18px 12px;
}

.em-cmp__iconbtn {
	background: rgba(255,255,255,.78);
	border-radius: 18px;
	border: 1px solid rgba(80,4,93,.14);
	box-shadow: var(--emcmp-shadow-sm);
	color: var(--emcmp-violet);
	cursor: pointer;
	height: 42px;
	transition: transform .12s ease, filter .12s ease;
	width: 42px;
}

.em-cmp__iconbtn:active {
	transform: translateY(1px);
}

.em-cmp__iconbtn:hover {
	filter: brightness(1.06);
}

.em-cmp__link {
	border-bottom: 1px dotted rgba(80,4,93,.35);
	color: var(--emcmp-violet);
	font-weight: 600;
	text-decoration: none;
}

.em-cmp__links {
	font-size: 12.8px;
	padding: 12px 2px 6px;
}

.em-cmp__logo {
	background: radial-gradient(22px 22px at 30% 25%, rgba(225,26,99,.22), transparent 60%), radial-gradient(30px 30px at 80% 70%, rgba(80,4,93,.14), transparent 60%), rgba(255,255,255,.78);
	border-radius: 16px;
	border: 1px solid rgba(225,26,99,.22);
	box-shadow: var(--emcmp-shadow-sm);
	color: var(--emcmp-violet);
	display: grid;
	font-size: 18px;
	height: 42px;
	place-items: center;
	width: 42px;
}

.em-cmp__pill {
	background: var(--emcmp-rose);
	border-radius: 999px;
	border: 1px solid rgba(225,26,99,.25);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	padding: 8px 12px;
}

.em-cmp__row {
	align-items: center;
	display: flex;
	gap: 12px;
	justify-content: space-between;
}

.em-cmp__sheet {
	background: radial-gradient(1200px 600px at 20% -10%, rgba(250,237,239,.95), transparent 60%), radial-gradient(1000px 560px at 110% 0%, rgba(250,237,239,.92), transparent 60%), rgba(255,255,255,.86);
	border-radius: var(--emcmp-radius-xl);
	border: 1px solid rgba(255,255,255,.55);
	box-shadow: var(--emcmp-shadow-lg);
	display: flex;
	flex-direction: column;
	left: 50%;
	max-height: calc(100dvh - 28px);
	overflow: hidden;
	position: absolute;
	top: 50%;
	transform: translate(-50%,-50%);
	width: min(780px, calc(100% - 28px));
}

.em-cmp__sheet:before {
	border-radius: var(--emcmp-radius-xl);
	border: 1px solid rgba(80,4,93,.10);
	content: "";
	inset: 0;
	pointer-events: none;
	position: absolute;
}

.em-cmp__slider {
	background: #e6e6e6;
	border-radius: 999px;
	border: 1px solid rgba(0,0,0,.08);
	box-sizing: border-box;
	inset: 0;
	padding: 2px;
	position: absolute;
}

/* ✅ MODIF UNIQUE : knob légèrement plus petit pour augmenter l'espace avec le bord */
.em-cmp__slider:before {
	background: #fff;
	border-radius: 999px;
	box-shadow: 0 2px 10px rgba(0,0,0,.18);
	content: "";
	height: 24px;                 /* était 26px */
	left: 2px;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	transition: .18s;
	width: 24px;                  /* était 26px */
}

.em-cmp__subtitle {
	display: none !important;
}

.em-cmp__switch {
	height: 32px;
	position: relative;
	width: 56px;
	cursor: pointer;
}

.em-cmp__switch input {
	opacity: 0;
}

.em-cmp__switch input:checked + .em-cmp__slider {
	background: #5cc172;
}

/* Déplacement ajusté : (56 - 2*2 - 24) = 28px */
.em-cmp__switch input:checked + .em-cmp__slider:before {
	transform: translate(28px,-50%);
}

.em-cmp__text {
	color: var(--emcmp-muted);
	font-size: 13.4px;
	line-height: 1.45;
	margin: 0 0 12px;
}

.em-cmp__title {
	color: var(--emcmp-violet);
	font-size: 18px;
	font-weight: 900;
	letter-spacing: -.2px;
	line-height: 1.2;
	margin: 0;
}

.em-cUMPl {
	display: none;
}

@media (max-width: 680px) {
	.em-cmp__btn {
		width: 100%;
	}

	.em-cmp__footer {
		flex-direction: column;
	}

	.em-cmp__sheet {
		bottom: 10px;
		top: auto;
		transform: translateX(-50%);
		width: calc(100% - 18px);
	}
}

/* PATCH GLOBAL MOBILE — toggle plus large + knob bien contenu */
@media (max-width: 680px){

  /* Empêche le switch de se "rétrécir" dans un flex */
  .em-cmp__switch{
    flex: 0 0 auto !important;
    width: 60px !important;     /* >= 2x knob */
    min-width: 60px !important;
    height: 34px !important;
  }

  /* Rail */
  .em-cmp__slider{
    padding: 3px !important;    /* plus d’air */
    border-radius: 999px !important;
  }

  /* ✅ MODIF : knob un peu plus petit aussi sur mobile */
  .em-cmp__slider:before{
    width: 26px !important;     /* était 28px */
    height: 26px !important;    /* était 28px */
    left: 3px !important;
    transform: translateY(-50%) !important;
  }

  /* (on ne garde plus l'ancrage right : remplacé par le slide fluide ci-dessous) */
}

/* ===== PATCH toggle : alignement pixel-perfect ON ===== */

/* Desktop (>= 681px) */
@media (min-width: 681px){
  /* OFF : base propre */
  .em-cmp__slider{
    padding: 2px !important;
  }
  .em-cmp__slider:before{
    left: 2px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
  }
  /* ON : légèrement moins à droite */
  .em-cmp__switch input:checked + .em-cmp__slider:before{
    transform: translateX(26px) translateY(-50%) !important;
  }
}

/* Mobile (<= 680px) */
@media (max-width: 680px){
  /* ON : 1px de moins que le patch précédent */
  .em-cmp__switch input:checked + .em-cmp__slider:before{
    transform: translateX(26px) translateY(-50%) !important;
  }
}

/* ============================
   TOGGLE DESKTOP — CLEAN & FINAL
   ============================ */
@media (min-width: 681px){

  /* Dimensions desktop (faciles à ajuster) */
  .em-cmp__switch{
    width: 56px;
    height: 32px;
  }

  /* Rail = conteneur flex (centrage vertical garanti) */
  .em-cmp__slider{
    display: flex !important;
    align-items: center !important;
    padding: 2px !important;
    box-sizing: border-box !important;
    position: absolute !important;
    inset: 0 !important;
    border-radius: 999px !important;
    background: #e6e6e6 !important;
    border: 1px solid rgba(0,0,0,.08) !important;
  }

  /* Knob : plus de top/translateY, plus de left qui saute */
  .em-cmp__slider:before{
    content: "" !important;
    position: relative !important;      /* au lieu de absolute */
    left: 0 !important;
    top: auto !important;

    width: 24px !important;
    height: 24px !important;
    border-radius: 999px !important;
    background: #fff !important;
    box-shadow: 0 2px 10px rgba(0,0,0,.18) !important;

    transform: translateX(0) !important; /* OFF */
    transition: transform .22s ease !important;
  }

  /* Couleur ON */
  .em-cmp__switch input:checked + .em-cmp__slider{
    background: #5cc172 !important;
  }
}

@media (min-width: 681px){
  /* Correction optique : -2px pour ne pas "coller" à droite */
  .em-cmp__switch input:checked + .em-cmp__slider:before{
    transform: translateX(24px) !important;
  }
}

@media (min-width: 681px){
  /* OFF : correction optique symétrique */
  .em-cmp__slider:before{
    left: 1px !important; /* au lieu de 2px */
  }
}

/* PATCH anti-cadre grisé au tap (iOS/Android) */
.em-cmp__switch,
.em-cmp__switch *{
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
}

/* Empêche le rectangle de focus sur mobile */
.em-cmp__switch input:focus,
.em-cmp__switch input:active,
.em-cmp__switch input:focus-visible,
.em-cmp__switch:focus,
.em-cmp__switch:active,
.em-cmp__switch:focus-visible,
.em-cmp__slider:focus,
.em-cmp__slider:active,
.em-cmp__slider:focus-visible{
  outline: none !important;
  box-shadow: none !important;
}

/* Optionnel : supprime la sélection grise quand on "reste appuyé" */
.em-cmp__switch,
.em-cmp__slider{
  user-select: none;
  -webkit-user-select: none;
}

/* =========================================================
   CMP animations — patch minimal (ne touche pas aux transforms existants)
   ========================================================= */

/* On garde ton comportement de base */
.em-cmp { display: none; }

/* Pendant animation, on force l'affichage */
.em-cmp.is-animating,
.em-cmp.is-open,
.em-cmp.is-closing{
  display: block;
}

/* Backdrop fade */
#emCmp .em-cmp__backdrop{
  opacity: 0;
  transition: opacity .22s ease;
}
#emCmp.is-open .em-cmp__backdrop{
  opacity: 1;
}
#emCmp.is-closing .em-cmp__backdrop{
  opacity: 0;
}

/* Sheet fade (sans toucher au transform structurel) */
#emCmp .em-cmp__sheet{
  opacity: 0;
  filter: blur(2px);
  transition: opacity .22s ease, filter .22s ease;
  will-change: opacity, filter;
}
#emCmp.is-open .em-cmp__sheet{
  opacity: 1;
  filter: blur(0);
}
#emCmp.is-closing .em-cmp__sheet{
  opacity: 0;
  filter: blur(2px);
}

/* Mobile : petit slide vertical en plus (sans casser translateX(-50%)) */
@media (max-width: 680px){
  #emCmp .em-cmp__sheet{
    transform: translateX(-50%) translateY(12px);
    transition: opacity .5s ease, filter .5s ease, transform .5s ease;
  }
  #emCmp.is-open .em-cmp__sheet{
    transform: translateX(-50%) translateY(0);
  }
  #emCmp.is-closing .em-cmp__sheet{
    transform: translateX(-50%) translateY(12px);
  }
}

/* Desktop : on n’ajoute PAS de translate/scale, pour éviter de casser ton centrage */
@media (min-width: 681px){
  #emCmp .em-cmp__sheet{
    transition: opacity .22s ease, filter .22s ease;
  }
}

/* Accessibilité : réduction animations */
@media (prefers-reduced-motion: reduce){
  #emCmp .em-cmp__backdrop,
  #emCmp .em-cmp__sheet{
    transition: none !important;
  }
}
