/* ------------------------------------------------------------------------------------------ */
/* Ecran de connexion - structure commune a toutes les applications                           */
/*   visuel (pers_config/fond_accueil_login.jpg) a gauche, formulaire a droite                */
/*   les couleurs / police / decor sont des variables : chaque application les redefinit     */
/*   dans pers_config/login/connexion.css (charge apres ce fichier)                           */
/* ------------------------------------------------------------------------------------------ */

.lg-screen {
	--lg-police:            Arial, Helvetica, sans-serif;
	--lg-primaire:          #2F5F8A;		/* titre, bouton, liens */
	--lg-primaire-fonce:    #234867;		/* survol du bouton */
	--lg-primaire-clair:    #E8EFF5;		/* survol des boutons secondaires */
	--lg-focus:             rgba(47, 95, 138, 0.20);
	--lg-texte:             #2B2D30;
	--lg-texte-secondaire:  #5B5B5F;
	--lg-bordure:           #CFD6DB;
	--lg-separateur:        #E3E7EA;
	--lg-fond-visuel:       #2F5F8A;		/* si l'image de fond est absente */
	--lg-voile:             linear-gradient(180deg, rgba(0, 0, 0, 0.10) 0%, rgba(0, 0, 0, 0.45) 55%, rgba(0, 0, 0, 0.80) 100%);
	--lg-accent-surtitre:   #FFFFFF;
	--lg-soustitre:         #E6E9EC;
	--lg-decor:             transparent;	/* triangles en bas du formulaire */
	--lg-progression:       #2F5F8A;		/* barre "connexion en cours" */
	--lg-rayon:             10px;

	position: fixed; inset: 0; z-index: 1000;
	display: flex; flex-wrap: wrap; overflow-y: auto;
	background: #FFFFFF; color: var(--lg-texte); text-align: left;
	font-family: var(--lg-police); font-size: 14px; line-height: 1.5;
}
body:has(.lg-screen) { overflow: hidden; }
.lg-screen *, .lg-screen *::before, .lg-screen *::after { box-sizing: border-box; }

