/*
 * Connect – the login page (wp-login.php: log in, lost password, reset password).
 * Matches the refresh: Inter, neutral background with a soft glow in the brand colour, rounded card, large fields.
 * Follows the device's light/dark setting (nobody's signed in yet, so there's no saved choice to use).
 * The logo comes in as --login-logo / --login-logo-dark from functions.php.
 */

:root {
	--l-bg: #F4F4F2;
	--l-card: #FFFFFF;
	--l-text: #141414;
	--l-muted: #5C5C5C;
	--l-line: #E2E0DB;
	--l-field: #FFFFFF;
	--l-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 16px 40px rgba(0, 0, 0, .07);
	--l-main: var(--connect-main, #FFC100);
}
@media (prefers-color-scheme: dark) {
	:root {
		--l-bg: #111214;
		--l-card: #1B1C1F;
		--l-text: #F1F1F1;
		--l-muted: #A3A3A3;
		--l-line: #2F3135;
		--l-field: #141518;
		--l-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px rgba(0, 0, 0, .35);
	}
}

html, body.login {background: var(--l-bg) !important;}
body.login {
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 32px 0 calc(32px + env(safe-area-inset-bottom));
	box-sizing: border-box;
	position: relative;
	overflow-x: hidden;
	font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 15px;
	color: var(--l-text);
	-webkit-font-smoothing: antialiased;
}
/* The brand colour, as a soft glow behind the card */
body.login::before {
	content: "";
	position: fixed;
	left: 50%;
	top: 50%;
	width: 900px;
	height: 900px;
	transform: translate(-50%, -38%);
	border-radius: 50%;
	background: radial-gradient(closest-side, var(--l-main), transparent);
	opacity: .32;
	pointer-events: none;
	z-index: 0;
}
@media (prefers-color-scheme: dark) {
	body.login::before {opacity: .16;}
}

.login #login {
	position: relative;
	z-index: 1;
	width: 400px;
	max-width: calc(100% - 32px);
	margin: 0 auto;
	padding: 0;
	background: none;
}

/* Logo */
.login h1 {margin: 0 0 24px;}
.login h1 a, .login #login h1 a {
	width: 168px;
	height: 64px;
	margin: 0 auto;
	background-image: var(--login-logo) !important;
	background-size: contain !important;
	background-position: center !important;
	background-repeat: no-repeat !important;
}
@media (prefers-color-scheme: dark) {
	.login h1 a, .login #login h1 a {background-image: var(--login-logo-dark, var(--login-logo)) !important;}
	.login.connect-logo-invert h1 a {filter: invert(1) hue-rotate(180deg);}
}

/* "Sign in to <brand name>" intro */
.login .connect-login-intro {margin: 0 0 20px; text-align: center;}
.login .connect-login-intro h2 {margin: 0 0 6px; font-size: 24px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; color: var(--l-text);}
.login .connect-login-intro p {margin: 0; font-size: 15px; color: var(--l-muted);}

/* The card */
.login form, .login #loginform, .login #lostpasswordform, .login #resetpassform {
	margin: 0;
	padding: 28px;
	border: 1px solid var(--l-line) !important;
	border-radius: 20px;
	background: var(--l-card);
	box-shadow: var(--l-shadow);
	overflow: visible;
}
.login form p {margin: 0;}
.login label {display: block; margin: 0 0 6px; font-size: 14px; font-weight: 600; line-height: 1.4; color: var(--l-text);}
.login form .input, .login input[type="text"], .login input[type="password"], .login input[type="email"] {
	width: 100%;
	height: 48px;
	min-height: 48px;
	margin: 0 0 18px;
	padding: 0 14px;
	border: 1px solid var(--l-line);
	border-radius: 12px;
	background: var(--l-field);
	box-shadow: none;
	font-family: inherit;
	font-size: 16px; /* 16px stops iPhone zooming in on the field */
	line-height: 46px;
	color: var(--l-text);
	transition: border-color .15s ease, box-shadow .15s ease;
}
.login form .input:focus, .login input[type="text"]:focus, .login input[type="password"]:focus, .login input[type="email"]:focus {
	border-color: var(--l-text);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--l-main) 50%, transparent);
	outline: none;
}
/* Show / hide password */
.login .wp-pwd {position: relative;}
.login .wp-pwd input[type="password"], .login .wp-pwd input[type="text"] {padding-right: 52px;}
.login .button.wp-hide-pw {
	top: 0;
	right: 0;
	width: 48px;
	height: 48px;
	min-height: 48px;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: var(--l-muted);
	box-shadow: none;
}
.login .button.wp-hide-pw:hover, .login .button.wp-hide-pw:focus {color: var(--l-text); background: transparent; box-shadow: none; outline: none;}
.login .button.wp-hide-pw:focus-visible {box-shadow: 0 0 0 2px var(--l-text);}
.login .button.wp-hide-pw .dashicons {top: 0; width: 20px; height: 20px; font-size: 20px;}

