/* ==========================================================================
   Page de connexion HestiaCP – habillage personnalisé
   Emplacement : /usr/local/hestia/web/css/login-custom.css
   ========================================================================== */
:root {
	--lg-bg: #eef2f9;
	--lg-card: #ffffff;
	--lg-ink: #0f172a;
	--lg-muted: #5b667a;
	--lg-line: #d9e0ec;
	--lg-soft: #f1f5fb;
	--lg-accent: #2563eb;
	--lg-accent-hover: #1d4ed8;
	--lg-accent-ink: #ffffff;
	--lg-focus: rgba(37, 99, 235, 0.28);
	--lg-err-bg: #fdecea;
	--lg-err-ink: #a4231a;
	--lg-err-line: #f3b8b3;
	--lg-radius: 10px;
}

@media (prefers-color-scheme: dark) {
	:root {
		--lg-bg: #0b1220;
		--lg-card: #111a2e;
		--lg-ink: #e8eefc;
		--lg-muted: #9aa8c2;
		--lg-line: #24314d;
		--lg-soft: #1a2640;
		--lg-accent: #60a5fa;
		--lg-accent-hover: #93c5fd;
		--lg-accent-ink: #0b1220;
		--lg-focus: rgba(96, 165, 250, 0.35);
		--lg-err-bg: #2b1517;
		--lg-err-ink: #ffb4ac;
		--lg-err-line: #5a2a2d;

	}
}
/* ---------- Fond de page : baies de serveurs ---------- */
body.page-login {
	background: var(--lg-bg);
}

/* Illustration fixe derrière la carte (/images/login-bg.svg).
   Le SVG gère lui-même le mode sombre et le mouvement réduit. */
body.page-login::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background: url("/images/login-bg.svg?v=1") center bottom / cover no-repeat;
}

/* ---------- Carte ---------- */
.login,
.login *,
.login *::before,
.login *::after {
	box-sizing: border-box;
}

.login {
	width: calc(100% - 2rem);
	max-width: 26rem;
	margin: 8vh auto 3rem;
	padding: 3.25rem 2.25rem 3rem;
	color: var(--lg-ink);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	background: var(--lg-card);
	border: 1px solid var(--lg-line);
	border-top: 3px solid var(--lg-accent);
	border-radius: 14px;
	box-shadow:
		0 1px 2px rgba(16, 24, 40, 0.06),
		0 14px 32px -14px rgba(16, 24, 40, 0.22);
}

/* ---------- Logo ---------- */
.login .login-logo {
	display: flex;
	justify-content: center;
	margin: 0 0 2.25rem;
}

.login .login-logo img {
	display: block;
	width: 88px;
	height: auto;
}

/* ---------- Titre ---------- */
.login .login-title {
	margin: 0 0 2.25rem;
	font-size: 1.5rem;
	font-weight: 650;
	line-height: 1.3;
	letter-spacing: -0.01em;
	text-align: center;
	color: var(--lg-ink);
	overflow-wrap: anywhere;
}

/* ---------- Message d'erreur ---------- */
.login .error {
	margin: 0 0 1.25rem;
	padding: 0.75rem 0.875rem;
	font-size: 0.9rem;
	line-height: 1.4;
	color: var(--lg-err-ink);
	background: var(--lg-err-bg);
	border: 1px solid var(--lg-err-line);
	border-radius: var(--lg-radius);
}

/* ---------- Champs ---------- */
.login .form-label {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	margin: 0 0 0.4rem;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--lg-ink);
}

.login .login-form-link {
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--lg-accent);
	text-decoration: none;
}

.login .login-form-link:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.login .form-control {
	display: block;
	width: 100%;
	height: 3rem;
	padding: 0 0.875rem;
	font: inherit;
	font-size: 1rem;
	color: var(--lg-ink);
	background: var(--lg-card);
	border: 1px solid var(--lg-line);
	border-radius: var(--lg-radius);
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login .form-control:hover {
	border-color: var(--lg-muted);
}

.login .form-control:focus {
	outline: 0;
	border-color: var(--lg-accent);
	box-shadow: 0 0 0 4px var(--lg-focus);
}

/* Champ du code 2FA : gros chiffres espacés, comme un code à saisir */
.login #twofa {
	height: 3.5rem;
	padding-left: calc(0.875rem + 0.35em); /* compense l'espacement final pour centrer */
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
	font-size: 1.5rem;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.35em;
	text-align: center;
}

.login #twofa::placeholder {
	color: var(--lg-line);
	opacity: 1;
}

/* ---------- Boutons ---------- */
.login .login-actions {
	display: flex;
	align-items: stretch;
	gap: 0.75rem;
	margin-top: 2.25rem;
}

