/**
 * Styles côté visiteur — Configurateur de Projet.
 * Utilise des variables CSS injectées par le design admin.
 */

.peb-wrap {
	--peb-primary: #4f46e5;
	--peb-secondary: #111827;
	--peb-button: #4f46e5;
	--peb-progress: #4f46e5;
	--peb-text: #111827;
	--peb-bg: #f3f4f6;
	--peb-card-bg: #ffffff;
	--peb-radius: 16px;
	--peb-font: inherit;

	box-sizing: border-box;
	width: 100%;
	padding: 40px 16px;
	background-color: var(--peb-bg);
	background-size: cover;
	background-position: center;
	font-family: var(--peb-font);
	color: var(--peb-text);
}

.peb-wrap *,
.peb-wrap *::before,
.peb-wrap *::after {
	box-sizing: border-box;
}

.peb-card-wrap {
	max-width: 860px;
	margin: 0 auto;
	background: var(--peb-card-bg);
	border-radius: calc(var(--peb-radius) + 6px);
	box-shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
	padding: 32px 32px 28px;
}

.peb-logo {
	text-align: center;
	margin-bottom: 18px;
}
.peb-logo img {
	max-height: 56px;
	width: auto;
}

/* Barre de progression */
.peb-progress {
	height: 6px;
	border-radius: 999px;
	background: rgba(15, 23, 42, 0.08);
	overflow: hidden;
	margin-bottom: 26px;
}
.peb-progress-bar {
	height: 100%;
	background: var(--peb-progress);
	border-radius: 999px;
	transition: width 0.35s ease;
}

/* Étapes */
.peb-step-head {
	text-align: center;
	margin-bottom: 24px;
}
.peb-step-count {
	display: inline-block;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--peb-primary);
	margin-bottom: 10px;
}
.peb-step-title {
	margin: 0 0 8px;
	font-size: 26px;
	line-height: 1.25;
	color: var(--peb-secondary);
	font-weight: 700;
}
.peb-step-subtitle {
	margin: 0;
	color: #6b7280;
	font-size: 15px;
	line-height: 1.5;
}

/* Cartes avec images */
.peb-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}
.peb-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 2px solid #e5e7eb;
	border-radius: var(--peb-radius);
	overflow: hidden;
	cursor: pointer;
	transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.peb-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
	border-color: color-mix(in srgb, var(--peb-primary) 40%, #e5e7eb);
}
.peb-card-input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}
.peb-card-media {
	display: block;
	aspect-ratio: 4 / 3;
	background: #f3f4f6;
	overflow: hidden;
}
.peb-card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.peb-card-content {
	padding: 14px 16px;
	flex: 1;
}
.peb-card-title {
	display: block;
	font-weight: 600;
	font-size: 16px;
	color: var(--peb-secondary);
}
.peb-card-desc {
	display: block;
	margin-top: 4px;
	font-size: 13px;
	color: #6b7280;
	line-height: 1.4;
}
/* Carte « image » sans image : tuile texte propre et centrée */
.peb-card--text {
	min-height: 74px;
	justify-content: center;
}
.peb-card--text .peb-card-content {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
	padding: 18px 40px 18px 16px;
	min-height: 74px;
}
.peb-card--text .peb-card-title {
	font-size: 16px;
}

/* Pastille ronde de sélection (case à cocher) */
.peb-card-check {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
	border: 2px solid #d7dbe0;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
	transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.peb-card-check::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 6px;
	height: 11px;
	border: solid #fff;
	border-width: 0 2.5px 2.5px 0;
	transform: translate(-50%, -62%) rotate(45deg) scale(0.4);
	opacity: 0;
	transition: opacity 0.18s ease, transform 0.18s ease;
}
.peb-card:hover .peb-card-check {
	border-color: var(--peb-primary);
	transform: scale(1.06);
}
/* État sélectionné */
.peb-card.is-selected {
	border-color: var(--peb-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--peb-primary) 25%, transparent);
}
.peb-card.is-selected .peb-card-check {
	background: var(--peb-primary);
	border-color: var(--peb-primary);
}
.peb-card.is-selected .peb-card-check::after {
	opacity: 1;
	transform: translate(-50%, -62%) rotate(45deg) scale(1);
}

