/*
 * BIBLO Mesure : style du questionnaire public.
 * Pensé d'abord pour le téléphone. Couleurs BIBLO :
 *   #1C899A titres, #00ACC2 boutons et accents, #EEF7F7 fonds clairs, #1F2937 texte.
 * Contraste : le texte des boutons est foncé (#1F2937) sur #00ACC2 (rapport 5,4:1).
 * En blanc sur #00ACC2, le rapport (2,7:1) serait insuffisant pour l'accessibilité.
 */

@font-face {
	font-family: "Poppins BIBLO";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url("../../assets/fonts/poppins-600-latin.woff2") format("woff2");
}

.bm-app {
	--bm-titre: #1C899A;
	--bm-accent: #00ACC2;
	--bm-fond: #EEF7F7;
	--bm-texte: #1F2937;
	--bm-erreur: #B42318;
	--bm-bordure: #5F7F85; /* contraste 4,3:1 sur blanc */

	box-sizing: border-box;
	max-width: 640px;
	margin: 0 auto;
	padding: 16px;
	color: var(--bm-texte);
	background: #FFFFFF;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 17px;
	line-height: 1.5;
}

.bm-app *,
.bm-app *::before,
.bm-app *::after {
	box-sizing: inherit;
}

.bm-app [hidden] {
	display: none !important;
}

/* En-tête */
.bm-entete {
	text-align: center;
	margin-bottom: 16px;
}

.bm-logo {
	display: block;
	width: 72px;
	height: auto;
	margin: 0 auto 8px;
}

.bm-etablissement {
	margin: 0;
	/* 19 px en gras : « grand texte », contraste suffisant pour #1C899A (4,1:1). */
	font-size: 19px;
	color: var(--bm-titre);
	font-family: "Poppins BIBLO", system-ui, sans-serif;
	font-weight: 600;
}

/* Titres */
.bm-titre {
	margin: 0 0 16px;
	color: var(--bm-titre);
	font-family: "Poppins BIBLO", system-ui, sans-serif;
	font-weight: 600;
	font-size: 1.5rem;
	line-height: 1.3;
}

.bm-titre:focus {
	outline: none;
}

/* Blocs d'information */
.bm-information {
	padding: 12px 16px;
	margin-bottom: 20px;
	background: var(--bm-fond);
	border-radius: 12px;
}

.bm-information p {
	margin: 0;
}

.bm-information p + p {
	margin-top: 8px;
}

.bm-alerte {
	padding: 12px 16px;
	margin-bottom: 20px;
	border: 2px solid var(--bm-erreur);
	border-radius: 12px;
	color: var(--bm-erreur);
	font-weight: 600;
}

.bm-alerte:focus {
	outline: 3px solid var(--bm-titre);
	outline-offset: 2px;
}

.bm-alerte-apercu {
	border-color: var(--bm-titre);
	color: var(--bm-texte);
}

/* Écran d'accueil */
.bm-accueil {
	margin-bottom: 24px;
}

.bm-pourquoi {
	margin-bottom: 16px;
}

.bm-pourquoi p {
	margin: 0 0 8px;
}

.bm-message {
	padding: 24px 16px;
	text-align: center;
	background: var(--bm-fond);
	border-radius: 12px;
}

/* Progression (avec JavaScript seulement) */
.bm-js-seulement {
	display: none !important;
}

.bm-js .bm-js-seulement {
	display: block !important;
}

.bm-js .bm-js-seulement[hidden] {
	display: none !important;
}

.bm-js .bm-navigation .bm-js-seulement {
	display: inline-flex !important;
}

.bm-js .bm-navigation .bm-js-seulement[hidden],
.bm-js [data-bm-envoyer][hidden] {
	display: none !important;
}

.bm-progression {
	margin-bottom: 16px;
}

.bm-progression-texte {
	margin: 0 0 6px;
	font-size: 0.9rem;
}

.bm-barre {
	height: 8px;
	background: var(--bm-fond);
	border-radius: 4px;
	overflow: hidden;
}

.bm-barre span {
	display: block;
	height: 100%;
	width: 0;
	background: var(--bm-accent);
	transition: width 0.2s ease;
}