.login .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	height: 3rem;
	margin: 0;
	padding: 0 1.25rem;
	font: inherit;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1;
	color: var(--lg-accent-ink);
	text-decoration: none;
	cursor: pointer;
	background: var(--lg-accent);
	border: 1px solid var(--lg-accent);
	border-radius: var(--lg-radius);
	box-shadow: none;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.login .button i {
	margin: 0;
}

.login .button:hover {
	background: var(--lg-accent-hover);
	border-color: var(--lg-accent-hover);
}

.login .login-actions .button:not(.button-secondary) {
	flex: 1;
}

.login .button.button-secondary {
	color: var(--lg-ink);
	background: transparent;
	border-color: var(--lg-line);
}

.login .button.button-secondary:hover {
	background: var(--lg-soft);
	border-color: var(--lg-muted);
}

.login .button:focus-visible,
.login .login-form-link:focus-visible {
	outline: 3px solid var(--lg-focus);
	outline-offset: 2px;
}

.login .login-form-link:focus-visible {
	border-radius: 4px;
}

/* ---------- Pied de page ---------- */
.page-login .app {
	background: transparent;
	padding-bottom: 3.5rem; /* laisse la place au pied de page fixe */
}

.page-login .app-footer {
	position: fixed;
	inset: auto 0 0 0;
	z-index: 10;
	margin: 0;
	padding: 0.75rem 1rem;
	font-size: 0.8125rem;
	line-height: 1.4;
	color: var(--lg-muted);
	text-align: center;
	background: var(--lg-card);
	background: color-mix(in srgb, var(--lg-card) 82%, transparent);
	border-top: 1px solid var(--lg-line);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

.page-login .app-footer .container {
	display: flex;
	justify-content: center;
	padding: 0;
}

.page-login .app-footer p {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	color: inherit;
}

.page-login .app-footer-link {
	font-weight: 600;
	color: var(--lg-ink);
	text-decoration: none;
}

.page-login .app-footer-link:hover {
	color: var(--lg-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.page-login .app-footer-link:focus-visible {
	outline: 3px solid var(--lg-focus);
	outline-offset: 2px;
	border-radius: 4px;
}

.page-login .app-footer-version {
	padding: 0.125rem 0.5rem;
	font-size: 0.75rem;
	font-variant-numeric: tabular-nums;
	color: var(--lg-muted);
	border: 1px solid var(--lg-line);
	border-radius: 999px;
}

/* ---------- Éléments du footer.php (bouton raccourcis, spinner, dialogue) ---------- */
/* Bouton flottant « raccourcis » : remonté au-dessus de la barre du bas */
.page-login .button-floating-shortcuts {
	bottom: 4.5rem;
	right: 1.25rem;
	width: 2.75rem;
	height: 2.75rem;
	color: var(--lg-muted);
	background: var(--lg-card);
	border: 1px solid var(--lg-line);
	box-shadow: 0 6px 16px -8px rgba(16, 24, 40, 0.3);
	transition: color 0.15s ease, border-color 0.15s ease;
}

.page-login .button-floating-shortcuts:hover {
	color: var(--lg-accent);
	background: var(--lg-card);
	border-color: var(--lg-accent);
}

.page-login .button-floating-shortcuts:focus-visible {
	outline: 3px solid var(--lg-focus);
	outline-offset: 2px;
}

/* Spinner : couleurs du thème (on ne touche pas au display, géré par le JS) */
.page-login .spinner-overlay {
	background: rgba(15, 18, 25, 0.35);
}

.page-login .spinner-overlay i {
	color: var(--lg-accent);
}

/* Dialogue des raccourcis */
.page-login .shortcuts {
	color: var(--lg-ink);
	background: var(--lg-card);
	border: 1px solid var(--lg-line);
	border-radius: 14px;
	box-shadow: 0 24px 60px -20px rgba(16, 24, 40, 0.5);
}

.page-login .shortcuts::backdrop {
	background: rgba(15, 18, 25, 0.55);
}

.page-login .shortcuts-header {
	border-bottom: 1px solid var(--lg-line);
}

.page-login .shortcuts-title {
	font-weight: 650;
	color: var(--lg-ink);
}

.page-login .shortcuts-close {
	color: var(--lg-muted);
	cursor: pointer;
}

.page-login .shortcuts-close:hover {
	color: var(--lg-ink);
}

.page-login .shortcuts .key {
	color: var(--lg-ink);
	background: var(--lg-soft);
	border: 1px solid var(--lg-line);
	border-radius: 6px;
}

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
	.login {
		margin-top: 5vh;
		padding: 2.5rem 1.25rem 2.25rem;
	}

	.login .login-actions {
		flex-direction: column-reverse;
	}

	.login .login-actions .button {
		width: 100%;
	}
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
	.login .form-control,
	.login .button,
	.page-login .button-floating-shortcuts {
		transition: none;
	}
}

/* ==========================================================================
   Bandeau « machine à écrire » à 3 lignes – page de connexion
   Accents en codes CSS (\0000e9 = é). Après un code, un espace est avalé :
   on en met donc deux quand on veut en garder un.
   ========================================================================== */
body.page-login {
	--lg-marquee-line: 2.5rem;   /* hauteur d'une ligne */
	--lg-marquee-h: 7.5rem;      /* hauteur totale = 3 lignes */

	--lg-line-1: "Foyabo Web Service - FWS \002022  Foyabo Technologies";
	--lg-line-2: "H\0000e9bergement web rapide, s\0000e9curis\0000e9  et fiable";
	--lg-line-3: "H\0000e9bergez chez nous, dormez tranquille";
}

/* Fond du bandeau + fines séparations entre les lignes */
.page-login .app::before {
	content: "";
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 5;
	height: var(--lg-marquee-h);
	background:
		linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08)) 0 33.333% / 100% 1px no-repeat,
		linear-gradient(rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.08)) 0 66.666% / 100% 1px no-repeat,
		linear-gradient(90deg, #0b1220 0%, #0f172a 50%, #0b1220 100%);
	border-bottom: 2px solid #2563eb;
	pointer-events: none;
}

