/* StitchCore — wp-login.php skin
 * Matches the dashboard's plum palette and Poppins typography.
 * Background image is injected via wp_add_inline_style() from functions.php.
 */

:root {
	--sc-plum: #2b124c;
	--sc-plum-dark: #1a0a2e;
	--sc-card-bg: rgba(35, 28, 50, 0.72);
	--sc-card-border: rgba(255, 255, 255, 0.08);
	--sc-text: #ffffff;
	--sc-text-muted: rgba(255, 255, 255, 0.65);
	--sc-input-bg: #ffffff;
	--sc-input-text: #1a0a2e;
	--sc-radius: 14px;
}

/* ---------- Page ---------- */
html, body.login {
	margin: 0;
	width: 100%;
	max-width: 100%;
	overflow-x: hidden;
	font-family: 'Poppins', system-ui, -apple-system, sans-serif;
	-webkit-text-size-adjust: 100%;
}

body.login {
	background-color: #0e0a18;
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	/* background-attachment: fixed is broken on iOS — use scroll for reliable rendering */
	background-attachment: scroll;
	color: var(--sc-text);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	min-height: 100dvh;
	padding: 1rem;
	gap: 2.5rem;
	box-sizing: border-box;
}

*, *::before, *::after { box-sizing: border-box; }

/* Soft vignette over the bg to keep card readable */
body.login::before {
	content: "";
	position: fixed;
	inset: 0;
	background: linear-gradient(120deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.25) 45%, rgba(43,18,76,0.35) 100%);
	pointer-events: none;
	z-index: 0;
}

/* ---------- Layout wrapper WP gives us ---------- */
#login {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 420px;
	padding: 0;
	margin: 0 auto;
}

/* ---------- Default WP logo: hide (we render our own) ---------- */
#login h1, .login h1 { display: none; }

/* ---------- Our brand block — sibling of #login, stacked above via column flex ---------- */
.sc-login-brand {
	position: relative;
	z-index: 1;
	display: flex;
	justify-content: center;
	margin: 0;
}
.sc-login-brand img {
	max-width: 220px;
	max-height: 64px;
	width: auto;
	height: auto;
	filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

/* ---------- Card (wraps form + nav so everything sits inside it) ---------- */
.login #loginform,
.login #login form {
	background: transparent;
	border: none;
	box-shadow: none;
	padding: 0;
	margin: 0;
	overflow: visible;
}
/* Frosted card around form AND nav links */
.login #login {
	background: var(--sc-card-bg);
	backdrop-filter: blur(14px) saturate(140%);
	-webkit-backdrop-filter: blur(14px) saturate(140%);
	border: 1px solid var(--sc-card-border);
	border-radius: var(--sc-radius);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
	padding: 1.75rem;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}
.login #login > * { margin: 0; }

/* Form itself is a flex column too — fields, remember, submit evenly spaced */
.login #loginform {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}
.login #loginform > * { margin: 0; }

/* ---------- Labels ---------- */
.login label {
	color: var(--sc-text);
	font-size: 0.85rem;
	font-weight: 500;
	margin-bottom: 0.35rem;
	display: block;
}

/* ---------- Inputs ---------- */
.login input[type="text"],
.login input[type="email"],
.login input[type="password"],
.login .input {
	width: 100%;
	background: var(--sc-input-bg);
	color: var(--sc-input-text);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 10px;
	padding: 0.75rem 0.9rem;
	font-size: 0.95rem;
	font-family: inherit;
	box-shadow: none;
	transition: border-color 0.15s, box-shadow 0.15s;
	box-sizing: border-box;
}

.login input[type="text"]:focus,
.login input[type="email"]:focus,
.login input[type="password"]:focus,
.login .input:focus {
	border-color: var(--sc-plum);
	outline: none;
	box-shadow: 0 0 0 3px rgba(43, 18, 76, 0.35);
}

/* Password show/hide eye button (WP native) */
.login .wp-pwd { position: relative; }
.login .wp-pwd .button.wp-hide-pw {
	position: absolute;
	right: 6px;
	top: 50%;
	transform: translateY(-50%);
	background: transparent;
	border: none;
	box-shadow: none;
	color: var(--sc-plum);
	padding: 6px 8px;
	min-height: auto;
	height: auto;
}
.login .wp-pwd .button.wp-hide-pw:hover,
.login .wp-pwd .button.wp-hide-pw:focus {
	background: rgba(43, 18, 76, 0.08);
	color: var(--sc-plum-dark);
	box-shadow: none;
	outline: none;
}
.login .wp-pwd .dashicons { width: 20px; height: 20px; font-size: 20px; }

/* ---------- Remember me row ---------- */
.login .forgetmenot {
	color: var(--sc-text);
	font-size: 0.85rem;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}
