/* ==========================================================================
   Formation Qualinet — page Formation et lecteur
   Charte relevée sur qualinet.ca :
   - rouge de la marque #DA291C (logo, theme-color), gris du logo #707372
   - police : Inter partout (embarquée dans le plugin, voir fonts.css)
   Pour ajuster la charte, modifier seulement les variables ci-dessous.
   ========================================================================== */

.fq-app,
.fq-stage {
	--fq-red: #DA291C;          /* couleur principale (modifiable dans Formation > Réglages) */
	--fq-red-rgb: 218, 41, 28;  /* même couleur en RGB, pour les halos de focus */
	--fq-red-dark: #B32117;     /* survol */
	--fq-red-soft: #FDECEA;     /* fond rouge très pâle */
	--fq-ink: #1B1B1B;          /* texte principal */
	--fq-muted: #707372;        /* gris du logo Qualinet : texte secondaire */
	--fq-line: #E4E4E4;         /* bordures */
	--fq-bg: #F6F6F6;           /* fond de section */
	--fq-ok: #1E7B3A;           /* complété */
	--fq-ok-soft: #E6F4EA;
	--fq-warn-soft: #FFF4D6;
	--fq-warn: #8A5A00;
	--fq-radius: 10px;
	--fq-radius-btn: 999px;
	--fq-font: 'FQ Inter', 'Inter', sans-serif;
	--fq-font-heading: var(--fq-font);
	font-family: var(--fq-font);
}

.fq-app *,
.fq-stage * {
	box-sizing: border-box;
	font-family: inherit;
}

/* Inter partout, même si le thème impose sa propre police aux titres et boutons */
.fq-app,
.fq-app *,
.fq-stage,
.fq-stage * {
	font-family: 'FQ Inter', 'Inter', sans-serif !important;
	letter-spacing: normal;
}

.fq-app {
	max-width: 1000px;
	margin: 0 auto;
	container-type: inline-size;
	color: var(--fq-ink);
	line-height: 1.55;
}

.fq-title {
	margin: 0 0 .1em;
	font-size: 1.7em;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -.01em;
	color: var(--fq-ink);
}

.fq-title::after {
	content: "";
	display: block;
	width: 48px;
	height: 3px;
	margin-top: 12px;
	border-radius: 2px;
	background: var(--fq-red);
}

.fq-privacy {
	color: var(--fq-muted);
	font-size: .9em;
	margin: 1em 0 1.5em;
}

.fq-notice {
	padding: .85em 1.1em;
	border-radius: var(--fq-radius);
	margin: 0 0 1.2em;
}

.fq-notice--info {
	background: var(--fq-bg);
	border: 1px solid var(--fq-line);
	border-left: 4px solid var(--fq-red);
}

.fq-notice--error {
	background: var(--fq-red-soft);
	border: 1px solid #F3B8B2;
	color: #8E1B12;
}

/* ---------- Connexion ---------- */
.fq-login {
	max-width: 420px;
	margin: 0 auto;
	padding: 2em 1.8em 1.6em;
	border: 1px solid var(--fq-line);
	border-top: 5px solid var(--fq-red);
	border-radius: var(--fq-radius);
	background: #fff;
	box-shadow: 0 8px 28px rgba(0, 0, 0, .06);
}

.fq-login h2 {
	margin: 0 0 .9em;
	font-weight: 700;
	line-height: 1.25;
}

.fq-login form p {
	margin: 0 0 1em;
}

.fq-login label {
	display: block;
	font-weight: 700;
	font-size: .92em;
	margin-bottom: .35em;
}

.fq-login input[type="text"],
.fq-login input[type="password"] {
	width: 100%;
	padding: .75em .9em;
	border: 1px solid #CFCFCF;
	border-radius: 8px;
	background: #fff;
	color: var(--fq-ink);
	font-size: 1em;
	box-shadow: none;
}

.fq-login input[type="text"]:focus,
.fq-login input[type="password"]:focus {
	outline: 0;
	border-color: var(--fq-red);
	box-shadow: 0 0 0 3px rgba(var(--fq-red-rgb), .18);
}

.fq-login input[type="submit"] {
	width: 100%;
	padding: .9em 1em;
	border: 0;
	border-radius: var(--fq-radius-btn);
	background: var(--fq-red);
	color: #fff;
	font-size: 1em;
	font-weight: 700;
	letter-spacing: .02em;
	cursor: pointer;
	transition: background .15s, transform .05s;
}

