/* =============================================================================
 * wp-login.php — habillage Geely
 * Réf. Geely Auto Communication Guidelines (New Energy 2025), §5.2 et §5.3.
 *
 * Chargé par takoma_login_enqueue_scripts() AVANT les styles inline de
 * login.php : les variables déclarées ici sont donc disponibles pour ceux-ci.
 * Les réglages du BO (Wprime LMS > Réglages > Page login) restent prioritaires
 * puisqu'ils sortent en inline avec !important.
 * ========================================================================== */
@font-face {
	font-family: "GEELY Bold";
	src: url("../fonts/geely-bold.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

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

@font-face {
	font-family: "Inter";
	src: url("../fonts/inter-medium.woff2") format("woff2");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Inter";
	src: url("../fonts/inter-semibold.woff2") format("woff2");
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}

:root {
	--geely-blue: #3A7FF8;
	--geely-blue-dark: #1E5FD9;
	--geely-ink: #000000;
	--geely-neutral-1: #F7F4F5;
	--geely-neutral-2: #E8E7E7;
	--geely-grey-60: #828282;
	--geely-grey-80: #5A5A5A;
	--geely-font-display: "GEELY Bold", "Inter", sans-serif;
	--geely-font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	/* Doivent rester alignés sur custom.css : wp-login.php ne charge pas cette feuille. */
	--geely-rayon-cta: 4px;
	--geely-approche-libelle: 0.12em;
}

/* Dégradé de marque en fond. Une image de fond définie dans le BO le remplace
   (elle sort en inline avec !important). */
body.login {
	font-family: var(--geely-font-body);
	background-image: url("../images/brand/gradient-hero.webp");
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	/* Colonne centrée : sinon la carte reste collée en haut du dégradé. */
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 100dvh;
	overflow: hidden;
}

body.login #login {
	padding-top: 0;
}

/* Logo par défaut si aucun n'est configuré dans le BO.
   BuddyBoss pose height:auto sur le <a> et peut unwrap ce lien : le fond
   doit aussi vivre sur le H1 .wp-login-logo pour rester visible. */
body.login #login h1.wp-login-logo,
body.login.bb-login #login > h1.wp-login-logo {
	display: block;
	background-image: url("../images/brand/secondary-geely-logo-black.png");
	background-size: contain;
	background-position: center center;
	background-repeat: no-repeat;
	width: 160px;
	height: 80px;
	margin: 0 auto 22px;
	padding: 0;
}

body.login #login h1 a,
body.login.bb-login #login h1 a,
body.login.bb-login #login > h1 > a {
	display: block;
	background-image: none;
	width: 100%;
	height: 100% !important;
	margin: 0;
	text-indent: -9999px;
	overflow: hidden;
}

body.login #login h1.wp-login-logo:has(img),
body.login.bb-login #login > h1.wp-login-logo:has(img) {
	background-image: none;
	height: auto;
}

body.login #login h1 img.bs-cs-login-logo,
body.login #login h1 img.bs-cs-login-logo.private-on {
	visibility: visible !important;
	display: block !important;
	margin: 0 auto;
	text-indent: 0;
}

/* Carte de connexion : neutre, posée sur le dégradé. Le rayon rejoint celui des CTA —
   la charte n'emploie de grand rayon que pour la fenêtre du motif. */
.login.bb-login #login {
	border-radius: var(--geely-rayon-cta);
}

.login #login h1,
.login .login-heading {
	font-family: var(--geely-font-display);
	text-transform: uppercase;
	letter-spacing: 0.02em;
	color: var(--geely-ink);
}

.login.bb-login #loginform label {
	font-family: var(--geely-font-body);
	font-weight: 500;
	color: var(--geely-ink);
}

.login.bb-login #loginform .input,
.login.bb-login #loginform input[type="text"],
.login.bb-login #loginform input[type="password"] {
	font-family: var(--geely-font-body);
	border: 1px solid var(--geely-neutral-2);
	border-radius: var(--geely-rayon-cta);
	/* Retrait à gauche pour dégager l'icône (22px posée à left:10px). */
	padding: 12px 15px 12px 42px;
	background: #fff;
	color: var(--geely-ink);
	box-shadow: none;
}

.login.bb-login #loginform .input:focus,
.login.bb-login #loginform input[type="text"]:focus,
.login.bb-login #loginform input[type="password"]:focus {
	border-color: var(--geely-blue);
	outline: 2px solid rgba(58, 127, 248, 0.25);
	outline-offset: 0;
	box-shadow: none;
}

/* La couleur du bouton vient du BO en inline !important : on assombrit au
   survol par filtre, ce qui reste correct quelle que soit la couleur choisie. */
.login .button-primary,
.login form .submit input,
#loginform input[type="submit"] {
	font-family: var(--geely-font-body);
	font-weight: 600;
	border-radius: var(--geely-rayon-cta);
	padding: 10px 18px;
	text-transform: uppercase;
	letter-spacing: var(--geely-approche-libelle);
	transition: filter 0.15s ease;
}

.login .button-primary:hover,
.login form .submit input:hover,
#loginform input[type="submit"]:hover {
	filter: brightness(0.9);
}

.login #nav a,
.login #backtoblog a {
	font-family: var(--geely-font-body);
	color: var(--geely-blue);
}

.login form#loginform label[for="user_login"]:before {
	font-size: 22px !important;
	top: 14px !important;
	margin-left: 0;
}

.user-pass-wrap .wp-pwd:before {
	font-size: 22px !important;
	top: 12px !important;
	margin-left: 0;
}