/* --- visuel ------------------------------------------------------------------------------- */
.lg-visual {
	flex: 1 1 560px; min-height: 100%; position: relative; overflow: hidden;
	display: flex; flex-direction: column; justify-content: flex-end;
	background-color: var(--lg-fond-visuel); background-position: center; background-size: cover; background-repeat: no-repeat;
}
.lg-visual::after  { content: ""; position: absolute; inset: 0; background: var(--lg-voile); }
.lg-visual-text    { position: relative; z-index: 1; padding: 48px 56px; display: flex; flex-direction: column; gap: 12px; color: #FFFFFF; }
.lg-surtitre       { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.lg-surtitre em    { font-style: normal; color: var(--lg-accent-surtitre); }
.lg-slogan         { font-size: 36px; font-weight: 700; line-height: 1.15; max-width: 520px; }
.lg-soustitre      { font-size: 15px; color: var(--lg-soustitre); max-width: 480px; }

/* --- formulaire --------------------------------------------------------------------------- */
.lg-panel {
	flex: 1 1 480px; min-height: 100%; position: relative; overflow: hidden;
	display: flex; align-items: center; justify-content: center;
	padding: 48px 24px 110px; background: #FFFFFF;
}
.lg-panel::before, .lg-panel::after { content: ""; position: absolute; bottom: 0; background: var(--lg-decor); }
.lg-panel::before { left: 0;  width: 120px; height: 44px; clip-path: polygon(0 0, 100% 100%, 0 100%); }
.lg-panel::after  { right: 0; width: 220px; height: 80px; clip-path: polygon(100% 0, 100% 100%, 0 100%); }

.lg-box        { width: 100%; max-width: 400px; position: relative; z-index: 1; display: flex; flex-direction: column; gap: 28px; }
.lg-brand      { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.lg-brand img  { height: 56px; width: auto; }
.lg-brand span { padding-left: 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--lg-texte-secondaire); }

.lg-form  { display: flex; flex-direction: column; gap: 18px; margin: 0; }
.lg-titre {
	margin: 0; padding-bottom: 8px;
	font-family: var(--lg-police); font-size: 24px; font-weight: 700; letter-spacing: 0.01em; text-transform: uppercase; color: var(--lg-primaire);
	background: linear-gradient(var(--lg-primaire), var(--lg-primaire)) left bottom / 44px 3px no-repeat;
}
.lg-intro   { margin: 10px 0 0; color: var(--lg-texte-secondaire); }

.lg-message { padding: 12px 14px; border-radius: var(--lg-rayon); font-size: 13px; font-weight: 600; }
.lg-erreur  { background: #FCE8EA; color: #A3122A; }
.lg-info    { background: #E3F5FB; color: #0B5F7C; }

.lg-champ       { display: flex; flex-direction: column; gap: 6px; }
.lg-champ label { font-size: 13px; font-weight: 600; color: var(--lg-texte); }

.lg-screen input.lg-input {
	width: 100%; height: 48px; margin: 0; padding: 0 14px;
	border: 1px solid var(--lg-bordure); border-radius: var(--lg-rayon); background: #FFFFFF; box-shadow: none;
	font-family: var(--lg-police); font-size: 16px; font-weight: 400; line-height: normal; color: var(--lg-texte);
}
.lg-screen input.lg-input:focus { outline: none; border-color: var(--lg-primaire); box-shadow: 0 0 0 3px var(--lg-focus); }

.lg-mdp              { display: flex; align-items: center; border: 1px solid var(--lg-bordure); border-radius: var(--lg-rayon); background: #FFFFFF; }
.lg-mdp:focus-within { border-color: var(--lg-primaire); box-shadow: 0 0 0 3px var(--lg-focus); }
.lg-screen .lg-mdp input.lg-input, .lg-screen .lg-mdp input.lg-input:focus { flex: 1; min-width: 0; height: 46px; border: 0; box-shadow: none; }

.lg-voir {
	height: 40px; margin-right: 4px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; cursor: pointer;
	font-family: var(--lg-police); font-size: 13px; font-weight: 600; color: var(--lg-primaire);
}
.lg-voir:hover { background: var(--lg-primaire-clair); }

.lg-bouton {
	height: 48px; border: 0; border-radius: var(--lg-rayon); background: var(--lg-primaire); cursor: pointer;
	font-family: var(--lg-police); font-size: 15px; font-weight: 700; color: #FFFFFF;
}
.lg-bouton:hover { background: var(--lg-primaire-fonce); }
.lg-bouton:focus-visible, .lg-voir:focus-visible { outline: 3px solid var(--lg-focus); outline-offset: 2px; }

.lg-aide { margin: 0; padding-top: 18px; border-top: 1px solid var(--lg-separateur); font-size: 13px; color: var(--lg-texte-secondaire); }
.lg-aide a { color: var(--lg-primaire); font-weight: 600; text-decoration: none; }
.lg-aide a:hover { text-decoration: underline; }

/* --- "connexion en cours" : barre qui se remplit pendant la redirection (2 s) -------------- */
.lg-progression      { height: 6px; border-radius: 3px; background: var(--lg-separateur); overflow: hidden; }
.lg-progression span { display: block; width: 0; height: 100%; border-radius: 3px; background: var(--lg-progression); animation: lg-progression 2s ease-out forwards; }
.lg-en-cours::after  { content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 10px; vertical-align: -2px; border: 2px solid var(--lg-separateur); border-top-color: var(--lg-primaire); border-radius: 50%; animation: lg-rotation 0.8s linear infinite; }
@keyframes lg-progression { to { width: 100%; } }
@keyframes lg-rotation    { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
	.lg-progression span { animation: none; width: 100%; }
	.lg-en-cours::after  { animation: none; }
}

/* --- tablette / telephone : visuel au-dessus du formulaire -------------------------------- */
@media (max-width: 1040px) {
	.lg-screen       { align-content: flex-start; }
	.lg-visual       { flex-basis: 100%; min-height: 220px; }
	.lg-visual-text  { padding: 28px 24px; }
	.lg-slogan       { font-size: 26px; }
	.lg-panel        { flex-basis: 100%; min-height: 0; padding: 32px 20px 90px; }
}
