/**
 * Clean Kloths CRM - login screen.
 *
 * Loaded on wp-login.php only, by CK_Login::enqueue().
 *
 * NO CSS CUSTOM PROPERTIES. The --ck-* tokens are declared in admin.css, which
 * is not loaded on wp-login.php, so every colour is written out in full here.
 * Using var(--ck-primary) would silently fall back to nothing and the page would
 * render unstyled.
 *
 * COSMETIC ONLY. Nothing in this file hides a field, changes the form action or
 * interferes with the nonce. Hiding the Register and Lost-password links is
 * presentation: the URLs still work, which is deliberate, because disabling the
 * password reset entirely would leave the owner with no self-service way back
 * in if they forget their password.
 */

body.login {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	margin: 0;
	background: linear-gradient(135deg, #3C29A8 0%, #5140B2 100%);
	font-family: system-ui, -apple-system, sans-serif;
}

body.login #login {
	box-sizing: border-box;
	width: 380px;
	max-width: 90vw;
	padding: 40px;
	background: #ffffff;
	border-radius: 20px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

body.login h1 {
	margin-bottom: 24px;
	text-align: center;
}

/* WordPress puts the logo on the anchor's background, so the link stays the
   clickable element and keeps its accessible name. */
body.login h1 a {
	display: block;
	width: 100%;
	height: 80px;
	margin: 0 auto;
	background-color: transparent;
	background-image: url("../images/default-logo.svg");
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
}

body.login form {
	margin-top: 20px;
}

body.login label {
	display: block;
	margin-bottom: 6px;
	font-size: 15px;
	font-weight: 600;
	color: #1A1A2E;
}

body.login input[type="text"],
body.login input[type="password"] {
	box-sizing: border-box;
	width: 100%;
	min-height: 48px;
	margin-bottom: 12px;
	padding: 12px 16px;
	font-size: 16px;
	color: #1A1A2E;
	background: #ffffff;
	border: 1px solid #D1D5DB;
	border-radius: 8px;
	box-shadow: none;
}

body.login input[type="text"]:focus,
body.login input[type="password"]:focus {
	border-color: #3C29A8;
	box-shadow: 0 0 0 3px rgba(60, 41, 168, 0.1);
	outline: none;
}

body.login .button-primary {
	width: 100%;
	min-height: 48px;
	font-size: 16px;
	font-weight: 600;
	text-shadow: none;
	background: #3C29A8;
	border-color: #3C29A8;
	border-radius: 8px;
	box-shadow: none;
}

body.login .button-primary:hover,
body.login .button-primary:focus {
	background: #5140B2;
	border-color: #5140B2;
}

body.login #nav,
body.login #backtoblog {
	margin-top: 16px;
	font-size: 14px;
	text-align: center;
}

body.login #nav a,
body.login #backtoblog a {
	color: #6B7280;
	text-decoration: none;
}

body.login #nav a:hover,
body.login #backtoblog a:hover {
	color: #3C29A8;
}

/*
 * Presentation only: the links stay reachable by URL. If the shop ever needs the
 * password reset back, delete these two rules.
 */
body.login #nav a[href*="register"],
body.login #nav a[href*="lostpassword"] {
	display: none;
}

/* Failed-login and logged-out notices, sized to the card rather than WordPress's
   default 320px column. */
body.login #login_error,
body.login .message,
body.login .success {
	margin: 0 0 16px;
	padding: 12px 16px;
	font-size: 14px;
	background: #ffffff;
	border-left: 4px solid #DC3545;
	border-radius: 8px;
	box-shadow: none;
}

body.login .message {
	border-left-color: #3C29A8;
}

.ck-login-footer {
	margin-top: 24px;
	font-size: 13px;
	text-align: center;
	color: rgba(255, 255, 255, 0.75);
}

.ck-login-footer a {
	color: #ffffff;
	text-decoration: none;
}

/*
 * A 380px card with 40px of padding does not fit a 375px phone. The card takes
 * the viewport width, the padding halves and the logo shortens, which is what
 * keeps the submit button reachable one-handed.
 */
@media screen and (max-width: 480px) {
	body.login #login {
		width: 90vw;
		padding: 24px;
		border-radius: 16px;
	}

	body.login h1 a {
		height: 60px;
	}

	.ck-login-footer {
		margin-top: 16px;
	}
}
