/**
 * wp-login.php, restyled to match the match centre's dark theme.
 *
 * Colours follow the match centre blocks (keepup/source/blocks/match-*). The
 * site's logo and the Cavallo Text font faces are added inline by
 * APL\Core\Controller\LoginController.
 */

body.login {
	--apl-login-bg: #18191a;
	--apl-login-surface: #242424;
	--apl-login-border: #444;
	--apl-login-text: #fff;
	--apl-login-muted: #a7a8aa;
	--apl-login-accent: #d4f70e;
	--apl-login-error: #e40035;
	--apl-login-font: "Cavallo Text", Helvetica, Arial, sans-serif;

	display: flex;
	flex-direction: column;
	min-height: 100vh;
	background-color: var(--apl-login-bg);
	color: var(--apl-login-text);
	font-family: var(--apl-login-font);
	color-scheme: dark;
}

.login #login {
	width: 100%;
	max-width: 380px;
	box-sizing: border-box;
	margin: auto;
	padding: 6vh 16px 32px;
}

/* Logo */

.login h1 {
	margin-bottom: 32px;
}

.login h1 a {
	width: 100%;
	height: 96px;
	margin: 0 auto;
	background-position: center;
	background-size: contain;
	background-repeat: no-repeat;
}

.login h1 a:focus {
	outline: 2px solid var(--apl-login-text);
	outline-offset: 6px;
	border-radius: 0.5rem;
	box-shadow: none;
}

/* Form panel */

.login form {
	margin-top: 0;
	padding: 28px 24px;
	border: 1px solid var(--apl-login-border);
	border-radius: 0.75rem;
	background-color: var(--apl-login-surface);
	box-shadow: none;
}

.login label {
	color: var(--apl-login-muted);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.5;
	text-transform: uppercase;
}

.login form .input,
.login input[type="text"],
.login input[type="password"],
.login input[type="email"],
.login input[type="number"] {
	min-height: 48px;
	margin: 6px 0 20px;
	padding: 0 14px;
	border: 1px solid var(--apl-login-border);
	border-radius: 0.5rem;
	background-color: var(--apl-login-bg);
	color: var(--apl-login-text);
	font-family: var(--apl-login-font);
	font-size: 1rem;
	box-shadow: none;
}

.login form .input:focus,
.login input[type="text"]:focus,
.login input[type="password"]:focus,
.login input[type="email"]:focus,
.login input[type="number"]:focus {
	border-color: var(--apl-login-text);
	outline: none;
	box-shadow: 0 0 0 1px var(--apl-login-text);
}

.login input:-webkit-autofill {
	-webkit-text-fill-color: var(--apl-login-text);
	box-shadow: 0 0 0 1000px var(--apl-login-bg) inset;
	caret-color: var(--apl-login-text);
}

/* Show password toggle */

.login .wp-pwd {
	position: relative;
}

.login .button.wp-hide-pw {
	top: 6px;
	height: 48px;
	min-height: 48px;
	border: 0;
	background: transparent;
	color: var(--apl-login-muted);
	box-shadow: none;
}

.login .button.wp-hide-pw:hover,
.login .button.wp-hide-pw:focus {
	background: transparent;
	color: var(--apl-login-text);
}

.login .button.wp-hide-pw:focus {
	outline: 2px solid var(--apl-login-text);
	outline-offset: -4px;
	border-radius: 0.5rem;
	box-shadow: none;
}

/* Remember me */

.login .forgetmenot {
	display: flex;
	align-items: center;
	float: none;
	margin-bottom: 20px;
}

.login .forgetmenot label {
	color: var(--apl-login-text);
	font-size: 0.875rem;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
}

.login input[type="checkbox"] {
	width: 18px;
	height: 18px;
	border: 1px solid var(--apl-login-muted);
	border-radius: 4px;
	background-color: var(--apl-login-bg);
	box-shadow: none;
}

.login input[type="checkbox"]:checked {
	border-color: var(--apl-login-text);
	background-color: var(--apl-login-text);
}

