/* WSC Université — feuille de style de l'application /universite, sans compilation.
   Système visuel des maquettes validées par Gary (docs/maquettes, D26) : Figtree, bleu marine #1B3A6B, bleu clair
   #6E8FC0, fond #F5F7FA, cartes blanches bordées #E3E7EE (rayon 16 à 18 px), texte #14161A et gris #5A6170, succès
   #1E6B52, erreur #A1262E, attention #8A5300 ; icônes au trait (Lucide) ; cibles d'au moins 44 px.
   Poste 1366×768 : barre supérieure + menu des espaces à gauche. Téléphone 360 à 412 px : barre d'onglets en bas,
   jamais de défilement horizontal. */

@font-face {
	font-family: "Figtree"; font-style: normal; font-weight: 400 800; font-display: swap;
	src: url("../fonts/figtree.woff2") format("woff2");
}

:root {
	--marine: #1B3A6B; --marine-fonce: #0F2547; --clair: #6E8FC0; --clair-texte: #C9D7EE;
	--fond: #F5F7FA; --carte: #FFFFFF; --sous-fond: #F8FAFC; --actif: #EAF0F8; --piste: #E8ECF2;
	--bord: #E3E7EE; --bord-fort: #D5DBE5; --separateur: #EEF1F5;
	--texte: #14161A; --texte-2: #2A2F38; --gris: #5A6170; --gris-clair: #A3ACBA;
	--succes: #1E6B52; --succes-fond: #E6F2EC; --erreur: #A1262E; --erreur-fond: #FBEBEC;
	--attention: #8A5300; --attention-fond: #FBF1E2;
	--rayon: 18px; --rayon-moyen: 14px; --rayon-petit: 10px;
	--entete-h: 60px; --onglets-h: 72px; --rail-l: 232px;
	--ombre: 0 1px 2px rgba(20, 22, 26, .04), 0 8px 24px rgba(20, 22, 26, .06);
	color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
	margin: 0; min-height: 100vh; background: var(--fond); color: var(--texte);
	font: 400 15px/1.5 "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-variant-numeric: tabular-nums; overflow-x: hidden;
}
a { color: var(--marine); }
a:hover { color: var(--marine-fonce); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
img, svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--clair); outline-offset: 2px; border-radius: 6px; }

.ic { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8;
	stroke-linecap: round; stroke-linejoin: round; }
.ic.petit { width: 16px; height: 16px; }
.ic.grand { width: 26px; height: 26px; }

.evitement { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--marine); color: #fff;
	padding: 10px 14px; border-radius: var(--rayon-petit); font-weight: 700; text-decoration: none; }
