/*--------------------------------------------------*/
/* Page de connexion (login.xhtml)                  */
/*--------------------------------------------------*/

/* Thème client (multi-tenant) : seules ces variables + le logo changent par client */
:root {
	--tenant-navy: #0B2E4F; /* fond du panneau client */
	--tenant-accent: #1F5C9E; /* bouton, liens */
	--tenant-accent-hover: #0B2E4F;
}

/* Base */
body.login-body {
	margin: 0;
	padding: 0;
	font-family: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	font-size: 16px;
	color: #14202E;
	background: #FFFFFF;
}

.login-page, .login-page * {
	box-sizing: border-box;
}

.login-page a {
	color: var(--tenant-accent);
}

.login-page a:hover {
	color: var(--tenant-accent-hover);
}

.login-page input::placeholder {
	color: #7A8594;
	opacity: 1;
}

/* Mise en page */
.login-page {
	min-height: 100vh;
	display: flex;
	flex-wrap: wrap;
}

/* Panneau client (gauche) */
.login-brand {
	flex: 1 1 420px;
	min-height: 360px;
	background: var(--tenant-navy);
	color: #FFFFFF;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	align-items: center;
	text-align: center;
	padding: 56px 56px 40px;
}

.login-brand__main {
	flex-grow: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 40px;
}

.login-brand__logo {
	max-width: 200px;
	max-height: 160px;
}

.login-brand__text {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	max-width: 380px;
}

.login-brand__title {
	margin: 0;
	font-size: 34px;
	font-weight: 600;
	line-height: 1.2;
}

.login-brand__subtitle {
	margin: 0;
	font-size: 16px;
	line-height: 1.6;
	color: #C9D6E5;
}

.login-brand__powered {
	margin: 32px 0 0;
	font-size: 13px;
	color: #C9D6E5;
}

.login-brand__powered strong {
	color: #FFFFFF;
	font-weight: 600;
}

/* Zone formulaire (droite) */
.login-panel {
	flex: 999 1 560px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 40px 24px 28px;
}

.login-panel__center {
	flex-grow: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

.login-form {
	width: 100%;
	max-width: 400px;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.login-form__head {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.login-form__title {
	margin: 0;
	font-size: 30px;
	font-weight: 700;
}

.login-form__intro {
	margin: 0;
	font-size: 15px;
	color: #4A5568;
}

/* Messages d'erreur : bloc dédié (paramètre message) et p:messages */
.login-error, .login-form .ui-messages > div {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	margin: 0;
	padding: 12px 14px;
	border: 0;
	border-radius: 8px;
	font-size: 14px;
	line-height: 1.5;
}

.login-error, .login-form .ui-messages-error, .login-form .ui-messages-fatal {
	background: #FDECEA;
	color: #8A1C12;
}

.login-form .ui-messages-warn {
	background: #FFF4E0;
	color: #7A4B00;
}

.login-form .ui-messages-info {
	background: #E8F1FB;
	color: #0B2E4F;
}

.login-error svg {
	flex-shrink: 0;
	margin-top: 2px;
}

.login-form .ui-messages {
	margin: 0;
	padding: 0;
}

.login-form .ui-messages:empty {
	display: none;
}

.login-form .ui-messages > div::before {
	content: "";
	flex: 0 0 18px;
	height: 18px;
	margin-top: 2px;
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
}

.login-form .ui-messages-error::before, .login-form .ui-messages-fatal::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238A1C12' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4'/%3E%3Cpath d='M12 16h.01'/%3E%3C/svg%3E");
}

.login-form .ui-messages-warn::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%237A4B00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4'/%3E%3Cpath d='M12 16h.01'/%3E%3C/svg%3E");
}

.login-form .ui-messages-info::before {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%230B2E4F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
}

.login-form .ui-messages > div > span[class$="-icon"] {
	display: none;
}

.login-form .ui-messages ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.login-form .ui-messages [class$="-summary"] {
	font-weight: 600;
	margin-right: 4px;
}

.login-form .ui-messages [class$="-detail"] {
	font-weight: 400;
}

/* Champs */
.field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.field__label {
	font-size: 14px;
	font-weight: 600;
	color: #263445;
}

.field__box {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 48px;
	padding: 0 14px;
	border: 1px solid #C3CCD8;
	border-radius: 8px;
	background: #FFFFFF;
}

.field__box:focus-within {
	border-color: var(--tenant-accent);
	box-shadow: 0 0 0 3px rgba(31, 92, 158, 0.2);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--tenant-accent) 20%, transparent);
}

.field__box--with-action {
	padding-right: 4px;
}

.field__box > svg {
	flex-shrink: 0;
}

/* Surcharge du thème PrimeFaces sur les champs de saisie */
body .login-page .field__box input.field__input, body .login-page .field__box input.field__input.ui-state-hover,
	body .login-page .field__box input.field__input.ui-state-focus, body .login-page .field__box input.field__input:focus
	{
	flex-grow: 1;
	width: auto;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0 !important;
	outline: none !important;
	box-shadow: none !important;
	background: transparent !important;
	font-family: inherit;
	font-size: 15px;
	font-style: normal;
	color: #14202E !important;
	text-shadow: none;
}

.field__toggle {
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: #5B6778;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.field__toggle:hover {
	background: #EEF2F6;
}

.field__toggle[aria-pressed="true"] .icon-show, .field__toggle[aria-pressed="false"] .icon-hide
	{
	display: none;
}

/* Mot de passe oublié */
.login-form__forgot {
	display: flex;
	justify-content: center;
}

.login-form__forgot a {
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	min-height: 44px;
	display: flex;
	align-items: center;
}

/* Bouton de connexion */
body .login-page button.login-form__submit, body .login-page button.login-form__submit.ui-state-focus,
	body .login-page button.login-form__submit.ui-state-active {
	width: 100%;
	height: 50px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: var(--tenant-accent);
	box-shadow: none;
	text-shadow: none;
	color: #FFFFFF;
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	font-style: normal;
	cursor: pointer;
}

body .login-page button.login-form__submit:hover, body .login-page button.login-form__submit.ui-state-hover
	{
	background: var(--tenant-accent-hover);
}

body .login-page button.login-form__submit .ui-button-text {
	padding: 0;
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
}

/* Pied de page */
.login-footer {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
	justify-content: center;
	font-size: 12px;
	color: #5B6778;
	padding-top: 24px;
}

.login-page .login-footer a {
	color: inherit;
	font-family: inherit;
}

.login-page .login-footer a:hover {
	text-decoration: underline;
}
