/* WB – Devis — v1.3.0
 * 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).
 */

.wb-d {
	--wb-pad-x: 0px;
	--wb-d-maxw: 880px;
	--wb-d-cols: 3;
	--wb-d-cards-gap: 14px;
	--wb-d-accent: #35852c;
	--wb-d-accent2: #256b1c;
	--wb-d-soft: #e4f3e2;
	--wb-d-title: #072032;
	--wb-d-text: #5c6972;
	--wb-d-border: #d9e1e7;
	--wb-d-error: #c2410c;
	--wb-d-btn-bg: #35852c;
	--wb-d-btn-bg2: #256b1c;
	--wb-d-btn-bg-h: #2f7a27;
	--wb-d-btn-bg2-h: #1f5c17;
	--wb-d-btn-txt: #ffffff;
	--wb-d-btn-txt-h: #ffffff;
	--wb-d-btn-radius: 12px;

	position: relative;
	max-width: 100%;
	overflow-x: clip;
	padding-left: var(--wb-pad-x);
	padding-right: var(--wb-pad-x);
	font-family: 'Noto Sans', sans-serif;
	color: var(--wb-d-text);
}
.wb-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;
}
.wb-d :where(*) { min-width: 0; }
.wb-d [hidden] { display: none !important; }
.wb-d :where(p, span, label, div) { overflow-wrap: anywhere; }
.wb-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 .wb-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). */
.wb-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 ---------- */
.wb-d__progress {
	list-style: none;
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px 22px;
	max-width: var(--wb-d-maxw);
	margin: 0 auto 26px;
}
.wb-d__prog {
	display: inline-flex;
	align-items: center;
	color: var(--wb-d-text);
	font-size: 13.5px;
	font-weight: 600;
	border-radius: 999px;
	padding: 5px 6px;
	transition: background .25s ease, box-shadow .25s ease;
}
.wb-d__prog.is-current {
	background: #f2f9f0;
	padding-right: 16px;
	box-shadow: inset 0 0 0 1px rgba(53, 133, 44, .18);
}
.wb-d__prog-dot {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 999px;
	background: #eef1f4;
	color: var(--wb-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;
}
.wb-d__prog.is-current { color: var(--wb-d-title); }
.wb-d__prog.is-current .wb-d__prog-dot,
.wb-d__prog.is-done .wb-d__prog-dot {
	background: linear-gradient(135deg, var(--wb-d-accent), var(--wb-d-accent2));
	color: #ffffff;
	box-shadow: 0 4px 10px rgba(37, 107, 28, .3);
}
/* Étape faite : le numéro cède la place à une coche. */
.wb-d__prog.is-done .wb-d__prog-dot { font-size: 0; }
.wb-d__prog.is-done .wb-d__prog-dot::after { content: '✓'; font-size: 14px; }
@media (max-width: 767px) {
	.wb-d__progress { gap: 6px 12px; }
	.wb-d__prog:not(.is-current) .wb-d__prog-label { display: none; }
}

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

/* ---------- Cartes de prestations ---------- */
.wb-d__cards {
	display: grid;
	grid-template-columns: repeat(var(--wb-d-cols), minmax(0, 1fr));
	gap: var(--wb-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). */
.wb-d__card { position: relative; display: flex; cursor: pointer; min-width: 0; }
.wb-d__card input {
	position: absolute;
	width: 1px; height: 1px;
	margin: -1px; overflow: hidden;
	clip: rect(0 0 0 0); clip-path: inset(50%);
}
.wb-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 #e6ebef;
	border-radius: 16px;
	box-shadow: 0 3px 12px rgba(7, 32, 50, .06);
	transition: border-color .25s ease, box-shadow .25s ease, background .25s ease, transform .25s ease;
}
.wb-d__card:hover .wb-d__card-face {
	border-color: #9fc79a;
	transform: translateY(-3px);
	box-shadow: 0 10px 24px rgba(7, 32, 50, .12);
}
.wb-d__card input:focus-visible + .wb-d__card-face { outline: 2px solid var(--wb-d-title); outline-offset: 2px; }
.wb-d__card input:checked + .wb-d__card-face {
	border-color: var(--wb-d-accent);
	background: linear-gradient(180deg, #f6fbf4, #eef7ec);
	box-shadow: 0 8px 20px rgba(37, 107, 28, .18);
}
.wb-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(37, 107, 28, .12);
	background: var(--wb-d-soft);
	color: var(--wb-d-accent2);
	font-size: 20px;
	margin-bottom: 10px !important;
	flex: 0 0 auto;
	transition: background .25s ease, color .25s ease;
}
.wb-d__card-icon i, .wb-d__card-icon i::before, .wb-d__card-icon svg { line-height: 1 !important; vertical-align: middle; }
.wb-d__card-icon svg { width: 1em; height: 1em; fill: currentColor; }
.wb-d__card input:checked + .wb-d__card-face .wb-d__card-icon {
	background: linear-gradient(135deg, var(--wb-d-accent), var(--wb-d-accent2));
	color: #ffffff;
}
.wb-d__card-name {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--wb-d-title);
	min-width: 0;
	overflow-wrap: anywhere; /* libellé de carte en flex : doit pouvoir se réduire */
}
.wb-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(--wb-d-accent);
	color: #ffffff;
	opacity: 0;
	transform: scale(.5);
	transition: opacity .2s ease, transform .25s cubic-bezier(.3, 1.4, .5, 1);
}
.wb-d__card-check svg { width: 12px; height: 12px; }
.wb-d__card input:checked + .wb-d__card-face .wb-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) { .wb-d { --wb-d-cols: 2; } }
@media (max-width: 767px)  { .wb-d { --wb-d-cols: 2; } }

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