.fq-login input[type="submit"]:hover { background: var(--fq-red-dark); }
.fq-login input[type="submit"]:active { transform: translateY(1px); }

.fq-login .fq-privacy {
	text-align: center;
	margin: 1.2em 0 0;
}

/* ---------- Liste des vidéos : cartes, 2 par ligne ---------- */
.fq-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
}

.fq-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 24px 24px 22px;
	border: 1px solid var(--fq-line);
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .05);
	overflow: hidden;
	transition: box-shadow .2s, transform .2s;
}

.fq-card::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	height: 4px;
	background: var(--fq-red);
}

.fq-card--completed::before,
.fq-card--completed_late::before { background: var(--fq-ok); }

.fq-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 2px 4px rgba(0, 0, 0, .05), 0 14px 32px rgba(0, 0, 0, .09);
}

.fq-card__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.fq-card__num {
	font-size: .74em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .1em !important;
	color: var(--fq-red);
}

.fq-card--completed .fq-card__num,
.fq-card--completed_late .fq-card__num { color: var(--fq-ok); }

.fq-card__title {
	margin: 0;
	font-size: 1.15em;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: -.005em;
	color: var(--fq-ink);
	text-transform: none;
}

.fq-card__facts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px 16px;
	margin: 0;
	padding: 14px 0 0;
	border-top: 1px solid var(--fq-line);
}

.fq-card__facts div { min-width: 0; }

.fq-card__facts dt {
	margin: 0 0 2px;
	font-size: .72em;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .08em !important;
	color: var(--fq-muted);
}

.fq-card__facts dd {
	margin: 0;
	font-size: .95em;
	font-weight: 600;
	color: var(--fq-ink);
	font-variant-numeric: tabular-nums;
}

.fq-card__error {
	margin: 0;
	padding: .55em .85em;
	border-radius: 8px;
	background: var(--fq-red-soft);
	color: #8E1B12;
	font-size: .9em;
}

.fq-card__error[hidden] { display: none; }

.fq-card__action {
	margin-top: auto;
	padding-top: 2px;
}

.fq-card__action .fq-btn { width: 100%; }

.fq-card__done {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: .7em 1em;
	border-radius: var(--fq-radius-btn);
	background: var(--fq-ok-soft);
	color: var(--fq-ok);
	font-size: .92em;
	font-weight: 600;
}

/* Étiquettes de statut */
.fq-badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 999px;
	font-size: .72em;
	font-weight: 700;
	letter-spacing: .02em;
	background: #ECECEC;
	color: #3A3A3A;
	white-space: nowrap;
}

