/* JS – Devis — v1.3.2
 * ARCHITECTURE ANTI-DÉBORDEMENT (tdll-devis 2.0) :
 * racine en overflow-x: clip (jamais hidden) ; popup déplacée en fin de body ;
 * aucun élément hors flux dans le formulaire (pot de miel au motif standard) ;
 * min-width:0 sur tous les descendants ; overflow-wrap: anywhere sur les textes
 * qui doivent se réduire, break-word sur les libellés de bouton ; aucune unité
 * vw, aucune marge négative, aucune largeur fixe ; grilles en minmax(0, …) ;
 * récapitulatif en simple liste ; champs ≥ 16px en mobile (zoom iOS).
 */

.js-d {
	--js-pad-x: 0px;
	--js-d-maxw: 880px;
	--js-d-cols: 3;
	--js-d-cards-gap: 14px;
	--js-d-accent: #4a7326;
	--js-d-accent2: #3e6d2c;
	--js-d-soft: #eaf2df;
	--js-d-title: #000101;
	--js-d-text: #5b6a56;
	--js-d-border: #d6e2cb;
	--js-d-error: #c2410c;
	--js-d-btn-bg: #4a7326;
	--js-d-btn-bg2: #3e6d2c;
	--js-d-btn-bg-h: #3e6d2c;
	--js-d-btn-bg2-h: #2f5421;
	--js-d-btn-txt: #ffffff;
	--js-d-btn-txt-h: #ffffff;
	--js-d-btn-radius: 12px;

	position: relative;
	max-width: 100%;
	overflow-x: clip;
	padding-left: var(--js-pad-x);
	padding-right: var(--js-pad-x);
	font-family: 'Noto Sans', sans-serif;
	color: var(--js-d-text);
}
.js-d :where(h1, h2, h3, h4, h5, h6, p, ol, ul, li, fieldset, legend) {
	margin: 0; padding: 0; letter-spacing: normal; text-transform: none; clear: none;
}
.js-d :where(*) { min-width: 0; }
.js-d [hidden] { display: none !important; }
.js-d :where(p, span, label, div) { overflow-wrap: anywhere; }
.js-d button { background: none; border: 0; cursor: pointer; font: inherit; color: inherit; padding: 0; }
/* NB : ce reset est en (0,1,1) — toute règle de bouton ci-dessous DOIT être
 * préfixée .js-d pour peser (0,2,0), sinon elle est écrasée (bug v1.0.0). */

