/**
 * OmniPractice — ÉCRAN DE SÉANCE (visioconsultation)
 *
 * POURQUOI UN PLEIN ÉCRAN SOMBRE : pendant une consultation, l'interface doit
 * disparaître derrière les visages. Un fond navy fait ressortir l'image vidéo et
 * fatigue moins qu'un fond clair sur une séance d'une heure — c'est aussi ce que
 * font tous les outils du domaine, donc c'est ce que l'utilisateur attend.
 *
 * COULEURS : palette HDdev (#28), aucune exception. Chrome bleu #1e7eff, accent
 * cyan #00d4ff, fonds navy #0c1219 / #111a24 / #172230. États conservés tels
 * quels : succès #20c997, alerte #f59e0b, erreur #ef4444. Aucun violet/indigo,
 * aucun bleu WordPress par défaut.
 *
 * @since 3.63.0
 */

body.opv-open {
	overflow: hidden;
}

.opv-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	flex-direction: column;
	background: #0c1219;
	color: #e8eef6;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ── Barre du haut : état de la séance + chiffrement + sortie ─────────────── */
.opv-topbar {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
	background: #111a24;
	border-bottom: 1px solid #172230;
}

.opv-status {
	font-size: 14px;
	color: #a8b7c7;
}

/* Le cadenas n'est PAS décoratif : il dit si la séance est réellement chiffrée
   de bout en bout. Vert = chiffré, orange = le navigateur ne sait pas le faire.
   Il ne doit jamais être vert « par défaut ». */
.opv-lock {
	font-size: 13px;
	padding: 3px 10px;
	border-radius: 999px;
	white-space: nowrap;
}

.opv-lock.is-secure {
	color: #20c997;
	background: rgba(32, 201, 151, 0.12);
}

.opv-lock.is-clear {
	color: #f59e0b;
	background: rgba(245, 158, 11, 0.12);
}

.opv-btn {
	appearance: none;
	border: 1px solid #172230;
	background: #172230;
	color: #e8eef6;
	border-radius: 8px;
	padding: 8px 14px;
	font-size: 14px;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease;
}

.opv-btn:hover {
	border-color: #1e7eff;
}

.opv-btn:focus-visible {
	outline: 2px solid #00d4ff;
	outline-offset: 2px;
}

.opv-btn-leave {
	margin-left: auto;
	background: #ef4444;
	border-color: #ef4444;
	color: #fff;
}