/* Base commune aux 3 lignes */

body.page-login::after,
.page-login .app::after,
.login::before {
	position: fixed;
	z-index: 6;
	width: calc(var(--n) * 1ch);   /* largeur = nombre de caractères */
	height: var(--lg-marquee-line);
	line-height: var(--lg-marquee-line);
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
	font-size: min(1.25rem, 3.1vw);
	font-weight: 600;
	letter-spacing: 0;
	white-space: pre;
	pointer-events: none;
	animation-duration: 18s;
	animation-iteration-count: infinite;
	animation-fill-mode: both;
}

/* Ligne 1 : à gauche, de gauche à droite */
body.page-login::after {
	--n: 46;
	content: var(--lg-line-1);
	top: 0;
	left: 1.5rem;
	color: #e8eefc;
	animation-name: lg-type-ltr;
}

/* Ligne 2 : à droite, de droite à gauche (sens opposé) */
.page-login .app::after {
	--n: 42;

	content: var(--lg-line-2);
	top: var(--lg-marquee-line);
	right: 1.5rem;
	color: #60a5fa;
	animation-name: lg-type-rtl;
	animation-delay: 1.5s;
}

/* Ligne 3 : à gauche, de gauche à droite */
.login::before {
	--n: 37;
	content: var(--lg-line-3);
	top: calc(var(--lg-marquee-line) * 2);
	left: 1.5rem;
	color: #93c5fd;
	animation-name: lg-type-ltr;
	animation-delay: 3s;
}

/* Écriture puis effacement, caractère par caractère (--n = nombre de caractères) */
@keyframes lg-type-ltr {
	0%   { clip-path: inset(0 100% 0 0); animation-timing-function: steps(var(--n), end); }
	35%  { clip-path: inset(0 0 0 0); }
	85%  { clip-path: inset(0 0 0 0); animation-timing-function: steps(var(--n), end); }
	100% { clip-path: inset(0 100% 0 0); }
}

@keyframes lg-type-rtl {
	0%   { clip-path: inset(0 0 0 100%); animation-timing-function: steps(var(--n), end); }
	35%  { clip-path: inset(0 0 0 0); }
	85%  { clip-path: inset(0 0 0 0); animation-timing-function: steps(var(--n), end); }
	100% { clip-path: inset(0 0 0 100%); }

}

/* La carte reste sous le bandeau */
.page-login .app {
	padding-top: var(--lg-marquee-h);
}

/* Petits écrans : lignes plus basses */
@media (max-width: 480px) {
	body.page-login {
		--lg-marquee-line: 2rem;
		--lg-marquee-h: 6rem;
	}

	body.page-login::after,
	.login::before {
		left: 0.75rem;
	}

	.page-login .app::after {
		right: 0.75rem;
	}
}

/* Mouvement réduit : lignes fixes, sans animation */
@media (prefers-reduced-motion: reduce) {
	body.page-login::after,
	.page-login .app::after,
	.login::before {
		width: auto;
		max-width: calc(100vw - 3rem);
		overflow: hidden;

		text-overflow: ellipsis;
		animation: none;
		clip-path: none;
	}
}