.bm-lecteur-ecran {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

/* Champ piège : hors de l'écran (pas display:none, que certains robots repèrent). */
.bm-piege {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Étapes */
.bm-etape {
	margin-bottom: 24px;
}

.bm-question {
	margin-bottom: 24px;
}

.bm-groupe {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.bm-libelle {
	display: block;
	margin-bottom: 10px;
	padding: 0;
	font-weight: 600;
}

.bm-facultatif,
.bm-aide {
	font-weight: 400;
	font-size: 0.9rem;
}

.bm-aide {
	display: block;
}

.bm-condition-note,
.bm-avertissement {
	margin: 0 0 8px;
	font-size: 0.9rem;
}

.bm-avertissement {
	padding: 8px 12px;
	background: var(--bm-fond);
	border-left: 4px solid var(--bm-titre);
	border-radius: 4px;
	font-weight: 600;
}

.bm-js .bm-condition-note {
	display: none;
}

/* Choix : grosses zones à toucher */
.bm-choix-liste {
	display: grid;
	gap: 8px;
}

.bm-choix {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 52px;
	padding: 10px 14px;
	border: 2px solid var(--bm-bordure);
	border-radius: 12px;
	background: #FFFFFF;
	cursor: pointer;
}

.bm-choix input {
	flex: none;
	width: 22px;
	height: 22px;
	margin: 0;
	accent-color: var(--bm-titre);
}

.bm-choix:has(input:checked) {
	border-color: var(--bm-titre);
	background: var(--bm-fond);
	font-weight: 600;
}

.bm-choix:has(input:focus-visible) {
	outline: 3px solid var(--bm-titre);
	outline-offset: 2px;
}

/* Échelles et notes : une rangée de chiffres */
.bm-choix-chiffres {
	grid-template-columns: repeat(5, 1fr);
}

.bm-type-note .bm-choix-chiffres {
	grid-template-columns: repeat(6, 1fr);
}

.bm-choix-chiffre {
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	padding: 8px 4px;
	text-align: center;
}

.bm-extremes {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 8px;
	font-size: 0.85rem;
}

.bm-extremes span:last-child {
	text-align: right;
}

@media (min-width: 560px) {
	.bm-type-note .bm-choix-chiffres {
		grid-template-columns: repeat(11, 1fr);
	}
}

/* Champs de saisie */
.bm-champ {
	display: block;
	width: 100%;
	min-height: 52px;
	padding: 12px 14px;
	border: 2px solid var(--bm-bordure);
	border-radius: 12px;
	font: inherit;
	color: inherit;
	background: #FFFFFF;
}

.bm-champ:focus {
	outline: 3px solid var(--bm-titre);
	outline-offset: 2px;
	border-color: var(--bm-titre);
}

.bm-champ-nombre {
	max-width: 200px;
}

/* Erreurs */
.bm-erreur {
	margin: 8px 0 0;
	color: var(--bm-erreur);
	font-weight: 600;
}

.bm-a-erreur .bm-choix,
.bm-a-erreur .bm-champ {
	border-color: var(--bm-erreur);
}

/* Boutons */
.bm-navigation {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: space-between;
}

.bm-bouton {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 12px 24px;
	border: 2px solid var(--bm-accent);
	border-radius: 26px;
	background: var(--bm-accent);
	color: var(--bm-texte);
	font-family: "Poppins BIBLO", system-ui, sans-serif;
	font-weight: 600;
	/* 19 px en gras : « grand texte », contraste suffisant pour #1C899A (bouton secondaire). */
	font-size: 19px;
	text-decoration: none;
	cursor: pointer;
}

.bm-bouton:hover {
	background: #00C4DD;
	border-color: #00C4DD;
	color: var(--bm-texte);
}

.bm-bouton:focus-visible {
	outline: 3px solid var(--bm-texte);
	outline-offset: 2px;
}

.bm-bouton-secondaire {
	background: #FFFFFF;
	border-color: var(--bm-titre);
	color: var(--bm-titre);
}

.bm-bouton-secondaire:hover {
	background: var(--bm-fond);
	border-color: var(--bm-titre);
	color: var(--bm-titre);
}

.bm-navigation [data-bm-suivant],
.bm-navigation [data-bm-envoyer] {
	margin-left: auto;
}

@media (prefers-reduced-motion: reduce) {
	.bm-barre span {
		transition: none;
	}
}

/*
 * Thème du site biblo.pro (« zahar ») : sa barre de titre par défaut contient le texte
 * « Erreur 404 :( ». Sur la page du questionnaire (seule page où ce fichier est chargé),
 * on garde la vague turquoise derrière le menu, mais sans texte ni illustration, et en
 * hauteur réduite pour que le questionnaire commence tout de suite.
 * visibility (et non display) : la vague garde sa taille et reste derrière le menu blanc.
 * Sans effet avec un autre thème.
 */
.jws-title-bar-wrap .elementor-widget-heading,
.jws-title-bar-wrap .elementor-widget-image {
	visibility: hidden !important;
}

.jws-title-bar-wrap {
	height: 140px;
	overflow: hidden;
}

@media (min-width: 1025px) {
	.jws-title-bar-wrap {
		height: 230px;
	}
}