.evitement:focus { left: 8px; color: #fff; }

/* ---------------------------------------------------------------- en-tête */
.entete {
	position: sticky; top: 0; z-index: 20; min-height: var(--entete-h);
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 8px 24px; background: var(--carte); border-bottom: 1px solid var(--bord);
	padding-top: max(8px, env(safe-area-inset-top));
}
.marque { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 44px; text-decoration: none; color: var(--texte); }
.marque:hover { color: var(--texte); }
.sigle {
	width: 34px; height: 34px; border-radius: 9px; background: var(--marine); color: #fff; flex-shrink: 0;
	display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: .4px;
}
.marque-texte { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.marque-texte strong { font-size: 15px; font-weight: 800; white-space: nowrap; }
.marque-texte small { font-size: 13px; color: var(--gris); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.marque-texte small::before { content: "· "; }

.entete-etat { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.annee { font-size: 13px; color: var(--gris); white-space: nowrap; }
.reseau { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.reseau::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.reseau.en-ligne { color: var(--succes); }
.reseau.lent { color: var(--attention); }
.reseau.hors-ligne { color: var(--erreur); }

.langue { display: inline-flex; border: 1px solid var(--bord-fort); border-radius: 999px; overflow: hidden; flex-shrink: 0; }
.langue button {
	border: 0; background: var(--carte); color: var(--gris); min-width: 44px; min-height: 36px; padding: 0 10px;
	font-size: 12px; font-weight: 700; cursor: pointer;
}
.langue button[aria-pressed="true"] { background: var(--marine); color: #fff; }

.compte {
	display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 6px 4px 4px;
	border-radius: 999px; cursor: pointer; text-align: left; min-height: 44px;
}
.compte:hover { background: var(--sous-fond); }
.avatar {
	width: 32px; height: 32px; border-radius: 50%; background: var(--actif); color: var(--marine); flex-shrink: 0;
	display: grid; place-items: center; font-weight: 800; font-size: 13px; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.grand { width: 48px; height: 48px; font-size: 17px; }
.qui { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.qui strong { font-size: 13px; font-weight: 700; white-space: nowrap; }
.qui small { font-size: 12px; color: var(--gris); white-space: nowrap; }

/* ---------------------------------------------------------------- corps : menu des espaces + vue */
.corps { display: flex; align-items: flex-start; min-height: calc(100vh - var(--entete-h)); }
.rail {
	position: sticky; top: var(--entete-h); width: var(--rail-l); flex-shrink: 0;
	height: calc(100vh - var(--entete-h)); overflow-y: auto; background: var(--carte); border-right: 1px solid var(--bord);
	padding: 16px 12px; display: flex; flex-direction: column; gap: 4px;
}
.rail a, .menu-espaces a {
	display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: var(--rayon-petit);
	color: var(--texte-2); text-decoration: none; font-size: 14px; font-weight: 600;
}
.rail a:hover, .menu-espaces a:hover { background: var(--sous-fond); color: var(--texte); }
.rail a[aria-current="page"] { background: var(--actif); color: var(--marine); font-weight: 800; }
.rail a .libelle, .menu-espaces a .libelle { flex: 1; min-width: 0; }
.rail-titre { margin: 14px 12px 4px; font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--gris); }
.rail-pied { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--separateur); display: flex; flex-direction: column; gap: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bientot.point { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 50%; background: var(--gris-clair);
	flex-shrink: 0; position: relative; }
.bientot {
	font-size: 11px; font-weight: 700; color: var(--gris); background: var(--sous-fond); border: 1px solid var(--bord);
	padding: 1px 7px; border-radius: 999px; white-space: nowrap;
}

.vue { flex: 1; min-width: 0; padding: 24px 28px 40px; outline: none; display: flex; flex-direction: column; gap: 18px; }
.page { width: 100%; max-width: 1120px; display: flex; flex-direction: column; gap: 18px; }

/* ---------------------------------------------------------------- éléments communs */
.titre-page { font-size: 28px; font-weight: 800; letter-spacing: -.4px; line-height: 1.2; }
.sous-titre { font-size: 15px; color: var(--gris); }
.fil { font-size: 13px; color: var(--gris); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fil a { color: var(--gris); }
.surtitre { font-size: 12px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--marine); }
.titre-section { font-size: 16px; font-weight: 800; }

.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 20px; }
.etat-synchro { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--succes); }
.etat-synchro::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.etat-synchro.hors-ligne { color: var(--attention); }

.pastille { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pastille.attente { color: var(--marine); background: var(--actif); }
.pastille.ok { color: var(--succes); background: var(--succes-fond); }
.pastille.alerte { color: var(--attention); background: var(--attention-fond); }

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px;
	border-radius: var(--rayon-moyen); border: 1px solid var(--bord-fort); background: var(--carte); color: var(--texte-2);
	font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--sous-fond); color: var(--texte); }
.btn.primaire { background: var(--marine); border-color: var(--marine); color: #fff; }
.btn.primaire:hover { background: var(--marine-fonce); border-color: var(--marine-fonce); color: #fff; }
.btn.large { width: 100%; min-height: 48px; }
.btn.fantome { border-color: transparent; background: none; }
.btn.icone-seule { width: 44px; padding: 0; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------------------------------------------------------------- Aujourd'hui */
.bonjour { display: flex; flex-direction: column; gap: 6px; }
.vide-jour { display: flex; gap: 16px; align-items: flex-start; }
.ic-rond {
	width: 48px; height: 48px; border-radius: 50%; background: var(--actif); color: var(--marine); flex-shrink: 0;
	display: grid; place-items: center;
}
.vide-jour h2, .preparation h2 { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.vide-jour p, .preparation p { color: var(--texte-2); font-size: 15px; max-width: 68ch; }
.vide-jour .ici { margin-top: 10px; font-size: 14px; color: var(--gris); }

.grille-espaces { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.espace {
	display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: var(--texte); min-height: 100%;
	transition: border-color .15s, box-shadow .15s;
}
.espace:hover { color: var(--texte); border-color: var(--clair); box-shadow: var(--ombre); }
.espace-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ic-fond {
	width: 40px; height: 40px; border-radius: 12px; background: var(--actif); color: var(--marine); flex-shrink: 0;
	display: grid; place-items: center;
}
.espace strong { font-size: 16px; font-weight: 800; }
.espace small { font-size: 14px; color: var(--gris); line-height: 1.45; }
.espace-texte { display: flex; flex-direction: column; gap: 4px; }

/* ---------------------------------------------------------------- espace en préparation */
.preparation { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 28px; }
.preparation .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

/* ---------------------------------------------------------------- connexion */
.page-connexion { min-height: calc(100vh - var(--entete-h)); display: flex; flex-direction: column; align-items: center;
	justify-content: center; gap: 16px; padding: 32px 16px 48px; }
.carte-connexion { width: 100%; max-width: 420px; padding: 28px; display: flex; flex-direction: column; gap: 18px;
	box-shadow: var(--ombre); }
.carte-connexion .titre-page { font-size: 26px; }
.formulaire { display: flex; flex-direction: column; gap: 14px; }
.champ { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; color: var(--texte-2); }
.champ input {
	width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--bord-fort); border-radius: 12px;
	background: var(--carte); font-size: 16px; font-weight: 500; color: var(--texte);
}
.champ input:focus { outline: none; border-color: var(--marine); box-shadow: 0 0 0 3px rgba(110, 143, 192, .35); }
.champ-mdp { position: relative; display: block; }
.champ-mdp input { padding-right: 52px; }
.champ-mdp button { position: absolute; right: 2px; top: 2px; bottom: 2px; width: 44px; border: 0; background: none;
	color: var(--gris); cursor: pointer; display: grid; place-items: center; border-radius: 10px; }
.message-erreur { display: flex; gap: 8px; align-items: flex-start; color: var(--erreur); background: var(--erreur-fond);
	border-radius: 12px; padding: 10px 12px; font-size: 14px; font-weight: 600; }
.lien-discret { font-size: 14px; font-weight: 600; align-self: center; display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }
.mention { font-size: 13px; color: var(--gris); text-align: center; max-width: 420px; }

/* ---------------------------------------------------------------- bandeaux, toasts, modales */
.bandeau { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--rayon-moyen);
	font-size: 14px; font-weight: 600; }
.bandeau.hors-ligne { background: var(--attention-fond); color: var(--attention); }

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; gap: 8px;
	max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; align-items: flex-start; gap: 10px; background: var(--texte); color: #fff; padding: 12px 12px 12px 14px;
	border-radius: var(--rayon-moyen); box-shadow: var(--ombre); font-size: 14px; }
.toast.ko { background: var(--erreur); }
.toast.ok { background: var(--succes); }
.toast span { flex: 1; }
.toast button { border: 0; background: none; color: inherit; cursor: pointer; width: 28px; height: 28px; display: grid; place-items: center; }

body.modale-ouverte { overflow: hidden; }
.voile { position: fixed; inset: 0; z-index: 70; background: rgba(15, 37, 71, .38); display: flex; align-items: center;
	justify-content: center; padding: 16px; }
.modale { width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--carte);
	border-radius: var(--rayon); box-shadow: 0 20px 60px rgba(15, 37, 71, .25); }
.modale-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 14px 6px 20px; }
.modale-tete h2 { font-size: 18px; font-weight: 800; }
.modale-corps { padding: 6px 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.compte-qui { display: flex; align-items: center; gap: 12px; }
.compte-qui .qui strong { font-size: 16px; white-space: normal; }
.compte-qui .qui small { font-size: 14px; white-space: normal; }
.menu-espaces { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--separateur); padding-top: 12px; }
.menu-ligne { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--separateur);
	padding-top: 14px; font-size: 14px; font-weight: 700; color: var(--texte-2); }
.menu-actions { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--separateur); padding-top: 14px; }
.menu-actions .btn { justify-content: flex-start; }
.etapes { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }

.squelette { height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--piste), var(--sous-fond), var(--piste));
	background-size: 200% 100%; animation: miroiter 1.2s infinite linear; }
