/**
 * WooPlus Design System — wp-login.php skin
 * ============================================================================
 * Simple, centered single-card login. Renders on the four wp-login.php
 * screens (login, register, lostpassword, rp/resetpass) when the WooPlus
 * Auth module is disabled. When Auth is on, its own shortcode-driven
 * login handles the page and this skin is suppressed.
 *
 * Design philosophy
 * -----------------
 * The standard SaaS pattern: one centred card, logo on top, heading +
 * subline, form, primary button, footer links. No split shell, no hero
 * image, no decorative panels — those proved more trouble than they
 * were worth on a chrome the merchant only sees a few seconds per
 * session.
 *
 * Markup it styles (injected by maybe_inject_login_brand + WP core):
 *
 *   <body class="login wp-core-ui wooplus-login-skin wooplus-login-action-{action}">
 *     <div id="login">
 *       <h1><a>...</a></h1>                  ← hidden
 *       <div class="wpu-login-head">          ← our header
 *         <img/div class="wpu-login-logo">
 *         <p class="wpu-login-subtitle">…</p>  ← only on login action
 *       </div>
 *       <form id="loginform">…</form>
 *       <p id="nav">…</p>
 *       <p id="backtoblog">…</p>
 *       <div class="language-switcher">…</div>
 *     </div>
 *   </body>
 *
 * Brand colour
 * ------------
 * Submit button, focus rings, footer links and the default logo gradient
 * all read from --wooplus-brand-*. Those variables are pre-painted
 * server-side by print_inline_brand_color_for_login() on login_head
 * priority 5 (before this stylesheet loads), so the first paint already
 * uses the merchant's brand colour.
 */

/* ============================================================================
   PAGE
   ============================================================================ */
