/**
 * Barre collante du questionnaire.
 *
 * Elle reprend les variables de couleur de la feuille principale : changer
 * l'accent dans les reglages la teinte aussi, sans reglage en double.
 *
 * Le script ne pose qu'une classe, est-visible. Tout le reste est ici.
 */

.oq-bar {
	--oq-bar-marge: 14px;
	--oq-bar-large: 1100px;
	--oq-bar-duree: .38s;
	--oq-bar-sortie: 115%;

	--oq-surface: #FAF3EA;
	--oq-surface-2: #FFFFFF;
	--oq-surface-3: #F3E8D8;
	--oq-line: #EADFCE;
	--oq-line-strong: #DFD1BB;
	--oq-text: #131313;
	--oq-muted: #6B655D;
	--oq-accent: #E09B2D;
	--oq-accent-text: #B87A16;
	--oq-cta-bg: #E09B2D;
	--oq-cta-text: #FFFFFF;

	position: fixed;
	left: 0;
	right: 0;
	z-index: 998;
	box-sizing: border-box;
	display: flex;
	justify-content: center;
	padding: 12px 22px;
	background: var(--oq-surface-2);
	color: var(--oq-text);
	font-family: inherit;
	box-shadow: 0 -6px 24px rgba(11, 37, 69, .12);
	transition: transform var(--oq-bar-duree) cubic-bezier(.22, 1, .36, 1),
				opacity var(--oq-bar-duree) ease;
}

.oq-bar *,
.oq-bar *::before,
.oq-bar *::after {
	box-sizing: border-box;
}

.oq-bar p {
	margin: 0;
	padding: 0;
}

/* ---------- Variante bleu nuit ---------- */
.oq-bar.oq-theme-navy {
	--oq-surface-2: #0B2757;
	--oq-surface-3: rgba(255, 255, 255, .09);
	--oq-line: rgba(255, 255, 255, .13);
	--oq-line-strong: rgba(255, 255, 255, .22);
	--oq-text: #FFFFFF;
	--oq-muted: rgba(255, 255, 255, .66);
	--oq-accent: #C6A465;
	--oq-accent-text: #DCC08A;
	--oq-cta-bg: #C6A465;
	--oq-cta-text: #0B2757;
}

/* ==========================================================================
   PLACE ET ARRIVEE
   ========================================================================== */

/* EN BAS : la reserve pour la barre d'accueil des telephones. Sans elle, le
   bouton se retrouve sous le trait du bas : on le voit, on ne peut pas le
   toucher. */