/* Choix simples / multiples */
.peb-choices {
	display: grid;
	gap: 12px;
	max-width: 560px;
	margin: 0 auto;
}
.peb-choice {
	position: relative;
	display: block;
	padding: 16px 56px 16px 18px;
	border: 2px solid #e5e7eb;
	border-radius: var(--peb-radius);
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
	background: #fff;
}
/* Pastille ronde de sélection */
.peb-choice::before {
	content: "";
	position: absolute;
	top: 50%;
	right: 16px;
	width: 26px;
	height: 26px;
	margin-top: -13px;
	border-radius: 50%;
	background: #fff;
	border: 2px solid #d7dbe0;
	transition: background 0.18s ease, border-color 0.18s ease;
}
.peb-choice::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 25px;
	width: 6px;
	height: 11px;
	margin-top: -8px;
	border: solid #fff;
	border-width: 0 2.5px 2.5px 0;
	transform: rotate(45deg) scale(0.4);
	opacity: 0;
	transition: opacity 0.18s ease, transform 0.18s ease;
}
.peb-choice:hover::before {
	border-color: var(--peb-primary);
}
.peb-choice.is-selected::before {
	background: var(--peb-primary);
	border-color: var(--peb-primary);
}
.peb-choice.is-selected::after {
	opacity: 1;
	transform: rotate(45deg) scale(1);
}
.peb-choice:hover {
	border-color: color-mix(in srgb, var(--peb-primary) 40%, #e5e7eb);
}
.peb-choice-input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}
.peb-choice-title {
	display: block;
	font-weight: 600;
	color: var(--peb-secondary);
}
.peb-choice-desc {
	display: block;
	margin-top: 3px;
	font-size: 13px;
	color: #6b7280;
}
.peb-choice.is-selected {
	border-color: var(--peb-primary);
	background: color-mix(in srgb, var(--peb-primary) 8%, #fff);
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--peb-primary) 20%, transparent);
}