@keyframes miroiter { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- onglets (téléphone) */
.onglets { display: none; }

@media (max-width: 899px) {
	:root { --entete-h: 64px; }
	.entete { padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); }
	.marque-texte { flex-direction: column; align-items: flex-start; gap: 0; }
	.marque-texte strong { font-size: 14px; }
	.marque-texte small { font-size: 12px; max-width: 100%; }
	.marque-texte small::before { content: none; }
	.annee, .compte .qui, .entete .installer { display: none; }
	.langue button { min-height: 44px; }
	.reseau { font-size: 0; gap: 0; }
	.reseau::before { width: 9px; height: 9px; }
	.entete-etat { gap: 8px; }
	.compte { padding: 0; width: 44px; justify-content: center; }
	.avatar { width: 36px; height: 36px; }
	.rail { display: none; }
	.corps { display: block; min-height: 0; }
	.vue { padding: 18px 16px calc(var(--onglets-h) + 28px + env(safe-area-inset-bottom)); gap: 16px; }
	.page { gap: 16px; }
	.titre-page { font-size: 26px; }
	.carte { padding: 16px; }
	.preparation { padding: 20px 16px; }
	.vide-jour { gap: 12px; }
	.ic-rond { width: 44px; height: 44px; }
	.grille-espaces { grid-template-columns: 1fr; gap: 12px; }
	.onglets {
		display: grid; grid-template-columns: repeat(var(--nb-onglets, 5), minmax(0, 1fr)); position: fixed; left: 0; right: 0;
		bottom: 0; z-index: 30; height: calc(var(--onglets-h) + env(safe-area-inset-bottom));
		padding-bottom: env(safe-area-inset-bottom); background: var(--carte); border-top: 1px solid var(--bord);
	}
	.onglets a, .onglets button {
		display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0;
		border: 0; background: none; text-decoration: none; color: var(--gris); font-size: 11px; font-weight: 600;
		padding: 6px 2px; cursor: pointer; line-height: 1.2;
	}
	.onglets a span, .onglets button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
	.onglets [aria-current="page"] { color: var(--marine); font-weight: 800; }
	.toasts { left: 16px; right: 16px; bottom: calc(var(--onglets-h) + 12px + env(safe-area-inset-bottom)); max-width: none; }
	.voile { align-items: flex-end; padding: 0; }
	.modale { max-width: none; border-radius: var(--rayon) var(--rayon) 0 0; max-height: 88vh;
		padding-bottom: env(safe-area-inset-bottom); }
	.page-connexion { justify-content: flex-start; padding-top: 24px; }
	.carte-connexion { padding: 22px 18px; }
}

@media (max-width: 380px) {
	.entete { padding-left: 12px; padding-right: 12px; }
	.marque-texte small { display: none; }
	.titre-page { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
	* { animation: none !important; transition: none !important; }
}

@media print {
	.entete, .rail, .onglets, .toasts { display: none !important; }
	body { background: #fff; }
}