.login .user-pass-wrap .wp-pwd .dashicons {
	font-size: 22px !important;
}

/* Notice RGPD : légal Inter, plus large et plus clair que la carte de connexion. */
body.login .footer-wrapper {
	width: 100%;
	max-width: min(72ch, 92vw);
}

body.login .footer-wrapper .copyRight {
	padding: 0;
	text-align: left;
}

body.login #takoma-login-legal.takoma-login-legal {
	padding: 12px 16px;
	background: rgb(255 255 255 / 0.42);
	border-radius: var(--geely-rayon-cta);
	font-family: var(--geely-font-body);
	font-size: 11px;
	font-weight: 400;
	line-height: 1.45;
	color: var(--geely-ink);
	text-align: left;
}

body.login #takoma-login-legal.takoma-login-legal p,
body.login .takoma-login-rgpd {
	margin: 0;
}

body.login #takoma-login-legal.takoma-login-legal a {
	color: var(--geely-blue);
	text-decoration: none;
	font-weight: 500;
}

body.login #takoma-login-legal.takoma-login-legal a:hover {
	text-decoration: underline;
}

/* Harmonisation charte Geely : login + lost-password. */
body.login.bb-login #login,
body.login.geely-lost-password #login {
	max-width: 480px !important;
	padding: 28px 30px 24px !important;
	border: 1px solid rgb(255 255 255 / 0.5);
	border-radius: 8px !important;
	background: rgb(255 255 255 / 0.94);
	margin: 0 auto !important;
}

body.login #login .login-heading {
	margin: 0 0 16px;
	font-family: var(--geely-font-display);
	font-size: 24px;
	font-weight: 700;
	line-height: 1.05;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--geely-ink);
}

body.login.bb-login #loginform label,
body.login.geely-lost-password .llms-lost-password-form label {
	font-family: var(--geely-font-body);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
	color: var(--geely-ink);
}

body.login.bb-login #loginform .input,
body.login.bb-login #loginform input[type="text"],
body.login.bb-login #loginform input[type="password"],
body.login.geely-lost-password .llms-lost-password-form input[type="text"],
body.login.geely-lost-password .llms-lost-password-form input[type="email"],
body.login.geely-lost-password .llms-lost-password-form input[type="password"] {
	font-size: 14px;
	font-weight: 500;
}

body.login .button-primary,
body.login form .submit input,
body.login.geely-lost-password .llms-lost-password-form .llms-button-action,
body.login.geely-lost-password .llms-lost-password-form input[type="submit"] {
	min-height: 42px;
	font-size: 12px;
}

body.login #nav,
body.login #backtoblog {
	margin-top: 10px;
}

/* Empilement compact pour éviter le scroll (login + lost-password). */
body.login #takoma-login-flex-parent.takoma-login-flex-parent {
	min-height: 100dvh;
	height: auto;
	justify-content: center;
	gap: 10px;
	padding: 10px 0;
}

body.login .footer-wrapper {
	margin: 0 auto;
}

body.login .footer-wrapper .copyRight {
	margin: 0;
}

@media screen and (max-height: 860px) {
	body.login {
		overflow: auto;
	}
}

/* Page /dashboard/lost-password/ : même carte et champs que wp-login.php. */
html.geely-lost-password-html,
html.geely-lost-password-html.wp-toolbar {
	margin-top: 0 !important;
	padding-top: 0 !important;
}

body.login.geely-lost-password {
	margin: 0 !important;
	padding: 0 !important;
	padding-top: 0 !important;
}

body.login.geely-lost-password .buddypanel,
body.login.geely-lost-password #masthead,
body.login.geely-lost-password .bb-mobile-header,
body.login.geely-lost-password #footer,
body.login.geely-lost-password .site-footer,
body.login.geely-lost-password #wpadminbar {
	display: none !important;
}

body.login.geely-lost-password .login-heading {
	margin: 0 0 18px;
	font-size: 1.15rem;
}

body.login.geely-lost-password .llms-notice {
	margin: 0 0 16px;
	padding: 10px 12px;
	border: 1px solid var(--geely-neutral-2);
	border-radius: var(--geely-rayon-cta);
	background: var(--geely-neutral-1);
	font-size: 14px;
	color: var(--geely-ink);
}

body.login.geely-lost-password .llms-lost-password-form .llms-form-field {
	margin: 0 0 16px;
}

body.login.geely-lost-password .llms-lost-password-form label {
	font-family: var(--geely-font-body);
	font-size: 14px;
	font-weight: 500;
	color: var(--geely-ink);
}

body.login.geely-lost-password .llms-lost-password-form input[type="text"],
body.login.geely-lost-password .llms-lost-password-form input[type="email"],
body.login.geely-lost-password .llms-lost-password-form input[type="password"] {
	width: 100%;
	margin: 2px 0 0;
	padding: 12px 15px;
	border: 1px solid var(--geely-neutral-2);
	border-radius: var(--geely-rayon-cta);
	background: #fff;
	font-family: var(--geely-font-body);
	color: var(--geely-ink);
	box-shadow: none;
}

body.login.geely-lost-password .llms-lost-password-form .llms-button-action,
body.login.geely-lost-password .llms-lost-password-form input[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	margin-top: 4px;
	padding: 10px 18px;
	border-radius: var(--geely-rayon-cta);
	font-family: var(--geely-font-body);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: var(--geely-approche-libelle);
	color: #fff !important;
}

body.login.geely-lost-password #nav {
	margin: 16px 0 0;
	padding: 0;
	text-align: left;
}