/* Champ « Autre / précisez » — petit panneau mis en avant */
.peb-note-field {
	position: relative;
	max-width: 560px;
	margin: 20px auto 0;
	padding: 16px 18px 18px;
	background: color-mix(in srgb, var(--peb-primary) 6%, #fff);
	border: 1.5px solid color-mix(in srgb, var(--peb-primary) 35%, #e5e7eb);
	border-radius: var(--peb-radius);
	animation: peb-note-in 0.25s ease;
}
/* Petite flèche vers le choix sélectionné */
.peb-note-field::before {
	content: "";
	position: absolute;
	top: -8px;
	left: 32px;
	width: 14px;
	height: 14px;
	background: color-mix(in srgb, var(--peb-primary) 6%, #fff);
	border-left: 1.5px solid color-mix(in srgb, var(--peb-primary) 35%, #e5e7eb);
	border-top: 1.5px solid color-mix(in srgb, var(--peb-primary) 35%, #e5e7eb);
	transform: rotate(45deg);
	border-radius: 3px 0 0 0;
}
.peb-note-label {
	display: block;
	margin-bottom: 8px;
	font-size: 13px;
	font-weight: 700;
	color: var(--peb-primary);
	letter-spacing: 0.01em;
}
.peb-note-input {
	background: #fff;
}
.peb-note-field[hidden] {
	display: none;
}
@keyframes peb-note-in {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Champs texte.
   Les règles sont forcées (!important) et scopées à .peb-wrap : certains thèmes
   (Divi, Elementor…) imposent leurs propres styles aux input/textarea/select. */
.peb-wrap .peb-input,
.peb-wrap input[type="text"],
.peb-wrap input[type="email"],
.peb-wrap input[type="tel"],
.peb-wrap input[type="number"],
.peb-wrap textarea,
.peb-wrap select {
	box-sizing: border-box !important;
	width: 100% !important;
	max-width: 100% !important;
	height: auto !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 13px 15px !important;
	border: 2px solid #e5e7eb !important;
	border-radius: calc(var(--peb-radius) - 4px) !important;
	font-size: 15px !important;
	font-family: inherit !important;
	font-weight: 400 !important;
	line-height: 1.4 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	color: var(--peb-text) !important;
	background: #fff !important;
	background-image: none !important;
	box-shadow: none !important;
	transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}
.peb-wrap select {
	appearance: none;
	-webkit-appearance: none;
	background-image: linear-gradient( 45deg, transparent 50%, #9aa1ab 50% ), linear-gradient( 135deg, #9aa1ab 50%, transparent 50% ) !important;
	background-position: calc(100% - 20px) center, calc(100% - 14px) center !important;
	background-size: 6px 6px, 6px 6px !important;
	background-repeat: no-repeat !important;
	padding-right: 40px !important;
	cursor: pointer;
}
.peb-wrap .peb-input:focus,
.peb-wrap input[type="text"]:focus,
.peb-wrap input[type="email"]:focus,
.peb-wrap input[type="tel"]:focus,
.peb-wrap input[type="number"]:focus,
.peb-wrap textarea:focus,
.peb-wrap select:focus {
	outline: none !important;
	border-color: var(--peb-primary) !important;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--peb-primary) 18%, transparent) !important;
}
.peb-wrap .peb-input::placeholder,
.peb-wrap textarea::placeholder {
	color: #9aa1ab !important;
	opacity: 1 !important;
	font-style: normal !important;
}
.peb-wrap .peb-textarea,
.peb-wrap textarea {
	resize: vertical !important;
	min-height: 110px !important;
}
.peb-step-body > .peb-input,
.peb-step-body > .peb-select {
	max-width: 560px;
	margin: 0 auto;
	display: block;
}
.peb-inline-check {
	display: flex;
	align-items: center;
	gap: 10px;
	justify-content: center;
	font-size: 15px;
}

/* Grille coordonnées */
.peb-fields-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	max-width: 620px;
	margin: 0 auto;
}
.peb-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.peb-field > span {
	font-size: 14px;
	font-weight: 600;
	color: var(--peb-secondary);
}
.peb-field-full {
	grid-column: 1 / -1;
}

/* Navigation */
.peb-nav {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 30px;
	padding-top: 22px;
	border-top: 1px solid #eef0f3;
}
/* Boutons : forcés pour ne pas être écrasés par le thème (Divi…). */
.peb-wrap .peb-btn {
	appearance: none;
	border: 0 !important;
	cursor: pointer;
	font-size: 15px !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
	padding: 13px 26px !important;
	margin: 0 !important;
	border-radius: var(--peb-radius) !important;
	font-family: inherit !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	text-decoration: none !important;
	transition: transform 0.12s ease, opacity 0.15s ease, background 0.15s ease;
}
.peb-wrap .peb-btn::after {
	display: none !important; /* Divi ajoute une flèche via ::after */
}
.peb-btn:active {
	transform: translateY(1px);
}
.peb-wrap .peb-btn-next,
.peb-wrap .peb-btn-submit {
	background: var(--peb-button) !important;
	background-image: none !important;
	color: #fff !important;
	margin-left: auto !important;
}
.peb-wrap .peb-btn-next:hover,
.peb-wrap .peb-btn-submit:hover {
	filter: brightness(1.05);
	background: var(--peb-button) !important;
	color: #fff !important;
}
.peb-wrap .peb-btn-ghost {
	background: transparent !important;
	background-image: none !important;
	color: var(--peb-secondary) !important;
	border: 2px solid #e5e7eb !important;
}
.peb-wrap .peb-btn-ghost:hover {
	border-color: #cbd0d8 !important;
	background: transparent !important;
}
.peb-btn[disabled] {
	opacity: 0.55;
	cursor: not-allowed;
}

/* Erreurs */
.peb-error {
	margin: 16px auto 0;
	max-width: 560px;
	text-align: center;
	color: #b91c1c;
	font-size: 14px;
	font-weight: 500;
}

/* Remerciement */
.peb-thankyou {
	text-align: center;
	padding: 20px 10px 10px;
}
.peb-thankyou-icon {
	width: 72px;
	height: 72px;
	margin: 0 auto 20px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--peb-primary) 15%, #fff);
	color: var(--peb-primary);
	font-size: 38px;
	line-height: 72px;
	font-weight: 700;
}
.peb-thankyou-message {
	font-size: 18px;
	line-height: 1.6;
	color: var(--peb-secondary);
	max-width: 520px;
	margin: 0 auto 24px;
}

/* Bouton d'ouverture */
.peb-open-button {
	display: inline-block;
	appearance: none;
	border: 0;
	cursor: pointer;
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	padding: 14px 30px;
	border-radius: 12px;
	text-decoration: none;
	transition: filter 0.15s ease;
}
.peb-open-button:hover {
	filter: brightness(1.06);
}

/* Modale */
.peb-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 24px;
	overflow-y: auto;
}
.peb-modal[hidden] {
	display: none;
}
.peb-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(244, 243, 240, 0.96);
	backdrop-filter: blur(3px);
}
.peb-modal-dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 900px;
	margin: auto;
}
.peb-modal-dialog .peb-wrap {
	padding: 0;
	background: transparent;
}
.peb-modal-close {
	position: absolute;
	top: -14px;
	right: -14px;
	z-index: 2;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 0;
	background: #fff;
	color: #111;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.peb-empty,
.peb-notice {
	text-align: center;
	color: #6b7280;
	padding: 30px;
}

/* Onglet flottant (sticky) */
.peb-float {
	--peb-float-color: #16744d;
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	z-index: 100001; /* au-dessus de la modale pour rester visible à l'ouverture */
}
.peb-float-right {
	right: 0;
}
.peb-float-left {
	left: 0;
}
.peb-float-tab {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	width: 118px;
	padding: 20px 14px 16px;
	border: 0;
	cursor: pointer;
	background: var(--peb-float-color);
	color: #fff;
	text-align: center;
	line-height: 1.2;
	box-shadow: 0 12px 30px rgba(15, 23, 42, 0.28);
	transition: transform 0.18s ease, filter 0.18s ease;
	font-family: inherit;
}
.peb-float-right .peb-float-tab {
	border-radius: 18px 0 0 18px;
}
.peb-float-left .peb-float-tab {
	border-radius: 0 18px 18px 0;
}
.peb-float-right .peb-float-tab:hover {
	transform: translateX(-4px);
	filter: brightness(1.06);
}
.peb-float-left .peb-float-tab:hover {
	transform: translateX(4px);
	filter: brightness(1.06);
}
.peb-float-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	margin-bottom: 2px;
}
.peb-float-emoji {
	font-size: 24px;
	line-height: 1;
}
.peb-float-text {
	font-size: 15px;
	font-weight: 800;
	letter-spacing: 0.01em;
}
.peb-float-sub {
	display: block;
	margin-top: 8px;
	padding-top: 8px;
	width: 100%;
	border-top: 1px solid rgba(255, 255, 255, 0.25);
	font-size: 12px;
	font-weight: 600;
}
.peb-float-arrow {
	display: inline-block;
	transition: transform 0.18s ease;
}
.peb-float-tab:hover .peb-float-arrow {
	transform: translateX(3px);
}