/* Keep me signed in */
.login form .forgetmenot, .login #loginform .forgetmenot {float: none; display: flex; align-items: center; gap: 10px; margin: 0 0 22px;} /* #loginform beats WP core's ".login form .forgetmenot {margin-bottom: 0}" */
.login .forgetmenot label {display: inline-flex; align-items: center; gap: 10px; margin: 0; font-weight: 500; cursor: pointer;}
.login input[type="checkbox"] {
	width: 20px;
	height: 20px;
	min-width: 20px;
	margin: 0;
	border: 1px solid var(--l-line);
	border-radius: 6px;
	background: var(--l-field);
	box-shadow: none;
}
.login input[type="checkbox"]:focus {border-color: var(--l-text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--l-main) 50%, transparent); outline: none;}
.login input[type="checkbox"]:checked {background: var(--l-main); border-color: var(--l-main);}
.login input[type="checkbox"]:checked::before {
	content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M14.83 4.89l1.34.94-5.81 8.38H9.02L5.78 9.67l1.34-1.25 2.57 2.4z' fill='%23141414'/%3E%3C/svg%3E");
	width: 20px;
	height: 20px;
	margin: -1px 0 0 -1px;
}

/* Button */
.login .submit, .login form p.submit, .login #login form p.submit {float: none; width: 100%; margin: 0; padding: 0; text-align: center;}
.login .button-primary, .login #login form p.submit input, .login #wp-submit {
	float: none;
	width: 100%;
	height: 48px;
	min-height: 48px;
	margin: 0;
	padding: 0 20px;
	border: 0;
	border-radius: 12px;
	background: var(--l-main);
	box-shadow: none;
	text-shadow: none;
	text-transform: none;
	font-family: inherit;
	font-size: 16px;
	font-weight: 600;
	line-height: 48px;
	color: #141414;
	cursor: pointer;
	transition: filter .15s ease;
}
.login .button-primary:hover, .login #wp-submit:hover {background: var(--l-main); color: #141414; filter: brightness(.95);}
.login .button-primary:focus, .login #wp-submit:focus {background: var(--l-main); color: #141414; box-shadow: 0 0 0 3px var(--l-card), 0 0 0 5px var(--l-text); outline: none;}
.login .button-primary:active, .login #wp-submit:active {filter: brightness(.9);}

/* Signing in: a spinner drawn inside the button, left of "Signing in…" (set by the script in functions.php) */
.login.is-signing-in #wp-submit,
.login.is-signing-in #wp-submit:hover,
.login.is-signing-in #wp-submit:focus {
	pointer-events: none;
	padding-left: 30px !important;
	background: var(--l-main) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Ccircle cx='10' cy='10' r='8' fill='none' stroke='%23141414' stroke-opacity='.22' stroke-width='2.2'/%3E%3Cpath d='M10 2a8 8 0 0 1 8 8' fill='none' stroke='%23141414' stroke-width='2.2' stroke-linecap='round'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 10 10' to='360 10 10' dur='.7s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E") no-repeat calc(50% - 70px) center / 18px 18px !important;
}

/* On arrival: logo, heading and card rise in, one after another */
@media (prefers-reduced-motion: no-preference) {
	.login h1, .login .connect-login-intro, .login #login_error, .login .message, .login form, .login #nav {animation: connect-rise .6s cubic-bezier(.2, .7, .2, 1) both;}
	.login .connect-login-intro {animation-delay: .06s;}
	.login #login_error, .login .message {animation-delay: .1s;}
	.login form {animation-delay: .12s;}
	.login #nav {animation-delay: .2s;}
	/* The form holds Cerber's reCAPTCHA badge (position: fixed). A transform animation – even a finished one that
	   is still filling – pins the badge to the form instead of the screen corner, so the form rises with top. */
	.login form {position: relative; animation-name: connect-rise-top; animation-fill-mode: backwards;}
}
@keyframes connect-rise {from {opacity: 0; transform: translateY(14px);}}
@keyframes connect-rise-top {from {opacity: 0; top: 14px;}}

/* WP Cerber's invisible reCAPTCHA: Cerber scales .g-recaptcha, and any transform on a parent pins Google's
   fixed-position badge to the form (it ended up over the Log in button). Undo it so the badge sits in the
   bottom-right corner of the screen as normal. The form must not get a transform either, so no shrink on sign-in. */