.fq-badge--progress { background: var(--fq-warn-soft); color: var(--fq-warn); }
.fq-badge--late { background: var(--fq-red); color: #fff; }
.fq-badge--completed { background: var(--fq-ok-soft); color: var(--fq-ok); }
.fq-badge--completed_late { background: var(--fq-warn-soft); color: var(--fq-warn); }

/* Bouton principal (Visionner / Reprendre) */
.fq-btn {
	padding: .8em 1.6em;
	border: 2px solid var(--fq-red);
	border-radius: var(--fq-radius-btn);
	background: var(--fq-red);
	color: #fff;
	font-size: 1em;
	font-weight: 700;
	letter-spacing: .01em;
	cursor: pointer;
	transition: background .15s, border-color .15s;
}

.fq-btn:hover:not(:disabled) {
	background: var(--fq-red-dark);
	border-color: var(--fq-red-dark);
}

.fq-btn:focus-visible,
.fq-check__btn:focus-visible,
.fq-ctl:focus-visible,
.fq-stage__close:focus-visible {
	outline: 3px solid rgba(var(--fq-red-rgb), .45);
	outline-offset: 2px;
}

.fq-btn:disabled { opacity: .6; cursor: wait; }

.fq-logout {
	margin-top: 1.8em;
	padding-top: 1em;
	border-top: 1px solid var(--fq-line);
	font-size: .88em;
	color: var(--fq-muted);
}

.fq-logout a {
	color: var(--fq-red);
	font-weight: 700;
	text-decoration: none;
}

.fq-logout a:hover { text-decoration: underline; }

/* Une seule colonne quand la zone de contenu est étroite */
@container (max-width: 560px) {
	.fq-list { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
	.fq-list { grid-template-columns: 1fr; }
	.fq-card { padding: 20px 18px 18px; }
	.fq-login { padding: 1.5em 1.2em; }
}

/* ---------- Lecteur plein écran ---------- */
body.fq-lock { overflow: hidden; }

.fq-stage {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	flex-direction: column;
	background: #111;
	color: #fff;
}

.fq-stage__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 18px;
	background: #1B1B1B;
	border-bottom: 3px solid var(--fq-red);
}

.fq-stage__title {
	font-weight: 700;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.fq-stage__close {
	padding: .5em 1.2em;
	border: 2px solid #fff;
	border-radius: var(--fq-radius-btn);
	background: transparent;
	color: #fff;
	font-weight: 700;
	cursor: pointer;
	flex-shrink: 0;
}

.fq-stage__close:hover { background: #fff; color: var(--fq-ink); }

.fq-video-wrap {
	position: relative;
	flex: 1;
	min-height: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #000;
}

.fq-video {
	max-width: 100%;
	max-height: 100%;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: #000;
}

.fq-notice-bar {
	z-index: 6;
	position: absolute;
	left: 12px;
	right: 12px;
	top: 12px;
	padding: .7em 1em;
	border-radius: 8px;
	background: rgba(27, 27, 27, .95);
	border-left: 4px solid #fff;
	color: #fff;
	font-size: .95em;
}

.fq-notice-bar--warn {
	background: rgba(179, 33, 23, .97);
	border-left-color: #fff;
}

.fq-controls {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 18px calc(10px + env(safe-area-inset-bottom, 0px));
	background: #1B1B1B;
}

.fq-ctl {
	min-width: 42px;
	height: 42px;
	border: 0;
	border-radius: 50%;
	background: var(--fq-red);
	color: #fff;
	font-size: 1em;
	cursor: pointer;
	transition: background .15s;
}

.fq-ctl:hover { background: var(--fq-red-dark); }

.fq-progress {
	flex: 1;
	height: 8px;
	border-radius: 4px;
	background: #3A3A3A;
	overflow: hidden;
	pointer-events: none;
}

.fq-progress__fill {
	display: block;
	height: 100%;
	width: 0;
	background: var(--fq-red);
}

.fq-time {
	font-variant-numeric: tabular-nums;
	font-size: .9em;
	white-space: nowrap;
}

/* ---------- Fenêtre « Je suis toujours là » ---------- */
.fq-check,
.fq-overlay {
	z-index: 5;
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(10, 10, 10, .88);
}

.fq-check[hidden],
.fq-overlay[hidden],
.fq-notice-bar[hidden] { display: none; }

.fq-check__box,
.fq-overlay__box {
	width: 100%;
	max-width: 440px;
	padding: 28px 26px 26px;
	border-radius: 14px;
	border-top: 6px solid var(--fq-red);
	background: #fff;
	color: var(--fq-ink);
	text-align: center;
}

.fq-check__box h3,
.fq-overlay__box h3 {
	margin: 0 0 .4em;
	font-weight: 700;
	color: var(--fq-ink);
}

.fq-check__box p,
.fq-overlay__box p { margin: 0 0 1em; color: var(--fq-muted); }

.fq-check__count {
	font-size: 3.6em;
	font-weight: 700;
	line-height: 1.1;
	color: var(--fq-red);
	font-variant-numeric: tabular-nums;
}

.fq-check__bar {
	height: 8px;
	margin: .6em 0 1em;
	border-radius: 4px;
	background: #E9E9E9;
	overflow: hidden;
}

.fq-check__fill {
	display: block;
	height: 100%;
	width: 100%;
	background: var(--fq-red);
	transition: width .2s linear;
}

.fq-check__btn {
	width: 100%;
	padding: .95em 1em;
	border: 0;
	border-radius: var(--fq-radius-btn);
	background: var(--fq-red);
	color: #fff;
	font-size: 1.1em;
	font-weight: 700;
	letter-spacing: .02em;
	cursor: pointer;
	transition: background .15s;
}

.fq-check__btn:hover:not(:disabled) { background: var(--fq-red-dark); }
.fq-check__btn:disabled { opacity: .6; }