body.login.wooplus-login-skin {
	margin: 0;
	padding: 24px 16px;
	min-height: 100vh;
	background: var(--wooplus-bg, #F4F7FE);
	font-family: var(--wooplus-font-body, 'Vazirmatn', system-ui, sans-serif);
	color: var(--wooplus-text, #1B254B);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	display: grid;
	place-items: center;
}

body.login.wooplus-login-skin * {
	box-sizing: border-box;
}

body.login.wooplus-login-skin input,
body.login.wooplus-login-skin button,
body.login.wooplus-login-skin select,
body.login.wooplus-login-skin label,
body.login.wooplus-login-skin a {
	font-family: inherit;
}

/* ============================================================================
   THE CARD
   ============================================================================ */
body.login.wooplus-login-skin #login {
	width: 100%;
	max-width: 440px;
	padding: 36px 32px 32px;
	margin: 0;
	background: var(--wooplus-surface, #FFFFFF);
	border-radius: 16px;
	box-shadow:
		0 20px 50px -20px rgba(11, 18, 38, .25),
		0 6px 16px -8px rgba(11, 18, 38, .12);
}

/* Hide WP's default H1 logo and the ::before pseudo-element that
   apply_login_icon() in class-wooplus-settings.php paints with the
   merchant's uploaded login_icon when the DS skin is OFF. When the DS
   skin is ON, apply_login_icon() short-circuits, but we keep this
   belt-and-suspenders rule so third-party login customisers can't
   sneak a duplicate logo in via #login::before either. */
body.login.wooplus-login-skin #login > h1,
body.login.wooplus-login-skin #login > h1 a,
body.login.wooplus-login-skin #login::before {
	display: none !important;
	content: none !important;
	width: 0 !important;
	height: 0 !important;
	margin: 0 !important;
	background: none !important;
}

/* ============================================================================
   HEADER — logo + site name
   ============================================================================ */
body.login.wooplus-login-skin .wpu-login-head {
	text-align: center;
	margin: 0 0 24px;
}

body.login.wooplus-login-skin .wpu-login-logo {
	display: block;
	width: 56px;
	height: 56px;
	margin: 0 auto 12px;
	border-radius: 12px;
	object-fit: contain;
	background: var(--wooplus-surface-2, #F4F7FE);
}

/* Default mark (no merchant logo uploaded) — branded gradient + initial */
body.login.wooplus-login-skin .wpu-login-logo--default {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg,
		var(--wooplus-brand-500, #157a41),
		var(--wooplus-brand-700, #2111A5));
	color: #FFFFFF;
	font-size: 24px;
	font-weight: 800;
	letter-spacing: -0.5px;
	box-shadow: 0 6px 16px rgba(66, 42, 251, .25);
}

body.login.wooplus-login-skin .wpu-login-subtitle {
	margin: 14px 0 0;
	padding: 0;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.55;
	color: var(--wooplus-text-mute, #707EAE);
	letter-spacing: -0.1px;
}

/* ============================================================================
   FORM
   ============================================================================ */
body.login.wooplus-login-skin #loginform,
body.login.wooplus-login-skin #lostpasswordform,
body.login.wooplus-login-skin #registerform,
body.login.wooplus-login-skin #resetpassform {
	margin: 0;
	padding: 0;
	background: transparent;
	box-shadow: none;
	border: 0;
}

body.login.wooplus-login-skin form > p {
	margin: 0 0 14px;
}

body.login.wooplus-login-skin form label {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 700;
	color: var(--wooplus-text, #1B254B);
	letter-spacing: -0.2px;
}

/* Inputs */
body.login.wooplus-login-skin input[type="text"],
body.login.wooplus-login-skin input[type="email"],
body.login.wooplus-login-skin input[type="password"] {
	display: block;
	width: 100%;
	height: 46px;
	padding: 0 14px;
	font-size: 14px;
	color: var(--wooplus-text, #1B254B);
	background: var(--wooplus-surface-2, #F4F7FE);
	border: 1px solid transparent;
	border-radius: 10px;
	box-shadow: none;
	transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
	font-family: inherit;
	letter-spacing: -0.2px;
}

body.login.wooplus-login-skin input::placeholder {
	color: var(--wooplus-text-mute, #707EAE);
	opacity: .55;
}

body.login.wooplus-login-skin input:hover:not(:focus) {
	background: var(--wooplus-surface, #FFFFFF);
	border-color: var(--wooplus-border-strong, #D5DCEB);
}

body.login.wooplus-login-skin input:focus {
	background: var(--wooplus-surface, #FFFFFF);
	border-color: var(--wooplus-brand-500, #157a41);
	box-shadow: 0 0 0 4px rgba(66, 42, 251, .12);
	outline: none;
}

/* Password eye toggle */
body.login.wooplus-login-skin .wp-pwd {
	position: relative;
}

body.login.wooplus-login-skin .wp-pwd .button.button-secondary,
body.login.wooplus-login-skin .wp-pwd .wp-hide-pw {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	inset-inline-end: 4px;
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	color: var(--wooplus-text-mute, #707EAE) !important;
	height: 38px;
	width: 38px;
	min-height: 38px;
	padding: 0 !important;
	margin: 0 !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
}

body.login.wooplus-login-skin .wp-pwd .wp-hide-pw:hover {
	background: var(--wooplus-surface-2, #F4F7FE) !important;
	color: var(--wooplus-brand-500, #157a41) !important;
}

body.login.wooplus-login-skin .wp-pwd .dashicons {
	font-size: 18px;
	line-height: 1;
	width: 18px;
	height: 18px;
}

body.login.wooplus-login-skin .wp-pwd input[type="text"],
body.login.wooplus-login-skin .wp-pwd input[type="password"] {
	padding-inline-end: 48px;
}

/* Custom checkbox */
body.login.wooplus-login-skin input[type="checkbox"] {
	appearance: none;
	-webkit-appearance: none;
	width: 16px;
	height: 16px;
	margin: 0;
	padding: 0;
	background: var(--wooplus-surface, #FFFFFF);
	border: 1.5px solid var(--wooplus-border-strong, #D5DCEB);
	border-radius: 4px;
	cursor: pointer;
	transition: border-color 150ms ease, background-color 150ms ease;
	flex-shrink: 0;
	position: relative;
}

body.login.wooplus-login-skin input[type="checkbox"]:hover {
	border-color: var(--wooplus-brand-500, #157a41);
}

body.login.wooplus-login-skin input[type="checkbox"]:checked {
	background: var(--wooplus-brand-500, #157a41);
	border-color: var(--wooplus-brand-500, #157a41);
}

body.login.wooplus-login-skin input[type="checkbox"]:checked::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 4px;
	height: 8px;
	border: solid #FFFFFF;
	border-width: 0 2px 2px 0;
	transform: translate(-50%, -60%) rotate(45deg);
}

body.login.wooplus-login-skin input[type="checkbox"]:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(66, 42, 251, .15);
}

/* Remember-me row */
body.login.wooplus-login-skin .forgetmenot {
	margin: 4px 0 18px;
	font-size: 13px;
}

body.login.wooplus-login-skin .forgetmenot label,
body.login.wooplus-login-skin label[for="rememberme"] {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-weight: 500;
	color: var(--wooplus-text-mute, #707EAE);
	cursor: pointer;
}

/* Submit button — brand gradient, full width */
body.login.wooplus-login-skin p.submit,
body.login.wooplus-login-skin .submit {
	margin: 0;
	float: none;
	clear: both;
}

body.login.wooplus-login-skin .button-primary,
body.login.wooplus-login-skin input[type="submit"].button-primary,
body.login.wooplus-login-skin .wp-core-ui .button-primary {
	display: block !important;
	width: 100% !important;
	height: 46px !important;
	min-height: 46px !important;
	padding: 0 !important;
	background: linear-gradient(135deg,
		var(--wooplus-brand-500, #157a41) 0%,
		var(--wooplus-brand-700, #2111A5) 100%) !important;
	color: #FFFFFF !important;
	border: 0 !important;
	border-radius: 10px !important;
	font-family: inherit !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	letter-spacing: -0.2px !important;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(66, 42, 251, .25) !important;
	transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
	text-shadow: none !important;
	float: none !important;
	text-align: center;
}

body.login.wooplus-login-skin .button-primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 22px rgba(66, 42, 251, .35) !important;
	filter: brightness(1.02);
}

body.login.wooplus-login-skin .button-primary:active {
	transform: translateY(0);
	box-shadow: 0 2px 8px rgba(66, 42, 251, .30) !important;
}

body.login.wooplus-login-skin .button-primary:focus-visible {
	outline: none;
	box-shadow:
		0 0 0 4px rgba(66, 42, 251, .25),
		0 4px 14px rgba(66, 42, 251, .25) !important;
}

body.login.wooplus-login-skin .button-primary:disabled,
body.login.wooplus-login-skin .button-primary[disabled] {
	opacity: .6;
	cursor: not-allowed;
	transform: none !important;
}

/* ============================================================================
   FOOTER LINKS
   ============================================================================ */
body.login.wooplus-login-skin #nav,
body.login.wooplus-login-skin #backtoblog {
	margin: 14px 0 0 !important;
	padding: 0;
	text-align: center;
	font-size: 13px;
	color: var(--wooplus-text-mute, #707EAE);
	line-height: 1.6;
}

body.login.wooplus-login-skin #nav {
	margin-top: 22px !important;
	padding-top: 18px;
	border-top: 1px solid var(--wooplus-divider, #F4F7FE);
}

body.login.wooplus-login-skin #nav a,
body.login.wooplus-login-skin #backtoblog a {
	color: var(--wooplus-brand-500, #157a41);
	font-weight: 600;
	text-decoration: none;
	margin: 0 4px;
	transition: color 150ms ease;
}

body.login.wooplus-login-skin #nav a:hover,
body.login.wooplus-login-skin #backtoblog a:hover {
	color: var(--wooplus-brand-700, #2111A5);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* ============================================================================
   NOTICES & ERRORS
   ============================================================================ */

/* Informational message (WP's `<p class="message">…</p>` inside #login).
   This is the friendly notice WP shows on the register screen, the
   lost-password screen, after a successful action, etc. Neutral blue
   styling — NOT an error colour. The selector intentionally targets
   `.message` directly inside #login (no phantom `.login` ancestor;
   the body has class `login` but no nested `.login` element exists). */
body.login.wooplus-login-skin #login .message,
body.login.wooplus-login-skin #login p.message {
	width: 100% !important;
	max-width: none !important;
	margin: 0 0 16px !important;
	padding: 10px 14px !important;
	background: rgba(61, 175, 229, .08) !important;
	border: 1px solid rgba(61, 175, 229, .25) !important;
	border-inline-start: 3px solid #3DAFE5 !important;
	border-radius: 10px !important;
	box-shadow: none !important;
	font-size: 13px !important;
	font-weight: 500;
	color: #1F6A99 !important;
	line-height: 1.6;
	text-align: start;
}

/* Error message (#login_error). Red styling. */
body.login.wooplus-login-skin #login_error {
	width: 100% !important;
	max-width: none !important;
	margin: 0 0 16px !important;
	padding: 10px 14px !important;
	background: rgba(238, 93, 80, .08) !important;
	border: 1px solid rgba(238, 93, 80, .25) !important;
	border-inline-start: 3px solid #EE5D50 !important;
	border-radius: 10px !important;
	box-shadow: none !important;
	font-size: 13px !important;
	font-weight: 500;
	color: #B33C32 !important;
	line-height: 1.6;
	text-align: start;
}

/* Success notice (e.g. "Check your email" after lost-password). */
body.login.wooplus-login-skin #login .notice-success,
body.login.wooplus-login-skin #login .updated {
	background: rgba(5, 205, 153, .08) !important;
	border-color: rgba(5, 205, 153, .25) !important;
	border-inline-start-color: #05CD99 !important;
	color: #018660 !important;
}

body.login.wooplus-login-skin #login_error a,
body.login.wooplus-login-skin #login .message a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
	font-weight: 600;
}

/* Password strength meter (reset-password) */
body.login.wooplus-login-skin #pass-strength-result {
	width: 100% !important;
	margin: -6px 0 14px !important;
	padding: 8px 12px !important;
	border-radius: 8px !important;
	font-size: 12px !important;
	font-weight: 600;
	background: var(--wooplus-surface-2, #F4F7FE) !important;
	border: 1px solid var(--wooplus-border-strong, #D5DCEB) !important;
	color: var(--wooplus-text-2, #2B3674) !important;
}

body.login.wooplus-login-skin #pass-strength-result.strong   { background: rgba(5, 205, 153, .10) !important; border-color: #05CD99 !important; color: #01B574 !important; }
body.login.wooplus-login-skin #pass-strength-result.good     { background: rgba(106, 210, 255, .12) !important; border-color: #6AD2FF !important; color: #3DAFE5 !important; }
body.login.wooplus-login-skin #pass-strength-result.bad      { background: rgba(255, 206, 32, .12) !important; border-color: #FFCE20 !important; color: #E1A60B !important; }
body.login.wooplus-login-skin #pass-strength-result.short    { background: rgba(238, 93, 80, .10) !important; border-color: #EE5D50 !important; color: #D64940 !important; }

/* ============================================================================
   LANGUAGE SWITCHER (multi-locale installs)
   ============================================================================ */
body.login.wooplus-login-skin .language-switcher {
	margin: 18px 0 0 !important;
	padding: 14px 0 0;
	border-top: 1px solid var(--wooplus-divider, #F4F7FE);
	text-align: center;
}

body.login.wooplus-login-skin .language-switcher form {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	justify-content: center;
	margin: 0;
	padding: 0;
	background: transparent;
	box-shadow: none;
	border: 0;
}

body.login.wooplus-login-skin .language-switcher label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	font-size: 13px;
	font-weight: 500;
	color: var(--wooplus-text-mute, #707EAE);
}

body.login.wooplus-login-skin .language-switcher select {
	height: 34px;
	padding: 0 10px;
	background: var(--wooplus-surface-2, #F4F7FE);
	border: 1px solid transparent;
	border-radius: 8px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	color: var(--wooplus-text, #1B254B);
	cursor: pointer;
	transition: border-color 150ms ease, background-color 150ms ease;
}

body.login.wooplus-login-skin .language-switcher select:hover,
body.login.wooplus-login-skin .language-switcher select:focus {
	background: var(--wooplus-surface, #FFFFFF);
	border-color: var(--wooplus-brand-500, #157a41);
	outline: none;
}

body.login.wooplus-login-skin .language-switcher .button {
	height: 34px;
	padding: 0 12px;
	background: var(--wooplus-surface, #FFFFFF);
	border: 1px solid var(--wooplus-border-strong, #D5DCEB);
	border-radius: 8px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	color: var(--wooplus-text, #1B254B);
	cursor: pointer;
	box-shadow: none;
	text-shadow: none;
	line-height: 32px;
	min-height: 34px;
	transition: border-color 150ms ease, color 150ms ease;
}

body.login.wooplus-login-skin .language-switcher .button:hover {
	border-color: var(--wooplus-brand-500, #157a41);
	color: var(--wooplus-brand-500, #157a41);
}

/* Privacy-policy link (WP 5.7+) */
body.login.wooplus-login-skin .privacy-policy-page-link {
	margin: 10px 0 0 !important;
	text-align: center;
	font-size: 12px;
	color: var(--wooplus-text-mute, #707EAE);
}

body.login.wooplus-login-skin .privacy-policy-page-link a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px dashed currentColor;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 480px) {
	body.login.wooplus-login-skin {
		padding: 12px 8px;
	}

	body.login.wooplus-login-skin #login {
		padding: 28px 20px 24px;
	}

	body.login.wooplus-login-skin .wpu-login-subtitle {
		font-size: 13px;
	}
}

/* ============================================================================
   DARK MODE
   ============================================================================ */
html[data-wooplus-theme="dark"] body.login.wooplus-login-skin {
	background: var(--wooplus-bg, #0B1437);
	color: var(--wooplus-text, #E2E8F4);
}

html[data-wooplus-theme="dark"] body.login.wooplus-login-skin #login {
	background: var(--wooplus-surface, #111C44);
	box-shadow:
		0 20px 50px -20px rgba(0, 0, 0, .6),
		0 6px 16px -8px rgba(0, 0, 0, .4);
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
	body.login.wooplus-login-skin .button-primary {
		transition: none;
	}

	body.login.wooplus-login-skin .button-primary:hover {
		transform: none;
	}
}

body.login.wooplus-login-skin :focus-visible {
	outline: 2px solid var(--wooplus-brand-500, #157a41);
	outline-offset: 2px;
}

body.login.wooplus-login-skin input:focus-visible,
body.login.wooplus-login-skin button:focus-visible,
body.login.wooplus-login-skin .button-primary:focus-visible {
	outline: none; /* dedicated focus styles already above */
}
