/* Tour Builder Maroc — styles frontend, namespacés sous .tbm-wizard pour ne pas entrer en conflit avec le thème. */

.tbm-wizard {
	--tbm-primary: #e8590c;
	--tbm-primary-dark: #c94a09;
	--tbm-success: #2f9e44;
	--tbm-bg: #ffffff;
	--tbm-page-bg: #f4f4f5;
	--tbm-border: #e7e5e2;
	--tbm-text: #24262b;
	--tbm-muted: #767676;
	--tbm-radius: 12px;
	max-width: 960px;
	margin: 0 auto;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--tbm-text);
	box-sizing: border-box;
	background: var(--tbm-page-bg);
	padding: 24px;
	border-radius: 16px;
}
.tbm-wizard *, .tbm-wizard *::before, .tbm-wizard *::after { box-sizing: inherit; }

.tbm-lang-switcher {
	display: flex;
	justify-content: flex-end;
	gap: 6px;
	margin-bottom: 16px;
}
.tbm-lang-btn {
	background: #fff;
	border: 1px solid var(--tbm-border);
	border-radius: 6px;
	padding: 4px 10px;
	font-size: 13px;
	cursor: pointer;
	color: var(--tbm-muted);
}
.tbm-lang-btn.is-active {
	background: var(--tbm-primary);
	border-color: var(--tbm-primary);
	color: #fff;
}

/* ------- Barre de progression : cercles numérotés + libellés ------- */
.tbm-progress { margin-bottom: 20px; padding: 0 4px; }
.tbm-progress-bar {
	height: 4px;
	background: var(--tbm-border);
	border-radius: 2px;
	overflow: hidden;
	margin-bottom: 16px;
}
.tbm-progress-fill {
	height: 100%;
	background: var(--tbm-primary);
	transition: width .3s ease;
}
.tbm-progress-steps {
	display: flex;
	justify-content: space-between;
	position: relative;
}
.tbm-step-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	flex: 1;
	min-width: 0;
}
.tbm-step-dot {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #dcdcdc;
	color: #8a8a8a;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 13px;
	font-weight: 700;
	transition: background .2s ease, color .2s ease, transform .2s ease;
}
.tbm-step-label {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: #9a9a9a;
	text-align: center;
}
.tbm-step-item.is-active .tbm-step-dot {
	background: var(--tbm-primary);
	color: #fff;
	transform: scale(1.08);
}
.tbm-step-item.is-active .tbm-step-label { color: var(--tbm-primary); }
.tbm-step-item.is-done .tbm-step-dot { background: var(--tbm-success); color: #fff; }
.tbm-step-item.is-done .tbm-step-label { color: var(--tbm-success); }

/* ------- Panneau blanc principal ------- */
.tbm-panel {
	background: var(--tbm-bg);
	border-radius: var(--tbm-radius);
	box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.05);
	padding: 32px;
}
.tbm-panel-nav {
	margin-top: 16px;
	padding: 18px 24px;
	display: flex;
	align-items: center;
}
.tbm-nav-spacer { flex: 1; }

.tbm-step { display: none; animation: tbm-fade .25s ease; }
.tbm-step.is-active { display: block; }
@keyframes tbm-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.tbm-step h2 { margin: 0 0 6px; font-size: 24px; font-weight: 700; }
.tbm-subtitle { margin: 0 0 24px; color: var(--tbm-muted); }

/* ------- Cartes de sélection (destinations, types) ------- */
.tbm-gallery {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 14px;
}
.tbm-card {
	position: relative;
	border: 1.5px solid var(--tbm-border);
	border-radius: var(--tbm-radius);
	overflow: hidden;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	background: var(--tbm-bg);
	transition: border-color .2s ease, transform .15s ease, box-shadow .2s ease;
}
.tbm-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.06); }
.tbm-card input { position: absolute; opacity: 0; pointer-events: none; }
.tbm-card-image {
	height: 120px;
	background-size: cover;
	background-position: center;
	background-color: #ececec;
	position: relative;
}
.tbm-card-overlay {
	position: absolute;
	inset: 0;
	background: rgba(232, 89, 12, .55);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity .2s ease;
}
.tbm-card input:checked ~ .tbm-card-image .tbm-card-overlay,
.tbm-card-image .tbm-card-overlay.is-checked { opacity: 1; }
.tbm-check {
	color: #fff;
	font-size: 28px;
	font-weight: 700;
}
.tbm-card-title { padding: 12px 14px 2px; font-weight: 700; text-align: center; }
.tbm-card-desc { padding: 0 14px 14px; font-size: 13px; color: var(--tbm-muted); text-align: center; }
.tbm-card.is-selected { border-color: var(--tbm-primary); box-shadow: 0 0 0 2px rgba(232,89,12,.18); }