.opv-btn-toggle.is-on {
	background: linear-gradient(135deg, #1e7eff, #00d4ff);
	border-color: transparent;
	color: #06121f;
	font-weight: 600;
}

.opv-btn-toggle.is-off {
	background: #172230;
	color: #a8b7c7;
}

/* ── Scène : correspondant en grand, soi en incrustation ──────────────────── */
.opv-stage {
	position: relative;
	flex: 1;
	min-height: 0;
	background: #0c1219;
}

.opv-remote {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.opv-video {
	max-width: 100%;
	max-height: 100%;
	background: #06121f;
}

.opv-self {
	position: absolute;
	right: 16px;
	bottom: 16px;
	width: 22%;
	max-width: 260px;
	min-width: 120px;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid #172230;
	background: #06121f;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

.opv-video-self {
	width: 100%;
	display: block;
	/* Image miroir : on se voit comme dans un miroir, sinon le geste de la main
	   part du mauvais côté et déroute. */
	transform: scaleX(-1);
}

.opv-waiting {
	color: #a8b7c7;
	font-size: 15px;
}

.opv-error {
	max-width: 520px;
	padding: 20px 24px;
	border-radius: 12px;
	background: #111a24;
	border: 1px solid #ef4444;
	text-align: center;
}

.opv-error strong {
	display: block;
	margin-bottom: 8px;
	color: #ef4444;
}

.opv-error p {
	margin: 0;
	color: #cdd8e5;
	font-size: 14px;
	line-height: 1.5;
}

/* ── Avertissement casque (texte figé §11 de la spec) ─────────────────────── */
.opv-notice {
	margin: 0;
	padding: 12px 16px;
	background: rgba(245, 158, 11, 0.1);
	border-top: 1px solid rgba(245, 158, 11, 0.35);
	color: #f7d9a4;
	font-size: 13px;
	line-height: 1.5;
}

/* ── Commandes : micro, caméra, et UN volume PAR PISTE ────────────────────── */
.opv-controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px;
	padding: 12px 16px;
	background: #111a24;
	border-top: 1px solid #172230;
}

.opv-slider {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #a8b7c7;
}

.opv-slider-label {
	min-width: 56px;
}

.opv-range {
	width: 140px;
	accent-color: #1e7eff;
}

/* ── Mobile : la séance doit rester utilisable à une main ─────────────────── */
@media (max-width: 640px) {
	.opv-controls {
		gap: 10px;
		padding: 10px 12px;
	}

	.opv-range {
		width: 100px;
	}

	.opv-self {
		width: 34%;
		right: 10px;
		bottom: 10px;
	}
}

/* ── Musique + atténuation (praticien) ─────────────────────────────────────
   Regroupées visuellement : ce sont les commandes de l'AMBIANCE de la séance,
   distinctes du micro et de la caméra qui, eux, concernent la conversation. */
.opv-music {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	padding-left: 16px;
	margin-left: 6px;
	border-left: 1px solid #172230;
}

/* Le sélecteur de fichier natif est masqué : c'est le bouton HDdev qui le
   déclenche, pour ne pas casser la cohérence visuelle de la barre. */
.opv-file {
	display: none;
}

.opv-music-label {
	font-size: 13px;
	color: #00d4ff;
	max-width: 220px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.opv-check {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: #a8b7c7;
	cursor: pointer;
}

.opv-check input {
	accent-color: #1e7eff;
}

/* ── Sous-titres ───────────────────────────────────────────────────────────
   Placés BAS et centrés, sur un fond assombri : ils doivent être lisibles sur
   n'importe quelle image sans masquer le visage — quand on entend mal, on lit
   les lèvres autant que le texte. */
.opv-captions {
	position: absolute;
	left: 50%;
	bottom: 18px;
	transform: translateX(-50%);
	max-width: 80%;
	padding: 8px 14px;
	border-radius: 8px;
	background: rgba(6, 18, 31, 0.78);
	color: #e8eef6;
	font-size: 17px;
	line-height: 1.4;
	text-align: center;
	pointer-events: none;
}

@media (max-width: 640px) {
	.opv-captions {
		font-size: 15px;
		max-width: 92%;
		bottom: 10px;
	}
}

/* Coche casque : même famille visuelle que les autres options de séance. */
.opv-headphones-box {
	accent-color: #1e7eff;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Pictogrammes, VU-mètre, salle d'attente — palette HDdev (#28).
   Picto en trait (currentColor) → prend la couleur du bouton porteur.
   ═══════════════════════════════════════════════════════════════════════════ */

.opv-ico { flex: 0 0 auto; vertical-align: middle; }
.opv-btn-toggle { display: inline-flex; align-items: center; gap: 7px; }
.opv-btn-label { line-height: 1; }

/* VU-mètre en séance (barre de contrôle) : preuve que le micro est capté. */
.opv-meter {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: #a8b7c7;
	padding: 0 4px;
}
.opv-meter[data-muted="1"] { opacity: 0.4; }
.opv-meter-track {
	position: relative;
	width: 90px;
	height: 8px;
	background: #0c1219;
	border: 1px solid #172230;
	border-radius: 6px;
	overflow: hidden;
}
.opv-meter-bar {
	position: absolute;
	left: 0; top: 0; bottom: 0;
	width: 0%;
	background: linear-gradient(90deg, #1e7eff, #00d4ff);
	border-radius: 6px;
	transition: width 0.06s linear;
}
.opv-meter-bar[data-active="1"] { background: linear-gradient(90deg, #00d4ff, #20c997); }

/* ── Salle d'attente (« green room ») ─────────────────────────────────────── */
.opv-lobby {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #0c1219;
	padding: 20px;
}
.opv-lobby-card {
	width: 100%;
	max-width: 420px;
	background: #111a24;
	border: 1px solid #172230;
	border-radius: 16px;
	padding: 22px;
	text-align: center;
	box-shadow: 0 18px 50px rgba(6, 18, 31, 0.55);
}
.opv-lobby-title {
	margin: 0 0 6px;
	font-size: 20px;
	color: #e8eef6;
}
.opv-lobby-hint {
	margin: 0 0 16px;
	font-size: 14px;
	line-height: 1.5;
	color: #a8b7c7;
}
.opv-lobby-preview {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	background: #06121f;
	border: 1px solid #172230;
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 14px;
}
.opv-lobby-preview .opv-video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: scaleX(-1); /* miroir : on se voit comme dans une glace */
}
.opv-lobby-ph {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	color: #5f6f80;
}
.opv-lobby-ph .opv-ico { width: 34px; height: 34px; }
.opv-lobby-ph-txt { font-size: 13px; }
.opv-lobby-meterrow {
	display: flex;
	align-items: center;
	gap: 10px;
	color: #a8b7c7;
	margin-bottom: 16px;
}
.opv-lobby-meterrow .opv-meter-track { flex: 1; height: 10px; }
.opv-lobby-meterlabel { font-size: 13px; min-width: 92px; text-align: left; }
.opv-lobby-toggles {
	display: flex;
	gap: 10px;
	justify-content: center;
	margin-bottom: 12px;
}
.opv-lobby-toggles .opv-btn[disabled] { opacity: 0.5; cursor: default; }
.opv-lobby-status {
	min-height: 18px;
	margin: 0 0 12px;
	font-size: 13px;
	color: #f59e0b;
}
.opv-btn-primary {
	width: 100%;
	background: linear-gradient(135deg, #1e7eff, #00d4ff);
	border-color: transparent;
	color: #06121f;
	font-weight: 700;
	font-size: 15px;
	padding: 12px 16px;
}
.opv-btn-primary:disabled { opacity: 0.6; cursor: default; }

@media (max-width: 640px) {
	.opv-lobby-card { padding: 18px 16px; }
	.opv-meter-track { width: 64px; }
}