.login .forgetmenot input[type="checkbox"] {
	width: 17px;
	height: 17px;
	margin: 0;
	accent-color: #ffffff;
	background-color: rgba(255, 255, 255, 0.15);
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 4px;
	cursor: pointer;
}
.login .forgetmenot input[type="checkbox"]:checked {
	accent-color: #ffffff;
}
.login .forgetmenot label {
	display: inline;
	margin: 0;
	color: var(--sc-text);
	cursor: pointer;
}

/* ---------- Submit ---------- */
.login .submit { margin: 0; }
.login .button-primary,
.login input[type="submit"] {
	width: 100%;
	background: var(--sc-plum);
	border: 1px solid var(--sc-plum);
	color: #fff;
	border-radius: 10px;
	padding: 0.75rem 1rem;
	font-size: 0.95rem;
	font-weight: 600;
	font-family: inherit;
	height: auto;
	line-height: 1.2;
	box-shadow: none;
	text-shadow: none;
	cursor: pointer;
	transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
}
.login .button-primary:hover,
.login input[type="submit"]:hover {
	background: var(--sc-plum-dark);
	border-color: var(--sc-plum-dark);
	transform: translateY(-1px);
	box-shadow: 0 6px 18px rgba(43, 18, 76, 0.4);
}
.login .button-primary:focus,
.login input[type="submit"]:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}
.login .button-primary:active,
.login input[type="submit"]:active {
	transform: translateY(0);
}

/* ---------- Footer links (inside the card) ---------- */
.login #nav {
	text-align: center;
	padding: 0;
	color: var(--sc-text);
	font-size: 0.85rem;
}
.login #nav a,
.login #nav a:link,
.login #nav a:visited,
.login #nav a:focus,
.login #nav a:active {
	color: #ffffff;
	text-decoration: none;
	transition: opacity 0.15s;
	outline: none;
	box-shadow: none;
}
.login #nav a:hover {
	color: rgba(255, 255, 255, 0.7);
	text-decoration: underline;
}

/* "← Go to site" link — not relevant for studio CRM */
.login #backtoblog { display: none !important; }

/* ---------- Error / success messages ---------- */
.login #login_error,
.login .message,
.login .notice {
	background: rgba(255, 255, 255, 0.95);
	border-left: 4px solid var(--sc-plum);
	border-radius: 8px;
	color: #1a0a2e;
	padding: 0.75rem 0.9rem;
	margin: 0 0 1rem;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
	font-size: 0.88rem;
}
.login #login_error { border-left-color: #c0392b; }

/* ---------- Language switcher (WP shows if multilingual) ---------- */
.login .language-switcher {
	margin-top: 1rem;
	text-align: center;
}
.login .language-switcher select {
	background: rgba(255, 255, 255, 0.9);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 8px;
	padding: 0.4rem 0.6rem;
	color: var(--sc-input-text);
}

/* ---------- Privacy policy link WP injects ---------- */
.login .privacy-policy-page-link {
	text-align: center;
	margin-top: 0.5rem;
	font-size: 0.8rem;
	color: var(--sc-text-muted);
}
.login .privacy-policy-page-link a {
	color: rgba(255, 255, 255, 0.75);
	text-decoration: none;
}
.login .privacy-policy-page-link a:hover { color: #fff; }

/* ---------- Tablet ---------- */
@media (max-width: 768px) {
	body.login {
		gap: 1.75rem;
		padding: 1rem;
		/* Shift subject of bg image into view on narrower screens */
		background-position: 30% center;
	}
	#login { max-width: 380px; }
	.login #login { padding: 1.4rem; gap: 1rem; }
	.login #loginform { gap: 0.85rem; }
	.sc-login-brand img { max-width: 180px; max-height: 52px; }
}

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
	body.login {
		gap: 1.25rem;
		padding: 0.75rem;
		background-position: 25% center;
	}
	#login { max-width: 100%; }
	.login #login { padding: 1.2rem; }
	.login label { font-size: 0.8rem; }
	.login input[type="text"],
	.login input[type="email"],
	.login input[type="password"] {
		padding: 0.7rem 0.8rem;
		font-size: 16px; /* prevents iOS auto-zoom on focus */
	}
	.login .button-primary,
	.login input[type="submit"] {
		padding: 0.7rem 1rem;
		font-size: 0.9rem;
	}
	.login .forgetmenot { font-size: 0.8rem; }
	.login #nav { font-size: 0.8rem; }
	.sc-login-brand img { max-width: 150px; max-height: 44px; }
}

/* ---------- Short viewports (landscape phones, small laptops) ---------- */
@media (max-height: 600px) {
	body.login {
		justify-content: flex-start;
		padding-top: 1.5rem;
		padding-bottom: 1.5rem;
		gap: 1.25rem;
	}
	.sc-login-brand img { max-height: 44px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	.login .button-primary,
	.login input[type="submit"] { transition: none; }
	.login .button-primary:hover,
	.login input[type="submit"]:hover { transform: none; }
}