.oq-bar-pos-bas {
	bottom: 0;
	border-top: 1px solid var(--oq-line);
	padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

.oq-bar-pos-haut {
	top: 0;
	border-bottom: 1px solid var(--oq-line);
	box-shadow: 0 6px 24px rgba(11, 37, 69, .12);
}

/* L'etat cache, et lui seul depend du script. La barre n'est masquee que si
   le script a pris la main : sans JavaScript elle reste affichee, et son
   bouton reste utilisable. */
.oq-bar-js.oq-bar-pos-bas {
	transform: translateY(var(--oq-bar-sortie));
	opacity: 0;
	pointer-events: none;
}

.oq-bar-js.oq-bar-pos-haut {
	transform: translateY(calc(-1 * var(--oq-bar-sortie)));
	opacity: 0;
	pointer-events: none;
}

.oq-bar-js.oq-bar-pos-bas.est-visible,
.oq-bar-js.oq-bar-pos-haut.est-visible {
	transform: none;
	opacity: 1;
	pointer-events: auto;
}

/* Fermee, elle disparait, meme sans le script : la croix doit marcher dans
   tous les cas. display none la retire aussi de l'ordre de tabulation. */
.oq-bar.est-fermee {
	display: none;
}

/* Elle apparait en fondu : meme arrivee, sans deplacement. */
.oq-bar-arrivee-fondu {
	--oq-bar-sortie: 0px;
}

/* Detachee du bord : elle quitte les deux bords pour qu'un arrondi se voie.
   Un arrondi sur une barre collee aux bords ne se voit pas, c'est pour cela
   que les deux vont ensemble. */
.oq-bar-detachee-oui {
	left: max(var(--oq-bar-marge), calc(50% - var(--oq-bar-large) / 2));
	right: max(var(--oq-bar-marge), calc(50% - var(--oq-bar-large) / 2));
	border: 1px solid var(--oq-line);
	border-radius: 16px;
}

.oq-bar-detachee-oui.oq-bar-pos-bas { bottom: var(--oq-bar-marge); }
.oq-bar-detachee-oui.oq-bar-pos-haut { top: var(--oq-bar-marge); }

@media (prefers-reduced-motion: reduce) {
	.oq-bar {
		transition: none;
	}
}

/* ==========================================================================
   CONTENU
   ========================================================================== */
.oq-bar-inner {
	position: relative;
	display: flex;
	align-items: center;
	gap: 18px;
	width: 100%;
	max-width: var(--oq-bar-large);
	margin-inline: auto;
}

.oq-bar-icon {
	flex: 0 0 46px;
	height: 46px;
	display: grid;
	place-items: center;
	background: var(--oq-surface-3);
	border-radius: 12px;
	color: var(--oq-accent-text);
}

.oq-bar-text {
	flex: 1 1 auto;
	min-width: 0;
}

.oq-bar-title {
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.oq-bar-tagline {
	margin-top: 2px !important;
	font-size: 13.5px;
	color: var(--oq-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.oq-bar-duration {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 13.5px;
	color: var(--oq-muted);
}

.oq-bar-duration svg,
.oq-bar-icon svg,
.oq-bar-button svg,
.oq-bar-close svg {
	flex: none;
}

/* ---------- Reprise d'un parcours commence ---------- */
.oq-bar-progress {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--oq-muted);
	white-space: nowrap;
}

.oq-bar-progress[hidden] {
	display: none;
}

.oq-bar-progress-track {
	width: 74px;
	height: 5px;
	border-radius: 99px;
	background: var(--oq-line-strong);
	overflow: hidden;
}

.oq-bar-progress-track i {
	display: block;
	height: 100%;
	width: 0;
	background: var(--oq-accent);
	transition: width .4s cubic-bezier(.22, 1, .36, 1);
}

/* ---------- Bouton et croix ---------- */
.oq-bar-button {
	flex: var(--oq-bar-btn-flex, 0 0 auto);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .667em;
	/* Les marges sont en em : elles suivent la taille du texte, donc le
	   reglage « Taille du bouton » reduit tout le bouton d'un coup. */
	padding: var(--oq-bar-btn-pad, .8667em 1.6em);
	margin: var(--oq-bar-btn-marge, 0);
	width: var(--oq-bar-btn-largeur, auto);
	max-width: 100%;
	background: var(--oq-cta-bg);
	border: none;
	border-radius: var(--oq-bar-btn-rayon, 999px);
	color: var(--oq-cta-text);
	font: inherit;
	font-size: var(--oq-bar-btn-taille, 15px);
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	transition: filter .18s ease, transform .18s ease, background .18s ease, color .18s ease;
}

.oq-bar-button svg {
	width: var(--oq-bar-btn-icone, 18px);
	height: var(--oq-bar-btn-icone, 18px);
}

/* Une couleur de survol choisie remplace l'assombrissement automatique :
   sans cela les deux se cumuleraient et la teinte obtenue ne serait pas
   celle demandee. Le reglage pose les deux variables a la fois. */
.oq-bar-button:hover,
.oq-bar-button:focus {
	background: var(--oq-bar-btn-survol-fond, var(--oq-cta-bg));
	color: var(--oq-bar-btn-survol-texte, var(--oq-cta-text));
	filter: var(--oq-bar-btn-survol-filtre, brightness(.93));
	transform: translateY(-1px);
}

.oq-bar-close {
	flex: 0 0 auto;
	width: 30px;
	height: 30px;
	padding: 0;
	display: grid;
	place-items: center;
	background: none;
	border: none;
	border-radius: 50%;
	color: var(--oq-muted);
	cursor: pointer;
	transition: background .18s ease, color .18s ease;
}

.oq-bar-close:hover {
	background: rgba(0, 0, 0, .06);
	color: var(--oq-text);
}

.oq-bar.oq-theme-navy .oq-bar-close:hover {
	background: rgba(255, 255, 255, .12);
}

/* ==========================================================================
   TELEPHONE
   --------------------------------------------------------------------------
   En flex-wrap, un element prefere passer a la ligne que retrecir : la base
   du bloc de texte est donc petite, sinon chaque morceau part sur sa propre
   rangee et la barre monte a quatre lignes.
   ========================================================================== */
@media (max-width: 767px) {
	.oq-bar {
		padding-left: 16px;
		padding-right: 16px;
	}

	.oq-bar-inner {
		flex-wrap: wrap;
		column-gap: 12px;
		row-gap: 10px;
	}

	.oq-bar-icon {
		flex-basis: 40px;
		height: 40px;
	}

	.oq-bar-text {
		flex: 1 1 60px;
	}

	.oq-bar-title {
		font-size: 15px;
	}

	.oq-bar-tagline,
	.oq-bar-duration {
		display: none;
	}

	.oq-bar-progress {
		order: 8;
	}

	.oq-bar {
		--oq-bar-btn-flex: 1 0 100%;
	}

	.oq-bar-button {
		order: 9;
	}

	/* Sortie du flux, la croix ne vole pas une rangee a elle seule. */
	.oq-bar-close {
		position: absolute;
		top: -2px;
		right: 0;
	}
}