.login input[type="checkbox"]:checked::before {
	/* Core draws the tick as a blue SVG; recolour it for the white box. */
	filter: brightness(0);
}

.login input[type="checkbox"]:focus {
	outline: 2px solid var(--apl-login-text);
	outline-offset: 2px;
	box-shadow: none;
}

/* Buttons: white pills, like the match centre's active tab. */

.login .submit {
	clear: both;
}

.login .button-primary,
.login .submit .button {
	float: none;
	width: 100%;
	min-height: 48px;
	padding: 0 24px;
	border: 1px solid var(--apl-login-text);
	border-radius: 999px;
	background: var(--apl-login-text);
	color: var(--apl-login-bg);
	font-family: var(--apl-login-font);
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 1;
	text-transform: uppercase;
	text-shadow: none;
	box-shadow: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.login .button-primary:hover,
.login .submit .button:hover {
	border-color: var(--apl-login-text);
	background: transparent;
	color: var(--apl-login-text);
}

.login .button-primary:focus,
.login .submit .button:focus {
	border-color: var(--apl-login-text);
	background: var(--apl-login-text);
	color: var(--apl-login-bg);
	outline: 2px solid var(--apl-login-text);
	outline-offset: 3px;
	box-shadow: none;
}

.login .button-secondary:not(.wp-hide-pw),
.login .button:not(.button-primary):not(.wp-hide-pw) {
	border: 1px solid var(--apl-login-muted);
	border-radius: 999px;
	background: transparent;
	color: var(--apl-login-text);
	font-family: var(--apl-login-font);
	box-shadow: none;
}

.login .button-secondary:not(.wp-hide-pw):hover,
.login .button:not(.button-primary):not(.wp-hide-pw):hover {
	border-color: var(--apl-login-text);
	background: var(--apl-login-text);
	color: var(--apl-login-bg);
}

/* Notices */

.login .message,
.login .notice,
.login .success,
.login #login_error {
	margin-bottom: 20px;
	padding: 14px 16px;
	border: 1px solid var(--apl-login-border);
	border-left: 4px solid var(--apl-login-accent);
	border-radius: 0.75rem;
	background-color: var(--apl-login-surface);
	color: var(--apl-login-text);
	box-shadow: none;
}

.login .notice-error,
.login #login_error {
	border-left-color: var(--apl-login-error);
}

.login .message a,
.login .notice a,
.login #login_error a {
	color: var(--apl-login-text);
}

/* Links below the form */

.login #nav,
.login #backtoblog,
.login .privacy-policy-page-link {
	padding: 0 24px;
	text-align: center;
}

.login #nav {
	margin-top: 24px;
}

.login #nav a,
.login #backtoblog a,
.login .privacy-policy-page-link a {
	color: var(--apl-login-muted);
	font-size: 0.875rem;
	text-decoration: none;
}

.login #nav a:hover,
.login #backtoblog a:hover,
.login .privacy-policy-page-link a:hover {
	color: var(--apl-login-text);
	text-decoration: underline;
}

.login #nav a:focus,
.login #backtoblog a:focus,
.login .privacy-policy-page-link a:focus {
	color: var(--apl-login-text);
	outline: 2px solid var(--apl-login-text);
	outline-offset: 2px;
	border-radius: 2px;
	box-shadow: none;
}

/* Language switcher */

.login .language-switcher {
	margin-bottom: 32px;
}

.login .language-switcher label .dashicons {
	color: var(--apl-login-muted);
}

.login .language-switcher select {
	border: 1px solid var(--apl-login-border);
	border-radius: 0.5rem;
	background-color: var(--apl-login-surface);
	color: var(--apl-login-text);
}

/* Two-factor screens */

.login .two-factor-email-resend input,
.login #two-factor-totp-authcode,
.login #authcode {
	letter-spacing: 0.2em;
}

.login .backup-methods-wrap a,
.login .two-factor-prompt {
	color: var(--apl-login-muted);
}

.login .backup-methods-wrap a:hover {
	color: var(--apl-login-text);
}