.login .g-recaptcha[data-size="invisible"] {transform: none !important; margin: 0 !important;}
/* …and the badge itself is hidden: Google allows that when the page says it's protected (the note below the
   card, added in functions.php). visibility, not display: none, so reCAPTCHA keeps working. */
.grecaptcha-badge {visibility: hidden !important;}
.login .connect-recaptcha-note {position: relative; z-index: 1; width: 460px; max-width: calc(100% - 32px); margin: 18px auto 0; text-align: center; font-size: 12.5px; line-height: 1.5; color: var(--l-muted);}
.login .connect-recaptcha-note a {color: inherit; text-decoration: underline;}
.login .connect-recaptcha-note a:hover {color: var(--l-text);}

/* Links under the card */
.login #nav, .login #backtoblog {margin: 20px 0 0; padding: 0; text-align: center; font-size: 14px;}
.login #nav a, .login #backtoblog a {color: var(--l-muted); text-decoration: none;}
.login #nav a:hover, .login #backtoblog a:hover {color: var(--l-text); text-decoration: underline;}
.login #backtoblog {display: none;} /* the site is private – there's nowhere to go back to */
.login .privacy-policy-page-link {position: relative; z-index: 1; margin: 16px 0 0;}
.login .privacy-policy-page-link a {color: var(--l-muted);}

/* Messages ("Check your email…", wrong password) */
.login .message, .login .notice, .login .success, .login #login_error {
	margin: 0 0 16px;
	padding: 12px 16px;
	border: 1px solid var(--l-line);
	border-left: 4px solid var(--connect-second, #04A0E2);
	border-radius: 14px;
	background: var(--l-card);
	box-shadow: none;
	font-size: 14px;
	line-height: 1.5;
	color: var(--l-text);
}
.login #login_error, .login .notice-error {border-left-color: #D12C2C;}
.login .message a, .login #login_error a, .login .notice a {color: var(--l-text);}
.login #login_error strong {font-weight: 600;}

/* Reset password: strength meter and hint */
.login #pass-strength-result {margin: -10px 0 16px; border-radius: 10px; font-size: 13px;}
.login .description.indicator-hint {margin: 0 0 18px; font-size: 13px; color: var(--l-muted);}
.login .reset-pass-submit {display: flex; gap: 10px; flex-wrap: wrap;}
.login .reset-pass-submit .button {flex: 1 1 auto; height: 48px; border-radius: 12px; float: none;}
.login .reset-pass-submit .button:not(.button-primary) {border: 1px solid var(--l-line); background: transparent; color: var(--l-text);}

/* Phones: card nearer the top, a little less padding */
@media (max-width: 480px) {
	body.login {justify-content: flex-start; padding-top: calc(48px + env(safe-area-inset-top));}
	.login #login {width: auto; max-width: none; margin: 0 20px;}
	.login form, .login #loginform, .login #lostpasswordform, .login #resetpassform {padding: 24px 20px;}
	.login .connect-login-intro h2 {font-size: 22px;}
}

/* Hide the language switcher (also turned off in functions.php) */
.login .language-switcher {display: none;}

/* Signing in: the loading screen (the dashboard shows the same one until it's ready – css/refresh.css) */
.connect-loader {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 28px;
	overflow: hidden;
	background: var(--l-bg);
	opacity: 0;
	transition: opacity .3s ease;
}
.connect-loader.is-on {opacity: 1;}
.connect-loader::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	width: 900px;
	height: 900px;
	transform: translate(-50%, -38%);
	border-radius: 50%;
	background: radial-gradient(closest-side, var(--l-main), transparent);
	opacity: .3;
	pointer-events: none;
}
.connect-loader-logo {position: relative; width: 168px; height: 64px; background: var(--login-logo) center / contain no-repeat; animation: connect-breathe 1.4s ease-in-out infinite alternate;}
@media (prefers-color-scheme: dark) {
	.connect-loader-logo {background-image: var(--login-logo-dark, var(--login-logo));}
	.connect-logo-invert .connect-loader-logo {filter: invert(1) hue-rotate(180deg);}
}
.connect-loader-bar {position: relative; width: 140px; height: 4px; border-radius: 4px; overflow: hidden; background: rgba(128, 128, 128, .22);}
.connect-loader-bar::after {content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; border-radius: 4px; background: var(--l-main); animation: connect-load 1.1s cubic-bezier(.45, 0, .35, 1) infinite;}
@keyframes connect-breathe {from {transform: scale(1);} to {transform: scale(1.04);}}
@keyframes connect-load {from {left: -40%;} to {left: 100%;}}
@media (prefers-reduced-motion: reduce) {
	.connect-loader-logo, .connect-loader-bar::after {animation: none;}
	.connect-loader-bar::after {left: 0; width: 100%; opacity: .6;}
}