.wb-d__pills { display: flex; flex-wrap: wrap; gap: 10px; }
.wb-d__pill { position: relative; cursor: pointer; min-width: 0; }
.wb-d__pill input {
	position: absolute;
	width: 1px; height: 1px;
	margin: -1px; overflow: hidden;
	clip: rect(0 0 0 0); clip-path: inset(50%);
}
.wb-d__pill-face {
	display: inline-flex;
	align-items: center;
	max-width: 100%;
	padding: 10px 17px;
	border: 2px solid var(--wb-d-border);
	border-radius: 999px;
	background: #ffffff;
	color: var(--wb-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;
}
.wb-d__pill:hover .wb-d__pill-face { border-color: #b9cfc0; }
.wb-d__pill input:focus-visible + .wb-d__pill-face { outline: 2px solid var(--wb-d-title); outline-offset: 2px; }
.wb-d__pill input:checked + .wb-d__pill-face {
	border-color: var(--wb-d-accent);
	background: linear-gradient(135deg, var(--wb-d-accent), var(--wb-d-accent2));
	color: #ffffff;
}

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

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

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

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

/* ---------- Récapitulatif — simple liste. ---------- */
.wb-d__recap {
	background: #f6f9f5;
	border-radius: 14px;
	padding: 18px 20px;
}
.wb-d__recap-item { padding: 8px 0; border-bottom: 1px solid rgba(7, 32, 50, .07); }
.wb-d__recap-item:last-child { border-bottom: 0; }
.wb-d__recap-label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 1.2px;
	text-transform: uppercase;
	color: var(--wb-d-accent2);
	margin-bottom: 2px;
}
.wb-d__recap-value {
	display: block;
	font-size: 14.5px;
	color: var(--wb-d-title);
	font-weight: 600;
	line-height: 1.55;
	overflow-wrap: anywhere; /* e-mails et descriptions longues */
}

/* ---------- Navigation ---------- */
.wb-d__nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	max-width: var(--wb-d-maxw);
	margin: 24px auto 0;
}
.wb-d .wb-d__prev {
	padding: 14px 24px;
	border-radius: var(--wb-d-btn-radius);
	border: 2px solid var(--wb-d-border);
	background: #ffffff;
	color: var(--wb-d-title);
	font-family: 'Montserrat', sans-serif;
	font-weight: 600;
	font-size: 15px;
	transition: border-color .22s ease, background .22s ease, transform .22s ease;
}
.wb-d .wb-d__prev:hover { border-color: var(--wb-d-accent); background: #f4faf3; transform: translateY(-2px); }
.wb-d .wb-d__next, .wb-d .wb-d__submit {
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	max-width: 100%;
	padding: 15px 32px;
	border-radius: var(--wb-d-btn-radius);
	background: linear-gradient(135deg, var(--wb-d-btn-bg), var(--wb-d-btn-bg2));
	color: var(--wb-d-btn-txt);
	font-family: 'Montserrat', sans-serif;
	font-size: 15.5px;
	font-weight: 700;
	letter-spacing: .01em;
	box-shadow: 0 8px 20px rgba(37, 107, 28, .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;
}
.wb-d .wb-d__next:hover, .wb-d .wb-d__submit:hover {
	background: linear-gradient(135deg, var(--wb-d-btn-bg-h), var(--wb-d-btn-bg2-h));
	color: var(--wb-d-btn-txt-h);
	transform: translateY(-2px);
	box-shadow: 0 12px 26px rgba(37, 107, 28, .34), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.wb-d .wb-d__next:focus-visible, .wb-d .wb-d__submit:focus-visible, .wb-d .wb-d__prev:focus-visible {
	outline: 2px solid var(--wb-d-title);
	outline-offset: 3px;
}
.wb-d__submit-label { overflow-wrap: break-word; }
.wb-d .wb-d__submit[disabled] { opacity: .6; transform: none; cursor: default; }
.wb-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: wb-d-spin .8s linear infinite;
}
@keyframes wb-d-spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) {
	.wb-d .wb-d__prev, .wb-d .wb-d__next, .wb-d .wb-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
 * .wb-d [hidden] — son propre garde doit voyager avec elle, sinon le
 * display:flex bat l'attribut hidden et elle couvre toute la page. */
.wb-d__modal[hidden] { display: none !important; }
.wb-d__modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.wb-d__modal-veil {
	position: absolute;
	inset: 0;
	background: rgba(7, 32, 50, .55);
	backdrop-filter: blur(3px);
}
.wb-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(7, 32, 50, .35);
	animation: wb-d-pop .45s cubic-bezier(.3, 1.4, .5, 1);
}
@keyframes wb-d-pop { from { opacity: 0; transform: translateY(18px) scale(.96); } }
/* Marque : logo rond en vedette, coche animée posée en badge (cachet). */
.wb-d__modal-brand {
	position: relative;
	display: inline-flex;
	margin-bottom: 16px;
}
.wb-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(7, 32, 50, .08), 0 12px 28px rgba(7, 32, 50, .18);
}
.wb-d__modal-check {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--wb-d-accent, #35852c);
	width: 46px;
	height: 46px;
	position: absolute;
	right: -8px;
	bottom: -8px;
	background: #ffffff;
	border-radius: 50%;
	padding: 5px;
	box-shadow: 0 6px 16px rgba(7, 32, 50, .22);
}
/* Sans logo : la coche seule, en grand, reprend la vedette. */
.wb-d__modal-brand--nologo .wb-d__modal-check {
	position: static;
	width: 74px;
	height: 74px;
	background: transparent;
	box-shadow: none;
	padding: 0;
}
.wb-d__modal-check svg { width: 100%; height: 100%; }
.wb-d__mc-circle {
	stroke-dasharray: 145;
	stroke-dashoffset: 145;
	animation: wb-d-draw .7s ease-out .1s forwards;
}
.wb-d__mc-tick {
	stroke-dasharray: 34;
	stroke-dashoffset: 34;
	animation: wb-d-draw .45s ease-out .65s forwards;
}
@keyframes wb-d-draw { to { stroke-dashoffset: 0; } }
.wb-d__modal-title {
	margin: 0 0 8px;
	color: var(--wb-d-title, #072032);
	font-family: 'Montserrat', sans-serif;
	font-size: 22px;
	font-weight: 700;
	letter-spacing: normal;
}
.wb-d__modal-text {
	margin: 0 0 20px;
	color: var(--wb-d-text, #5c6972);
	font-family: 'Noto Sans', sans-serif;
	font-size: 15px;
	line-height: 1.7;
	overflow-wrap: anywhere;
}
.wb-d__modal-close {
	display: inline-flex;
	padding: 12px 30px;
	border-radius: 12px;
	background: linear-gradient(135deg, var(--wb-d-accent, #35852c), var(--wb-d-accent2, #256b1c));
	color: #ffffff;
	font-family: 'Montserrat', sans-serif;
	font-size: 15px;
	font-weight: 700;
	border: 0;
	cursor: pointer;
}
.wb-d__modal-close:focus-visible { outline: 2px solid #072032; outline-offset: 3px; }

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