/* NRG Mascotte : la mascotte de NRG Santé. Couleurs : celles du thème, avec des valeurs de secours. */

:root {
	--nrgm-encre: var(--nrg-encre, #072B31);
	--nrgm-emeraude: var(--nrg-emeraude, #0A7D64);
	--nrgm-menthe: var(--nrg-menthe, #3DDC97);
	--nrgm-menthe-douce: var(--nrg-menthe-douce, #E3FAF0);
	--nrgm-soleil: var(--nrg-soleil, #FFC94D);
	--nrgm-doux: var(--nrg-texte-doux, #2C4650);
	--nrgm-ligne: var(--nrg-ligne, #D7E8E1);
}

/* ---------- Bulle (texte de la page, jamais dans l'image) ---------- */

.nrgm-bulle {
	position: relative;
	margin: 0;
	padding: 0.6rem 0.85rem;
	border: 2px solid var(--nrgm-ligne);
	border-radius: 16px;
	background: #fff;
	color: var(--nrgm-encre);
	font-size: 0.9rem;
	font-weight: 700;
	line-height: 1.35;
	box-shadow: 0 8px 22px rgba(7, 43, 49, 0.1);
}

/* Pointe vers la mascotte, à droite de la bulle. */
.nrgm-bulle::after {
	content: "";
	position: absolute;
	right: -9px;
	bottom: 14px;
	width: 14px;
	height: 14px;
	border-right: 2px solid var(--nrgm-ligne);
	border-top: 2px solid var(--nrgm-ligne);
	background: #fff;
	transform: rotate(45deg);
}

.nrgm-bulle--gauche::after {
	right: auto;
	left: -9px;
	border: 0;
	border-left: 2px solid var(--nrgm-ligne);
	border-bottom: 2px solid var(--nrgm-ligne);
}

/* ---------- Bouton flottant : la tête dans le bouton ---------- */

.nrg-sticky__btn.nrgm-a-avatar { padding-left: 0.45rem; }

.nrgm-avatar {
	display: inline-grid;
	place-items: center;
	flex: none;
	width: 40px;
	height: 40px;
	margin-right: -0.2rem;
}

.nrgm-avatar__img { display: block; width: 33px; height: auto; }

@media (max-width: 719px) {
	/* Sur téléphone, le bouton prend toute la largeur : la tête et le libellé restent groupés à gauche. */
	.nrg-sticky__btn.nrgm-a-avatar { justify-content: flex-start; }
	.nrg-sticky__btn.nrgm-a-avatar .nrg-sticky__fleche { margin-left: auto; }
}

/* ---------- Bouton flottant : la bulle, une fois par visite ---------- */

.nrgm-bulle-flottante {
	box-sizing: border-box;
	position: absolute;
	right: 0;
	bottom: calc(100% + 14px);
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	width: max-content;
	max-width: min(340px, calc(100vw - 32px));
	padding: 0.7rem 2.3rem 0.75rem 0.7rem;
	border: 2px solid var(--nrgm-ligne);
	border-radius: 18px;
	background: #fff;
	color: var(--nrgm-encre);
	box-shadow: 0 16px 36px rgba(7, 43, 49, 0.22);
	opacity: 0;
	transform: translateY(10px) scale(0.98);
	transform-origin: 85% 100%;
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.nrgm-bulle-flottante.is-ouverte { opacity: 1; transform: none; }

.nrgm-bulle-flottante::after {
	content: "";
	position: absolute;
	right: 2.4rem;
	bottom: -9px;
	width: 14px;
	height: 14px;
	border-right: 2px solid var(--nrgm-ligne);
	border-bottom: 2px solid var(--nrgm-ligne);
	background: #fff;
	transform: rotate(45deg);
}

.nrgm-bulle-flottante__avatar { flex: none; display: block; width: 40px; height: auto; margin-top: -2px; }

.nrgm-bulle-flottante__texte { margin: 0 !important; font-size: 0.92rem; font-weight: 700; line-height: 1.35; }

.nrgm-fermer {
	position: absolute;
	top: 0.35rem;
	right: 0.35rem;
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--nrgm-doux);
	font: inherit;
	font-size: 1.3rem;
	line-height: 1;
	cursor: pointer;
}

.nrgm-fermer:hover { background: var(--nrgm-menthe-douce); color: var(--nrgm-encre); }
.nrgm-fermer:focus-visible { outline: 3px solid var(--nrgm-soleil); outline-offset: 1px; }

@media (max-width: 719px) {
	.nrgm-bulle-flottante { left: 0; right: auto; max-width: 100%; }
	.nrgm-bulle-flottante::after { right: auto; left: 2rem; }
}

/* ---------- Carte du comparateur : assise sur le bord haut (pose « perché », assise aux 72 % de sa hauteur) ---------- */

.nrg-sim-card.nrgm-a-carte { position: relative; margin-top: 96px; padding-top: 3.6rem !important; }

.nrgm-carte {
	position: absolute;
	left: 22px;
	top: -89px;
	display: block;
	width: 110px;
	height: auto;
	pointer-events: none;
}

.nrgm-carte-bulle {
	position: absolute;
	left: 140px;
	top: -84px;
	max-width: min(250px, calc(100% - 160px));
	font-size: 0.84rem;
}

@media (max-width: 599px) {
	.nrg-sim-card.nrgm-a-carte { margin-top: 82px; padding-top: 3.2rem !important; }
	.nrgm-carte { left: 14px; top: -75px; width: 92px; }
	.nrgm-carte-bulle { left: 112px; top: -76px; max-width: calc(100% - 120px); padding: 0.5rem 0.7rem; font-size: 0.8rem; }
}

/* ---------- Encadré conseiller : la pose de situation ---------- */

.nrg-advisor.nrgm-a-situation { position: relative; }

.nrgm-situation {
	position: absolute;
	right: 18px;
	bottom: 0;
	display: block;
	width: 128px;
	height: auto;
	pointer-events: none;
}

@media (min-width: 720px) {
	.nrg-advisor.nrgm-a-situation { padding-right: 170px !important; min-height: 150px; }
}

@media (max-width: 719px) {
	.nrg-advisor.nrgm-a-situation { margin-top: 56px !important; }
	.nrgm-situation { top: -52px; bottom: auto; right: 14px; width: 88px; }
	.nrg-advisor.nrgm-a-situation > .nrgm-situation + * { padding-right: 84px; text-wrap: balance; }
}

/* ---------- Encadré de fin : la mascotte au casque ---------- */

.nrg-cta.nrgm-a-casque { position: relative; margin-top: 3rem; }

.nrgm-casque {
	position: absolute;
	left: 22px;
	bottom: 0;
	display: block;
	width: 112px;
	height: auto;
	pointer-events: none;
}

@media (min-width: 720px) {
	.nrg-cta.nrgm-a-casque { padding-left: 150px !important; }
}

@media (max-width: 719px) {
	.nrg-cta.nrgm-a-casque { margin-top: 4rem; padding-top: 3.4rem !important; }
	.nrgm-casque { top: -46px; bottom: auto; left: 18px; width: 86px; }
}

/* ---------- Envoi de documents : cadenas et avion en papier ---------- */

/* La marge est mise sur le texte, pas sur l'encadré : le bandeau du haut (::before) garde toute la largeur. */
.nrg-profile.nrgm-a-cadenas { position: relative; min-height: 110px; }
.nrg-profile.nrgm-a-cadenas > :not(.nrgm-cadenas) { padding-right: 74px; }
.nrgm-cadenas { position: absolute; right: 8px; bottom: 0; display: block; width: 80px; height: auto; pointer-events: none; }

.nrgd-confirmation-tete.nrgm-a-envoi .nrgm-envoi { flex: none; display: block; width: 96px; height: auto; margin-left: auto; }

@media (max-width: 599px) {
	.nrgd-confirmation-tete.nrgm-a-envoi .nrgm-envoi { width: 64px; }
}

/* ---------- Page 404 ---------- */

/* Au-dessus du titre, dans la colonne du texte (pas de flottant : la mise en page du thème l'éviterait mal). */
.nrgm-404 { margin: 0 0 0.75rem; padding: 0; }
.nrgm-404__img { display: block; width: 180px; height: auto; }

@media (max-width: 599px) {
	.nrgm-404__img { width: 140px; }
}

/* ---------- Comparateur : bulle d'une étape ---------- */

.nrgm-guide { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 0.9rem; }
.nrgm-guide__avatar { flex: none; display: block; width: 46px; height: auto; }
.nrgm-guide .nrgm-bulle { font-size: 0.88rem; font-weight: 600; }

/* ---------- Comparateur : animation pendant le calcul des prix ---------- */

.nrgc-reflexion.nrgm-a-attente .nrgc-reflexion__pouls { display: none; }

.nrgm-attente { width: min(210px, 62%); aspect-ratio: 1 / 1; margin: -0.6rem auto -0.9rem; }
.nrgm-attente svg { display: block; width: 100%; height: 100%; overflow: visible; }

@media (min-width: 720px) {
	.nrgc-reflexion.nrgm-a-attente {
		display: grid;
		grid-template-columns: 200px minmax(0, 1fr);
		column-gap: 1.6rem;
		row-gap: 1rem;
		align-items: start;
	}
	.nrgc-reflexion.nrgm-a-attente > * { grid-column: 2; }
	.nrgc-reflexion.nrgm-a-attente > h2 { grid-row: 1; align-self: end; }
	.nrgc-reflexion.nrgm-a-attente > .nrgc-reflexion__etapes { grid-row: 2; }
	.nrgc-reflexion.nrgm-a-attente > .nrgm-attente { grid-column: 1; grid-row: 1 / span 2; width: 200px; margin: 0; align-self: center; }
	.nrgc-reflexion.nrgm-a-attente > .nrgc-reflexion__logos,
	.nrgc-reflexion.nrgm-a-attente > .nrgc-reflexion__passer { grid-column: 1 / -1; }
}

/* Le personnage se balance pendant l'attente, saute quand les prix sont prêts. */
.nrgm-corps { transform-box: fill-box; transform-origin: 50% 100%; }
.nrgm-attente.is-en-cours .nrgm-corps { animation: nrgm-balance 1.3s ease-in-out infinite; }
.nrgm-attente.is-pret .nrgm-corps { animation: nrgm-saut 0.55s cubic-bezier(0.3, 0.7, 0.4, 1) 1; }
@keyframes nrgm-balance { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes nrgm-saut { 0% { transform: translateY(0) scaleY(1); } 20% { transform: translateY(4px) scaleY(0.97); } 55% { transform: translateY(-34px) scaleY(1.02); } 100% { transform: translateY(0) scaleY(1); } }

/* La mèche clignote pendant le calcul. */
.nrgm-meche { opacity: 0; }
.nrgm-attente.is-phase2 .nrgm-meche { animation: nrgm-clignote 1.6s steps(1, end) infinite; }
.nrgm-attente.is-pret .nrgm-meche { animation: nrgm-lueur 0.9s ease-out 1; }
@keyframes nrgm-clignote { 0% { opacity: 0; } 12% { opacity: 1; } 20% { opacity: 0; } 30% { opacity: 1; } 42% { opacity: 0; } 100% { opacity: 0; } }
@keyframes nrgm-lueur { 0% { opacity: 1; } 100% { opacity: 0; } }

/* L'écran de la tablette : la ligne de pouls se dessine, puis bat. */
.nrgm-ligne { fill: none; stroke: var(--nrgm-menthe); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.nrgm-attente.is-en-cours .nrgm-ligne, .nrgm-attente.is-pret .nrgm-ligne { animation: nrgm-trace 1.6s ease-out forwards; }
@keyframes nrgm-trace { to { stroke-dashoffset: 0; } }
.nrgm-battement { fill: none; stroke: #C9FFE6; stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 0.14 0.86; stroke-dashoffset: 1; opacity: 0; }
.nrgm-attente.is-phase2 .nrgm-battement { opacity: 1; animation: nrgm-parcours 1.1s linear infinite; }
@keyframes nrgm-parcours { to { stroke-dashoffset: 0; } }
.nrgm-point { fill: var(--nrgm-soleil); opacity: 0; transform-box: fill-box; transform-origin: center; }
.nrgm-attente.is-en-cours .nrgm-point { animation: nrgm-apparait-point 0.3s 1.5s forwards, nrgm-bat 1.1s 1.8s ease-in-out infinite; }
@keyframes nrgm-apparait-point { to { opacity: 1; } }
@keyframes nrgm-bat { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.45); } }
.nrgm-attente.is-pret .nrgm-point { opacity: 1; }
.nrgm-attente.is-pret .nrgm-ecran-ligne { opacity: 0.28; transition: opacity 0.3s; }

/* Les trois étapes du comparateur, en points sous l'écran. */
.nrgm-pas { fill: #24505A; transition: fill 0.3s; }
.nrgm-pas.is-fait { fill: var(--nrgm-menthe); }

/* Prix prêts : badge jaune coché et étincelles. */
.nrgm-coche { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(0); }
.nrgm-attente.is-pret .nrgm-coche { animation: nrgm-pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) forwards; }
@keyframes nrgm-pop { 0% { opacity: 1; transform: scale(0); } 100% { opacity: 1; transform: scale(1); } }
.nrgm-etincelle { fill: var(--nrgm-soleil); opacity: 0; transform-box: fill-box; transform-origin: center; }
.nrgm-attente.is-pret .nrgm-etincelle { animation: nrgm-etincelle 0.8s ease-out forwards; }
.nrgm-attente.is-pret .nrgm-etincelle--2 { animation-delay: 0.12s; }
@keyframes nrgm-etincelle { 0% { opacity: 0; transform: scale(0.2) rotate(0); } 40% { opacity: 1; transform: scale(1.15) rotate(20deg); } 100% { opacity: 0; transform: scale(0.9) rotate(40deg); } }

/* Animations réduites : image fixe (le comparateur saute d'ailleurs cet écran). */
.nrgm-attente.is-reduit * { animation: none !important; }
.nrgm-attente.is-reduit .nrgm-ligne { stroke-dashoffset: 0; }
.nrgm-attente.is-reduit .nrgm-point { opacity: 1; }
.nrgm-attente.is-reduit.is-pret .nrgm-coche { opacity: 1; transform: none; }

/* ---------- Comparateur : assise sur la carte du niveau conseillé, juste après le badge ---------- */

.nrgc .nrgc-niveau.nrgm-a-perche { margin-top: 92px; padding-top: 2.6rem; }

.nrgm-perche {
	position: absolute;
	left: 160px;
	top: -89px;
	display: block;
	width: 110px;
	height: auto;
	pointer-events: none;
}

@media (max-width: 719px) {
	.nrgc .nrgc-niveau.nrgm-a-perche { margin-top: 80px; padding-top: 2.3rem; }
	.nrgm-perche { left: 150px; top: -75px; width: 92px; }
}

.nrgc-niveau.nrgm-a-raison { flex-wrap: wrap; }

.nrgm-raison {
	display: block;
	flex: 1 0 100%;
	margin-top: 0.1rem;
	padding-left: 0.55rem;
	border-left: 3px solid var(--nrgm-soleil);
	color: var(--nrgm-doux);
	font-size: 0.82rem;
	font-weight: 600;
	line-height: 1.35;
}

/* ---------- Confirmation de la demande ---------- */

.nrgc-merci__tete.nrgm-a-merci { padding-right: 7rem; }

.nrgm-merci {
	position: absolute;
	right: 0.9rem;
	bottom: 0.6rem;
	display: block;
	width: 96px;
	height: auto;
	pointer-events: none;
}

@media (max-width: 599px) {
	.nrgc-merci__tete.nrgm-a-merci { padding-right: 1.25rem; }
	.nrgm-merci { top: 0.8rem; bottom: auto; width: 66px; }
}

@media (min-width: 720px) {
	.nrgc-merci__tete.nrgm-a-merci { padding-right: 10rem; min-height: 150px; }
	.nrgm-merci { width: 130px; right: 1.4rem; bottom: 0.8rem; }
}

/* ---------- Formulaire « Être contacté par un conseiller » ---------- */

.nrgm-rappel { float: right; display: block; width: 92px; height: auto; margin: -0.25rem 0 0.5rem 1rem; }
.nrgm-a-rappel .nrgc-form { clear: both; }
/* Étape « Coordonnées » du comparateur : même casque, à droite du titre. */
.nrgm-rappel ~ .nrgc-form { clear: both; }

@media (min-width: 720px) {
	.nrgm-rappel { width: 128px; margin: -0.75rem 0 0.25rem 1.5rem; }
}

/* ---------- Envoi de documents : la note ---------- */

.nrgm-note { display: flex; align-items: center; gap: 0.6rem; margin: 0.6rem 0 1rem; color: var(--nrgm-doux); font-size: 0.9rem; font-weight: 600; }
.nrgm-note__avatar { flex: none; display: block; width: 30px; height: auto; }

/* ---------- Code court [nrg_mascotte] ---------- */

.nrgm-bloc { display: flex; align-items: flex-end; justify-content: flex-end; gap: 0.4rem; margin: 1rem 0; }
.nrgm-bloc .nrgm-bulle { max-width: 280px; margin-bottom: 48px; }
.nrgm-bloc__img { display: block; flex: none; width: 120px; height: auto; }
.nrgm-bloc--gauche { flex-direction: row-reverse; justify-content: flex-end; }
.nrgm-bloc--gauche .nrgm-bulle::after { right: auto; left: -9px; border: 0; border-left: 2px solid var(--nrgm-ligne); border-bottom: 2px solid var(--nrgm-ligne); }
.nrgm-bloc--centre { justify-content: center; }

@media (max-width: 599px) {
	.nrgm-bloc__img { width: 96px; }
	.nrgm-bloc .nrgm-bulle { margin-bottom: 36px; font-size: 0.85rem; }
}

/* ---------- Code court [nrg_mascotte_decrypte] ---------- */

.nrgm-decrypte {
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr);
	gap: 1rem;
	align-items: start;
	margin: 1.75rem 0;
	padding: 1.1rem 1.25rem;
	border-radius: 20px;
	background: var(--nrgm-menthe-douce);
	border-left: 5px solid var(--nrgm-emeraude);
}

.nrgm-decrypte--sans { grid-template-columns: minmax(0, 1fr); }
.nrgm-decrypte__img { display: block; width: 96px; height: auto; }
.nrgm-decrypte__sur { margin: 0 !important; color: var(--nrgm-emeraude); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.nrgm-decrypte__titre { margin: 0.15rem 0 0.35rem !important; color: var(--nrgm-encre); font-size: 1.05rem; font-weight: 800; }
.nrgm-decrypte__texte > :last-child { margin-bottom: 0; }

@media (max-width: 599px) {
	.nrgm-decrypte { grid-template-columns: 64px minmax(0, 1fr); gap: 0.75rem; padding: 0.95rem 1rem; }
	.nrgm-decrypte__img { width: 64px; }
}

/* ---------- Animations réduites ---------- */

@media (prefers-reduced-motion: reduce) {
	.nrgm-bulle-flottante { transition: none; transform: none; }
	.nrgm-attente * { animation: none !important; }
	.nrgm-attente .nrgm-ligne { stroke-dashoffset: 0; }
	.nrgm-attente .nrgm-point { opacity: 1; }
}
