/**
 * 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;
}

.peb-card-badge {
	position: absolute;
	top: 12px;
	right: 12px;
	background: rgba(255, 255, 255, 0.92);
	color: var(--peb-secondary);
	font-size: 12px;
	font-weight: 600;
	padding: 5px 12px;
	border-radius: 999px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity 0.18s ease, transform 0.18s ease;
}
.peb-card:hover .peb-card-badge {
	opacity: 1;
	transform: translateY(0);
}
/* É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-badge {
	opacity: 1;
	transform: translateY(0);
	background: var(--peb-primary);
	color: #fff;
}

/* Choix simples / multiples */
.peb-choices {
	display: grid;
	gap: 12px;
	max-width: 560px;
	margin: 0 auto;
}
.peb-choice {
	display: block;
	padding: 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;
}
.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 » */
.peb-note-field {
	max-width: 560px;
	margin: 14px auto 0;
}
.peb-note-field[hidden] {
	display: none;
}

/* Champs texte */
.peb-input {
	width: 100%;
	padding: 13px 15px;
	border: 2px solid #e5e7eb;
	border-radius: calc(var(--peb-radius) - 4px);
	font-size: 15px;
	font-family: inherit;
	color: var(--peb-text);
	background: #fff;
	transition: border-color 0.15s ease;
}
.peb-input:focus {
	outline: none;
	border-color: var(--peb-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--peb-primary) 18%, transparent);
}
.peb-textarea {
	resize: vertical;
	min-height: 110px;
}
.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;
}
.peb-btn {
	appearance: none;
	border: 0;
	cursor: pointer;
	font-size: 15px;
	font-weight: 600;
	padding: 13px 26px;
	border-radius: var(--peb-radius);
	font-family: inherit;
	transition: transform 0.12s ease, opacity 0.15s ease, background 0.15s ease;
}
.peb-btn:active {
	transform: translateY(1px);
}
.peb-btn-next,
.peb-btn-submit {
	background: var(--peb-button);
	color: #fff;
	margin-left: auto;
}
.peb-btn-next:hover,
.peb-btn-submit:hover {
	filter: brightness(1.05);
}
.peb-btn-ghost {
	background: transparent;
	color: var(--peb-secondary);
	border: 2px solid #e5e7eb;
}
.peb-btn-ghost:hover {
	border-color: #cbd0d8;
}
.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-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);
}

@media (max-width: 782px) {
	.peb-float-tab {
		width: auto;
		padding: 12px 10px;
	}
	.peb-float-text,
	.peb-float-sub {
		display: none;
	}
	.peb-float-icon {
		margin: 0;
	}
}

/* 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;
	}
}