/* Pot de miel — motif standard (n'étend JAMAIS la zone de rendu). */
.js-d__hp {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ---------- Fil d'avancement ---------- */
.js-d__progress {
	list-style: none;
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px 22px;
	max-width: var(--js-d-maxw);
	margin: 0 auto 26px;
}
.js-d__prog {
	display: inline-flex;
	align-items: center;
	color: var(--js-d-text);
	font-size: 13.5px;
	font-weight: 600;
	border-radius: 999px;
	padding: 5px 6px;
	transition: background .25s ease, box-shadow .25s ease;
}
.js-d__prog.is-current {
	background: #f1f5ec;
	padding-right: 16px;
	box-shadow: inset 0 0 0 1px rgba(74,115,38, .18);
}
.js-d__prog-dot {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 999px;
	background: #eef2ea;
	color: var(--js-d-text);
	font-family: 'Montserrat', sans-serif;
	font-size: 13px;
	font-weight: 700;
	margin-right: 8px !important;
	flex: 0 0 auto;
	transition: background .25s ease, color .25s ease;
}
.js-d__prog.is-current { color: var(--js-d-title); }
.js-d__prog.is-current .js-d__prog-dot,
.js-d__prog.is-done .js-d__prog-dot {
	background: linear-gradient(135deg, var(--js-d-accent), var(--js-d-accent2));
	color: #ffffff;
	box-shadow: 0 4px 10px rgba(62,109,44, .3);
}
/* Étape faite : le numéro cède la place à une coche. */
.js-d__prog.is-done .js-d__prog-dot { font-size: 0; }
.js-d__prog.is-done .js-d__prog-dot::after { content: '✓'; font-size: 14px; }
@media (max-width: 767px) {
	.js-d__progress { gap: 6px 12px; }
	.js-d__prog:not(.is-current) .js-d__prog-label { display: none; }
}

/* ---------- Étapes ---------- */
.js-d__form { max-width: var(--js-d-maxw); margin: 0 auto; }
.js-d .js-d__step-title {
	color: var(--js-d-title);
	font-family: 'Montserrat', sans-serif;
	font-size: 23px;
	font-weight: 700;
	margin-bottom: 8px;
}
.js-d .js-d__step-title::after {
	content: '';
	display: block;
	width: 48px;
	height: 4px;
	border-radius: 4px;
	background: linear-gradient(90deg, var(--js-d-accent), #9fd36d);
	margin-top: 9px;
}
.js-d .js-d__step-hint { font-size: 14.5px; margin-bottom: 16px; }
.js-d__step > .js-d__step-title:only-of-type { margin-bottom: 16px; }

/* ---------- Cartes de prestations ---------- */
.js-d__cards {
	display: grid;
	grid-template-columns: repeat(var(--js-d-cols), minmax(0, 1fr));
	gap: var(--js-d-cards-gap);
}
/* Label en flex : la face s'étire à la hauteur de rangée SANS height:100%
 * (circulaire — la face débordait de sa rangée et recouvrait la navigation). */
.js-d__card { position: relative; display: flex; cursor: pointer; min-width: 0; }
.js-d__card input {
	position: absolute;
	width: 1px; height: 1px;
	margin: -1px; overflow: hidden;
	clip: rect(0 0 0 0); clip-path: inset(50%);
}
.js-d__card-face {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	width: 100%;
	padding: 20px 12px 18px;
	background: #ffffff;
	border: 2px solid #e4ebdd;
	border-radius: 16px;
	box-shadow: 0 3px 12px rgba(0,1,1, .06);
	transition: border-color .25s ease, box-shadow .25s ease, background .25s ease, transform .25s ease;
}
.js-d__card:hover .js-d__card-face {
	border-color: #a7c894;
	transform: translateY(-3px);
	box-shadow: 0 10px 24px rgba(0,1,1, .12);
}
.js-d__card input:focus-visible + .js-d__card-face { outline: 2px solid var(--js-d-title); outline-offset: 2px; }
.js-d__card input:checked + .js-d__card-face {
	border-color: var(--js-d-accent);
	background: linear-gradient(180deg, #f4f8f0, #f1f5ec);
	box-shadow: 0 8px 20px rgba(62,109,44, .18);
}
.js-d__card-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: 15px;
	box-shadow: inset 0 0 0 1px rgba(62,109,44, .12);
	background: var(--js-d-soft);
	color: var(--js-d-accent2);
	font-size: 20px;
	margin-bottom: 10px !important;
	flex: 0 0 auto;
	transition: background .25s ease, color .25s ease;
}
.js-d__card-icon i, .js-d__card-icon i::before, .js-d__card-icon svg { line-height: 1 !important; vertical-align: middle; }
.js-d__card-icon svg { width: 1em; height: 1em; fill: currentColor; }
.js-d__card input:checked + .js-d__card-face .js-d__card-icon {
	background: linear-gradient(135deg, var(--js-d-accent), var(--js-d-accent2));
	color: #ffffff;
}
.js-d__card-name {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--js-d-title);
	min-width: 0;
	overflow-wrap: anywhere; /* libellé de carte en flex : doit pouvoir se réduire */
}
.js-d__card-check {
	position: absolute;
	top: 8px;
	right: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 999px;
	background: var(--js-d-accent);
	color: #ffffff;
	opacity: 0;
	transform: scale(.5);
	transition: opacity .2s ease, transform .25s cubic-bezier(.3, 1.4, .5, 1);
}
.js-d__card-check svg { width: 12px; height: 12px; }
.js-d__card input:checked + .js-d__card-face .js-d__card-check { opacity: 1; transform: scale(1); }

/* Défauts responsive des cases — portés par le plugin (3/2/2),
 * les valeurs Elementor reprennent la main normalement. */
@media (max-width: 1024px) { .js-d { --js-d-cols: 2; } }
@media (max-width: 767px)  { .js-d { --js-d-cols: 2; } }

/* ---------- Champs & pastilles ---------- */
.js-d__field { margin-bottom: 18px; }
.js-d .js-d__label {
	display: block;
	color: var(--js-d-title);
	font-size: 14.5px;
	font-weight: 600;
	margin-bottom: 8px;
}
.js-d .js-d__label em { color: var(--js-d-error); font-style: normal; }

.js-d__pills { display: flex; flex-wrap: wrap; gap: 10px; }
.js-d__pill { position: relative; cursor: pointer; min-width: 0; }
.js-d__pill input {
	position: absolute;
	width: 1px; height: 1px;
	margin: -1px; overflow: hidden;
	clip: rect(0 0 0 0); clip-path: inset(50%);
}
.js-d__pill-face {
	display: inline-flex;
	align-items: center;
	max-width: 100%;
	padding: 10px 17px;
	border: 2px solid var(--js-d-border);
	border-radius: 999px;
	background: #ffffff;
	color: var(--js-d-title);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.25;
	overflow-wrap: break-word; /* la largeur suit le contenu : jamais anywhere */
	transition: border-color .22s ease, background .22s ease, color .22s ease;
}
.js-d__pill:hover .js-d__pill-face { border-color: #cfe0c0; }
.js-d__pill input:focus-visible + .js-d__pill-face { outline: 2px solid var(--js-d-title); outline-offset: 2px; }
.js-d__pill input:checked + .js-d__pill-face {
	border-color: var(--js-d-accent);
	background: linear-gradient(135deg, var(--js-d-accent), var(--js-d-accent2));
	color: #ffffff;
}

.js-d .js-d__input {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 12px 15px;
	border: 2px solid var(--js-d-border);
	border-radius: 12px;
	background: #ffffff;
	color: var(--js-d-title);
	font-family: inherit;
	font-size: 15.5px;
	line-height: 1.5;
	transition: border-color .22s ease, box-shadow .22s ease;
}
.js-d .js-d__input:focus {
	outline: none;
	border-color: var(--js-d-accent);
	box-shadow: 0 0 0 3px rgba(74,115,38, .15);
}
.js-d .js-d__textarea { resize: vertical; min-height: 110px; }

/* Menus déroulants — chevron dessiné, apparence native neutralisée. */
.js-d__select-wrap { position: relative; display: block; }
.js-d .js-d__select {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 42px;
	cursor: pointer;
	color: var(--js-d-title);
}
.js-d .js-d__select:invalid { color: #8a9585; } /* placeholder « — Choisir — » grisé */
.js-d__select-wrap::after {
	content: '';
	position: absolute;
	top: 50%;
	right: 16px;
	width: 10px;
	height: 10px;
	border-right: 2.5px solid var(--js-d-accent2);
	border-bottom: 2.5px solid var(--js-d-accent2);
	transform: translateY(-70%) rotate(45deg);
	pointer-events: none;
}
.js-d__grid2 {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 18px;
}
@media (max-width: 640px) {
	.js-d__grid2 { grid-template-columns: minmax(0, 1fr); }
	/* iOS zoome sous 16px à la mise au point. */
	.js-d .js-d__input { font-size: 16px; }
}

/* Champ invalide — SEULEMENT après tentative (jamais au chargement). */
.js-d__step.is-attempted .js-d__input:invalid { border-color: var(--js-d-error); }
.js-d .js-d__error {
	color: var(--js-d-error);
	font-size: 14px;
	font-weight: 600;
	margin-top: 12px;
}

/* ---------- RGPD ---------- */
.js-d__gdpr {
	display: flex;
	align-items: flex-start;
	cursor: pointer;
	margin-top: 4px;
}
.js-d__gdpr input {
	position: absolute;
	width: 1px; height: 1px;
	margin: -1px; overflow: hidden;
	clip: rect(0 0 0 0); clip-path: inset(50%);
}
.js-d__gdpr-box {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border: 2px solid var(--js-d-border);
	border-radius: 7px;
	background: #ffffff;
	color: #ffffff;
	flex: 0 0 auto;
	margin-right: 10px !important;
	margin-top: 2px;
	transition: background .2s ease, border-color .2s ease;
}
.js-d__gdpr-box svg { width: 13px; height: 13px; opacity: 0; transition: opacity .15s ease; }
.js-d__gdpr input:checked + .js-d__gdpr-box { background: var(--js-d-accent); border-color: var(--js-d-accent); }
.js-d__gdpr input:checked + .js-d__gdpr-box svg { opacity: 1; }
.js-d__gdpr input:focus-visible + .js-d__gdpr-box { outline: 2px solid var(--js-d-title); outline-offset: 2px; }
.js-d__gdpr-text { font-size: 13.5px; line-height: 1.6; }
.js-d__gdpr-text a { color: var(--js-d-accent2); font-weight: 600; }
.js-d__gdpr-text em { color: var(--js-d-error); font-style: normal; }

/* ---------- Récapitulatif — liste compacte : libellé à gauche, valeur à droite dès 560px. ---------- */
.js-d__recap {
	background: #f4f8f0;
	border-radius: 14px;
	padding: 6px 18px;
}
.js-d__recap-item { display: flex; flex-direction: column; padding: 9px 0; border-bottom: 1px solid rgba(0,1,1, .07); min-width: 0; }
.js-d__recap-item:last-child { border-bottom: 0; }
.js-d__recap-label {
	display: block;
	flex: 0 0 auto;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: var(--js-d-accent2);
	line-height: 1.4;
	margin-bottom: 1px;
}
.js-d__recap-value {
	display: block;
	flex: 1 1 auto;
	min-width: 0;
	font-size: 14.5px;
	color: var(--js-d-title);
	font-weight: 600;
	line-height: 1.45;
	overflow-wrap: anywhere; /* e-mails et descriptions longues */
}
@media (min-width: 560px) {
	.js-d__recap-item { flex-direction: row; align-items: baseline; padding: 8px 0; }
	.js-d__recap-label { width: 150px; margin: 0 14px 0 0; }
}

/* ---------- Navigation ---------- */
.js-d__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	max-width: var(--js-d-maxw);
	margin: 24px auto 0;
}
.js-d .js-d__prev {
	padding: 11px 20px;
	height: auto;
	min-height: 0;
	line-height: 1.2;
	border-radius: var(--js-d-btn-radius);
	border: 2px solid var(--js-d-border);
	background: #ffffff;
	color: var(--js-d-title);
	font-family: 'Montserrat', sans-serif;
	font-weight: 600;
	font-size: 14.5px;
	text-transform: none;
	letter-spacing: normal;
	transition: border-color .22s ease, background .22s ease, transform .22s ease;
}
.js-d .js-d__prev:hover { border-color: var(--js-d-accent); background: #f1f5ec; transform: translateY(-2px); }
.js-d .js-d__next, .js-d .js-d__submit {
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	max-width: 100%;
	padding: 12px 24px;
	height: auto;
	min-height: 0;
	line-height: 1.2;
	border-radius: var(--js-d-btn-radius);
	background: linear-gradient(135deg, var(--js-d-btn-bg), var(--js-d-btn-bg2));
	color: var(--js-d-btn-txt);
	font-family: 'Montserrat', sans-serif;
	font-size: 15px;
	text-transform: none;
	font-weight: 700;
	letter-spacing: .01em;
	box-shadow: 0 8px 20px rgba(62,109,44, .28), inset 0 1px 0 rgba(255, 255, 255, .22);
	transition: background .25s ease, color .25s ease, transform .25s ease, box-shadow .25s ease, opacity .25s ease;
}
.js-d .js-d__next:hover, .js-d .js-d__submit:hover {
	background: linear-gradient(135deg, var(--js-d-btn-bg-h), var(--js-d-btn-bg2-h));
	color: var(--js-d-btn-txt-h);
	transform: translateY(-2px);
	box-shadow: 0 12px 26px rgba(62,109,44, .34), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.js-d .js-d__next:focus-visible, .js-d .js-d__submit:focus-visible, .js-d .js-d__prev:focus-visible {
	outline: 2px solid var(--js-d-title);
	outline-offset: 3px;
}
.js-d__submit-label { overflow-wrap: break-word; }
.js-d .js-d__submit[disabled] { opacity: .6; transform: none; cursor: default; }
.js-d__spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, .4);
	border-top-color: #ffffff;
	border-radius: 999px;
	margin-left: 10px !important;
	flex: 0 0 auto;
	animation: js-d-spin .8s linear infinite;
}
@keyframes js-d-spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) {
	.js-d .js-d__prev, .js-d .js-d__next, .js-d .js-d__submit { width: 100%; margin-left: 0; }
}

/* ---------- Popup (rattachée à <body> par le JS, variables recopiées). ---------- */
/* Une fois déplacée en fin de body, la popup sort de la portée du garde
 * .js-d [hidden] — son propre garde doit voyager avec elle, sinon le
 * display:flex bat l'attribut hidden et elle couvre toute la page. */
.js-d__modal[hidden] { display: none !important; }
.js-d__modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.js-d__modal-veil {
	position: absolute;
	inset: 0;
	background: rgba(0,1,1, .55);
	backdrop-filter: blur(3px);
}
.js-d__modal-card {
	position: relative;
	background: #ffffff;
	border-radius: 20px;
	padding: 34px 28px 28px;
	max-width: 430px;
	width: 100%;
	text-align: center;
	box-shadow: 0 30px 70px rgba(0,1,1, .35);
	animation: js-d-pop .45s cubic-bezier(.3, 1.4, .5, 1);
}
@keyframes js-d-pop { from { opacity: 0; transform: translateY(18px) scale(.96); } }
/* Marque : logo rond en vedette, coche animée posée en badge (cachet). */
.js-d__modal-brand {
	position: relative;
	display: inline-flex;
	margin-bottom: 16px;
}
.js-d__modal-logo {
	width: 92px;
	height: 92px;
	border-radius: 50%;
	object-fit: cover;
	display: block;
	background: #ffffff;
	box-shadow: 0 0 0 5px #ffffff, 0 0 0 6px rgba(0,1,1, .08), 0 12px 28px rgba(0,1,1, .18);
}
.js-d__modal-check {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--js-d-accent, #4a7326);
	width: 46px;
	height: 46px;
	position: absolute;
	right: -8px;
	bottom: -8px;
	background: #ffffff;
	border-radius: 50%;
	padding: 5px;
	box-shadow: 0 6px 16px rgba(0,1,1, .22);
}
/* Sans logo : la coche seule, en grand, reprend la vedette. */
.js-d__modal-brand--nologo .js-d__modal-check {
	position: static;
	width: 74px;
	height: 74px;
	background: transparent;
	box-shadow: none;
	padding: 0;
}
.js-d__modal-check svg { width: 100%; height: 100%; }
.js-d__mc-circle {
	stroke-dasharray: 145;
	stroke-dashoffset: 145;
	animation: js-d-draw .7s ease-out .1s forwards;
}
.js-d__mc-tick {
	stroke-dasharray: 34;
	stroke-dashoffset: 34;
	animation: js-d-draw .45s ease-out .65s forwards;
}
@keyframes js-d-draw { to { stroke-dashoffset: 0; } }
.js-d__modal-title {
	margin: 0 0 8px;
	color: var(--js-d-title, #000101);
	font-family: 'Montserrat', sans-serif;
	font-size: 22px;
	font-weight: 700;
	letter-spacing: normal;
}
.js-d__modal-text {
	margin: 0 0 20px;
	color: var(--js-d-text, #5b6a56);
	font-family: 'Noto Sans', sans-serif;
	font-size: 15px;
	line-height: 1.7;
	overflow-wrap: anywhere;
}
.js-d__modal-close {
	display: inline-flex;
	padding: 12px 30px;
	border-radius: 12px;
	background: linear-gradient(135deg, var(--js-d-accent, #4a7326), var(--js-d-accent2, #3e6d2c));
	color: #ffffff;
	font-family: 'Montserrat', sans-serif;
	font-size: 15px;
	font-weight: 700;
	border: 0;
	cursor: pointer;
}
.js-d__modal-close:focus-visible { outline: 2px solid #000101; outline-offset: 3px; }

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
	.js-d *, .js-d *::before, .js-d *::after,
	.js-d__modal, .js-d__modal * { transition: none !important; animation: none !important; }
	.js-d__mc-circle, .js-d__mc-tick { stroke-dashoffset: 0; }
}