/* Variante "choix" (type de circuit, sans photo obligatoire) : centrée, compacte */
.tbm-gallery-choice { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.tbm-card-choice .tbm-card-image { height: 90px; }
.tbm-card-choice .tbm-card-title { padding: 12px 10px; font-size: 14px; }

.tbm-card-simple {
	padding: 18px;
	border-radius: var(--tbm-radius);
	text-align: center;
}
.tbm-card-simple .tbm-card-title { padding: 0 0 4px; }
.tbm-card-simple .tbm-card-desc { padding: 0; }

/* ------- Champs de formulaire ------- */
.tbm-field-group { margin-bottom: 18px; }
.tbm-field-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.tbm-field-group input[type="text"],
.tbm-field-group input[type="email"],
.tbm-field-group input[type="tel"],
.tbm-field-group input[type="number"],
.tbm-field-group input[type="date"],
.tbm-field-group select,
.tbm-field-group textarea {
	width: 100%;
	padding: 11px 14px;
	border: 1.5px solid var(--tbm-border);
	border-radius: 8px;
	font-size: 14px;
	font-family: inherit;
	background: #fff;
	transition: border-color .15s ease;
}
.tbm-field-group input:focus,
.tbm-field-group select:focus,
.tbm-field-group textarea:focus {
	outline: none;
	border-color: var(--tbm-primary);
}
.tbm-field-row { display: flex; gap: 16px; }
.tbm-field-row .tbm-field-group { flex: 1; }

.tbm-budget-row { display: flex; gap: 10px; }
.tbm-budget-row input { flex: 2; }
.tbm-budget-row select { flex: 1; }

/* ------- Compteurs adultes / enfants ------- */
.tbm-travelers { display: flex; gap: 16px; flex-wrap: wrap; }
.tbm-travelers .tbm-counter {
	border: 1.5px solid var(--tbm-border);
	border-radius: var(--tbm-radius);
	padding: 14px 18px;
	flex: 1;
	min-width: 220px;
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.tbm-counter-controls { display: flex; align-items: center; gap: 12px; }
.tbm-counter-btn {
	width: 34px; height: 34px;
	border-radius: 50%;
	border: 1.5px solid var(--tbm-border);
	background: #fff;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	color: var(--tbm-text);
}
.tbm-counter-btn:hover { border-color: var(--tbm-primary); color: var(--tbm-primary); }
.tbm-counter-controls input {
	width: 30px;
	text-align: center;
	border: none;
	font-size: 17px;
	font-weight: 700;
	background: transparent;
}

.tbm-error-message { color: #c0392b; font-size: 13px; margin-top: 6px; min-height: 1em; }

/* ------- Récapitulatif ------- */
.tbm-summary {
	background: #1f2130;
	color: #fff;
	border-radius: var(--tbm-radius);
	padding: 20px 22px;
	margin-bottom: 18px;
}
.tbm-summary dl { margin: 0; }
.tbm-summary dt {
	font-weight: 700;
	margin-top: 14px;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--tbm-primary);
}
.tbm-summary dt:first-child { margin-top: 0; }
.tbm-summary dd { margin: 3px 0 0; color: #d8d8dc; }

.tbm-success-message {
	background: #e9f8ee;
	color: #1e4620;
	border: 1px solid #bfe8cb;
	border-radius: var(--tbm-radius);
	padding: 18px;
	font-weight: 600;
}

/* ------- Boutons ------- */
.tbm-btn {
	padding: 13px 24px;
	border-radius: 8px;
	border: none;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .02em;
	text-transform: uppercase;
	cursor: pointer;
	background: var(--tbm-primary);
	color: #fff;
	transition: background .15s ease, transform .1s ease;
}
.tbm-btn:hover { background: var(--tbm-primary-dark); }
.tbm-btn:active { transform: scale(.98); }
.tbm-btn:disabled { opacity: .6; cursor: not-allowed; }
.tbm-btn-outline {
	background: #fff;
	color: var(--tbm-text);
	border: 1.5px solid var(--tbm-border);
}
.tbm-btn-outline:hover { background: #f7f7f7; }

.tbm-wizard[dir="rtl"] .tbm-lang-switcher { justify-content: flex-start; }

@media (max-width: 640px) {
	.tbm-wizard { padding: 14px; }
	.tbm-panel { padding: 20px; }
	.tbm-gallery { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
	.tbm-field-row { flex-direction: column; gap: 0; }
	.tbm-step-label { display: none; }
}