/* Chevron : visible uniquement en barre mobile */
.peb-float-chevron {
	display: none;
}

/* ---- Mobile : barre en bas d'écran, rétractable au défilement ---- */
@media (max-width: 782px) {
	.peb-float,
	.peb-float-left,
	.peb-float-right {
		top: auto;
		bottom: 14px;
		left: 12px;
		right: 12px;
		transform: none;
		display: flex;
		justify-content: center;
		transition: left 0.28s ease, right 0.28s ease;
	}

	.peb-float-tab {
		flex-direction: row;
		align-items: center;
		gap: 12px;
		width: 100%;
		max-width: 360px;
		padding: 11px 16px;
		border-radius: 999px !important;
		text-align: left;
		transition: padding 0.28s ease, max-width 0.28s ease;
	}
	.peb-float-right .peb-float-tab:hover,
	.peb-float-left .peb-float-tab:hover {
		transform: none;
	}

	.peb-float-icon {
		width: 38px;
		height: 38px;
		flex: 0 0 38px;
		margin: 0;
	}
	.peb-float-labels {
		flex: 1;
		min-width: 0;
		display: flex;
		flex-direction: column;
		line-height: 1.2;
	}
	.peb-float-text {
		font-size: 15px;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.peb-float-sub {
		width: auto;
		margin: 2px 0 0;
		padding: 0;
		border-top: 0;
		font-size: 12px;
		font-weight: 500;
		opacity: 0.9;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.peb-float-arrow {
		display: none; /* remplacé par le chevron à droite */
	}
	.peb-float-chevron {
		display: block;
		flex: 0 0 auto;
		font-size: 18px;
		opacity: 0.95;
	}

	/* État rétracté (au défilement) : simple pastille ronde */
	.peb-float.is-mini {
		left: auto;
		right: 14px;
		justify-content: flex-end;
	}
	.peb-float.is-mini .peb-float-tab {
		width: auto;
		max-width: none;
		padding: 12px;
		gap: 0;
	}
	.peb-float.is-mini .peb-float-labels,
	.peb-float.is-mini .peb-float-chevron {
		display: none;
	}
	.peb-float.is-mini .peb-float-icon {
		width: 34px;
		height: 34px;
		flex-basis: 34px;
	}
}

/* Responsive */
@media (max-width: 782px) {
	.peb-cards {
		grid-template-columns: 1fr;
	}
	.peb-fields-grid {
		grid-template-columns: 1fr;
	}
	.peb-card-wrap {
		padding: 22px 18px 20px;
	}
	.peb-step-title {
		font-size: 22px;
	}
	.peb-btn {
		padding: 12px 18px;
	}
}

/* Choix multiple limité : compteur et options verrouillées */
.peb-max-hint {
	max-width: 560px;
	margin: 0 auto 14px;
	text-align: center;
	font-size: 13px;
	font-weight: 600;
	color: #6b7280;
}
.peb-max-hint.is-full {
	color: var(--peb-primary);
}
.peb-card.is-locked,
.peb-choice.is-locked {
	opacity: 0.45;
	cursor: not-allowed;
	filter: grayscale(0.5);
}
.peb-card.is-locked:hover,
.peb-choice.is-locked:hover {
	transform: none;
	box-shadow: none;
	border-color: #e5e7eb;
}
.peb-choice.is-locked:hover::before {
	border-color: #d7dbe0;
}
