/**
 * NWS Web Design - Custom Login Styles
 *
 * Premium dark-themed login page with glassmorphism card,
 * custom inputs, and animated particle canvas support.
 *
 * @package NWS_Web_Design_Custom_Login
 */

/* ==========================================================================
   1. CSS Custom Properties (Design Tokens)
   ========================================================================== */

:root {
	/* Background */
	--nws-bg-primary: #0a0e1a;
	--nws-bg-secondary: #141b2d;

	/* Card */
	--nws-card-bg: rgba(20, 27, 45, 0.72);
	--nws-card-border: rgba(255, 255, 255, 0.08);
	--nws-card-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
	--nws-card-radius: 20px;

	/* Inputs */
	--nws-input-bg: rgba(255, 255, 255, 0.06);
	--nws-input-border: rgba(255, 255, 255, 0.10);
	--nws-input-focus-border: rgba(37, 99, 235, 0.6);
	--nws-input-focus-glow: 0 0 0 3px rgba(37, 99, 235, 0.18);

	/* Button */
	--nws-btn-gradient: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
	--nws-btn-hover: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
	--nws-btn-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);

	/* Text */
	--nws-text-primary: #f8fafc;
	/* Brighter white */
	--nws-text-secondary: rgba(248, 250, 252, 0.75);
	/* Increased contrast */
	--nws-text-link: #60a5fa;
	--nws-text-link-hover: #93bbfd;

	/* Typography */
	--nws-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}


/* ==========================================================================
   2. Google Font Import (Inter)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');


/* ==========================================================================
   3. Base / Reset
   ========================================================================== */

*,
*::before,
*::after {
	box-sizing: border-box;
}

/* ==========================================================================
   4. Body (Login Page)
   ========================================================================== */

body.login {
	background: linear-gradient(160deg, var(--nws-bg-primary) 0%, var(--nws-bg-secondary) 100%) !important;
	background-attachment: fixed !important;
	font-family: var(--nws-font-family) !important;
	min-height: 100vh;
	min-height: 100dvh;
	/* Modern viewport unit */
	height: auto;
	margin: 0 !important;
	padding: 40px 20px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	overflow-x: hidden;
}

/* Ensure content isn't cut off on short screens */
@media screen and (max-height: 800px) {
	body.login {
		padding-top: 60px;
		padding-bottom: 60px;
		justify-content: flex-start;
	}
}

/* Universal box-sizing for plugin elements to prevent layout breakage */
/* Universal box-sizing for plugin elements - REDUNDANT with global reset, but keeping for safety if reset is overridden */
.nws-utility-footer,
.nws-help-popup,
.nws-help-popup * {
	box-sizing: border-box;
}


/* ==========================================================================
   4. Particle Canvas
   ========================================================================== */

#nws-particles {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
	pointer-events: none;
}

/* Hide canvas when user prefers reduced motion */
body.nws-reduced-motion #nws-particles {
	display: none;
}


/* ==========================================================================
   5. Login Container – Glassmorphism Card
   ========================================================================== */

#login {
	position: relative;
	z-index: 1;
	width: 100% !important;
	max-width: 420px !important;
	padding: 44px 40px 36px !important;
	background: var(--nws-card-bg) !important;
	border: 1px solid var(--nws-card-border);
	border-radius: var(--nws-card-radius) !important;
	box-shadow: var(--nws-card-shadow) !important;
	-webkit-backdrop-filter: blur(18px) saturate(1.2);
	backdrop-filter: blur(18px) saturate(1.2);
	margin: 0 auto;
}


/* ==========================================================================
   6. Logo
   ========================================================================== */

#login h1 {
	margin-bottom: 4px;
}

#login h1 a {
	width: 220px !important;
	height: 70px !important;
	background-size: contain !important;
	background-repeat: no-repeat !important;
	background-position: center !important;
	margin: 0 auto 0 !important;
	display: block;
	outline: none;
	/* Invert dark text to white; hue-rotate restores the blue accent */
	filter: invert(1) hue-rotate(180deg) brightness(1.15);
}


/* ==========================================================================
   7. Welcome Message
   ========================================================================== */

.nws-welcome-text {
	text-align: center;
	color: var(--nws-text-secondary);
	font-size: 15px;
	/* +1px */
	font-weight: 400;
	line-height: 1.6;
	margin: 8px 0 32px;
	/* Increased top/bottom margin */
	letter-spacing: 0.01em;
}


/* ==========================================================================
   8. Login Form
   ========================================================================== */

.login form {
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	padding: 0 !important;
	margin: 0 !important;
}

/* Labels */
.login form label,
.login form .user-pass-wrap label {
	color: var(--nws-text-primary) !important;
	font-size: 14px;
	/* +1px */
	font-weight: 500;
	letter-spacing: 0.01em;
	margin-bottom: 6px;
	display: block;
}

/* Inputs */
.login form input[type="text"],
.login form input[type="password"],
.login form input[type="email"] {
	background: var(--nws-input-bg) !important;
	border: 1px solid var(--nws-input-border) !important;
	border-radius: 10px !important;
	color: var(--nws-text-primary) !important;
	font-family: var(--nws-font-family) !important;
	font-size: 14px !important;
	padding: 12px 16px !important;
	height: auto !important;
	width: 100% !important;
	box-sizing: border-box !important;
	transition: border-color 0.25s ease, box-shadow 0.25s ease;
	outline: none !important;
}

.login form input[type="text"]:focus,
.login form input[type="password"]:focus,
.login form input[type="email"]:focus {
	border-color: var(--nws-input-focus-border) !important;
	box-shadow: var(--nws-input-focus-glow) !important;
}

/* Placeholder text */
.login form input::placeholder {
	color: var(--nws-text-secondary);
	opacity: 1;
}

/* Password toggle (show/hide) */
.login .wp-pwd .button.wp-hide-pw {
	color: var(--nws-text-secondary) !important;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	outline: none !important;
}

.login .wp-pwd .button.wp-hide-pw:hover,
.login .wp-pwd .button.wp-hide-pw:focus {
	color: var(--nws-text-primary) !important;
}

/* Remember me checkbox */
.login .forgetmenot label {
	color: var(--nws-text-secondary) !important;
	font-size: 13px !important;
	display: inline-flex !important;
	align-items: center !important;
	gap: 6px;
	line-height: normal !important;
}

.login .forgetmenot input[type="checkbox"] {
	accent-color: #2563eb;
}


/* ==========================================================================
   9. Submit Button
   ========================================================================== */

.login form .button-primary,
.login form input[type="submit"] {
	width: 100% !important;
	background: var(--nws-btn-gradient) !important;
	border: none !important;
	border-radius: 10px !important;
	color: #fff !important;
	font-family: var(--nws-font-family) !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	padding: 14px 0 !important;
	/* +1px vertical padding */
	text-shadow: none !important;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
	box-shadow: var(--nws-btn-shadow) !important;
	margin-top: 16px !important;
	/* +8px spacing */
	height: auto !important;
	line-height: 1.4 !important;
}

.login form .button-primary:hover,
.login form input[type="submit"]:hover {
	background: var(--nws-btn-hover) !important;
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45) !important;
}

.login form .button-primary:active,
.login form input[type="submit"]:active {
	transform: translateY(0);
	box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3) !important;
}


/* ==========================================================================
   10. Links (Lost Password, Back to Site)
   ========================================================================== */

.login #nav,
.login #backtoblog {
	text-align: center;
	padding: 0 !important;
}

.login #nav a,
.login #backtoblog a {
	color: var(--nws-text-link) !important;
	font-size: 14px;
	/* +1px */
	text-decoration: none;
	transition: color 0.2s ease, text-shadow 0.2s ease;
}

.login #nav a:hover,
.login #backtoblog a:hover {
	color: var(--nws-text-link-hover) !important;
	text-shadow: 0 0 8px rgba(96, 165, 250, 0.4);
	text-decoration: underline;
}

.login #nav a:hover,
.login #backtoblog a:hover {
	color: var(--nws-text-link-hover) !important;
}


/* ==========================================================================
   11. Error / Success Messages
   ========================================================================== */

.login .message,
.login .success {
	background: rgba(37, 99, 235, 0.1) !important;
	border-left: 3px solid #2563eb !important;
	color: var(--nws-text-primary) !important;
	border-radius: 8px;
	padding: 12px 16px;
	margin-bottom: 20px;
}

.login #login_error {
	background: rgba(239, 68, 68, 0.1) !important;
	border-left: 3px solid #ef4444 !important;
	color: #fca5a5 !important;
	border-radius: 8px;
	padding: 12px 16px;
	margin-bottom: 20px;
}

.login #login_error a {
	color: #fca5a5 !important;
}


/* ==========================================================================
   12. reCAPTCHA Compatibility
   ========================================================================== */

.login .g-recaptcha,
.login .grecaptcha-badge,
.login iframe[src*="recaptcha"] {
	position: relative !important;
	z-index: 10 !important;
	/* Dark mode hack for reCAPTCHA */
	filter: invert(0.92) hue-rotate(180deg);
}

/* reCAPTCHA visual integration wrapper */
.login .g-recaptcha>div {
	margin: 0 auto;
}



/* ==========================================================================
   13. Privacy Policy Page Link
   ========================================================================== */

.login .privacy-policy-page-link {
	text-align: center;
}

.login .privacy-policy-page-link a {
	color: var(--nws-text-secondary) !important;
	font-size: 12px;
}


/* ==========================================================================
   14. WordPress Admin Bar / Debug Bar hide on login
   ========================================================================== */

body.login #wpadminbar {
	display: none !important;
}


/* ==========================================================================
   15. Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

	.login form input[type="text"],
	.login form input[type="password"],
	.login form input[type="email"],
	.login form .button-primary,
	.login form input[type="submit"],
	.login #nav a,
	.login #backtoblog a {
		transition: none !important;
	}
}


/* ==========================================================================
   16. Responsive / Mobile
   ========================================================================== */

/* ==========================================================================
	16. Responsive / Mobile (Refined)
	========================================================================== */

@media screen and (max-width: 600px) {
	#login {
		width: 100% !important;
		max-width: 100% !important;
		padding: 32px 20px !important;
		/* Reduced padding */
		border-radius: 20px !important;
		box-shadow: none !important;
		background: rgba(20, 27, 45, 0.9) !important;
		margin: 0 auto;
		box-sizing: border-box !important;
	}

	/* Scale down reCAPTCHA on very small screens (iPhone SE, etc.) */
	.login .g-recaptcha {
		transform: scale(0.85);
		transform-origin: center;
		margin: 0 -20px !important;
		/* Negative margin to compensate scale */
		display: flex;
		justify-content: center;
	}

	#login h1 a {
		width: auto !important;
		max-width: 200px !important;
		height: 60px !important;
		margin-bottom: 20px !important;
	}

	.nws-welcome-text {
		font-size: 14px;
		margin-bottom: 24px;
	}

	/* Adjust help panel width for mobile */
	.nws-help-panel {
		width: 100% !important;
		max-width: 100% !important;
		border-radius: 12px !important;
	}
}

/* Extra tight screens fix */
@media screen and (max-width: 360px) {
	#login {
		padding: 24px 12px !important;
	}

	.login .g-recaptcha {
		transform: scale(0.77);
	}
}

/* Landscape / Short Screens */
@media screen and (max-height: 700px) {
	#login {
		padding-top: 24px !important;
		padding-bottom: 24px !important;
	}

	.nws-welcome-text {
		margin-bottom: 16px;
	}

	.nws-login-footer-powered {
		margin-top: 16px;
		padding-top: 12px;
	}

	/* Ensure footer doesn't overlap form */
	.nws-utility-footer {
		align-items: center;
		/* centru pe orizontală */
		padding: 8px;
		background: transparent;
	}
}

@media screen and (max-width: 380px) {
	#login {
		padding: 24px 16px 22px !important;
	}
}


/* ==========================================================================
   17. Powered by Footer (inside card)
   ========================================================================== */

@keyframes nws-shimmer {
	0% {
		background-position: -200% center;
	}

	100% {
		background-position: 200% center;
	}
}

@keyframes nws-fade-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.nws-login-footer-powered {
	text-align: center;
	margin-top: 24px;
	padding-top: 18px;
	border-top: 1px solid var(--nws-card-border);
	animation: nws-fade-in 0.8s ease 0.4s both;
}

.nws-login-footer-powered p {
	margin: 0;
	padding: 0;
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	/* Shimmer gradient text effect */
	background: linear-gradient(90deg,
			var(--nws-text-secondary) 0%,
			var(--nws-text-secondary) 40%,
			rgba(96, 165, 250, 0.9) 50%,
			var(--nws-text-secondary) 60%,
			var(--nws-text-secondary) 100%);
	background-size: 200% auto;
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	animation: nws-shimmer 4s ease-in-out infinite;
}

.nws-login-footer-powered a {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	transition: transform 0.2s ease, filter 0.3s ease;
}

.nws-login-footer-powered a:hover {
	transform: scale(1.08);
}

.nws-login-footer-powered img {
	height: 16px;
	width: auto;
	display: block;
	/* Apply the NWS brand filter to ensure visibility on dark background */
	filter: invert(1) hue-rotate(180deg) brightness(1.15);
	opacity: 0.55;
	transition: opacity 0.3s ease, filter 0.3s ease;
}

.nws-login-footer-powered:hover img {
	opacity: 0.9;
	filter: invert(1) hue-rotate(180deg) brightness(1.4);
}

/* Support contact line */
.nws-support-contact {
	margin: 8px 0 0 !important;
	padding: 0;
	font-size: 10px !important;
	font-weight: 400 !important;
	letter-spacing: 0.04em !important;
	text-transform: none !important;
	color: var(--nws-text-secondary);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	flex-wrap: wrap;
	/* Override shimmer from parent */
	background: none !important;
	-webkit-background-clip: unset !important;
	background-clip: unset !important;
	-webkit-text-fill-color: var(--nws-text-secondary) !important;
	animation: none !important;
}

.nws-support-contact a {
	color: var(--nws-text-link) !important;
	-webkit-text-fill-color: var(--nws-text-link) !important;
	text-decoration: none;
	transition: color 0.2s ease;
}

.nws-support-contact a:hover {
	color: var(--nws-text-link-hover) !important;
	-webkit-text-fill-color: var(--nws-text-link-hover) !important;
}

.nws-support-sep {
	opacity: 0.35;
}

/* Main logo – non-clickable */
#login h1 a {
	pointer-events: none !important;
	cursor: default !important;
}


/* ==========================================================================
   18. Microsoft-style Utility Footer
   ========================================================================== */

.nws-utility-footer {
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	padding: 16px 24px;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	/* Align to right like Microsoft */
	gap: 20px;
	z-index: 100;
	background: transparent;
	box-sizing: border-box;
	flex-wrap: wrap;
	transition: background 0.3s ease;
}

/* On smaller screens (mobile & landscape), center the footer links and make static */
@media screen and (max-width: 600px),
screen and (max-height: 700px) {
	.nws-utility-footer {
		position: static;
		margin-top: 40px;
		justify-content: center;
		padding: 20px;
		background: transparent;
		flex-direction: column;
		gap: 12px;
	}
}

.nws-utility-footer a,
.nws-utility-footer button {
	color: rgba(248, 250, 252, 0.5);
	font-size: 13px;
	text-decoration: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
	transition: color 0.2s ease;
	font-family: var(--nws-font-family);
}

.nws-utility-footer a:hover,
.nws-utility-footer button:hover,
.nws-utility-footer button.active {
	color: #fff;
	text-decoration: none;
}



/* ==========================================================================
   19. Help Popup
   ========================================================================== */

/* ==========================================================================
   19. Inline Help Panel (Replaces Popup)
   ========================================================================== */

.nws-help-panel {
	display: block;
	width: 100%;
	max-width: 420px;
	margin: 0 auto;
	/* Initially hidden properties */
	max-height: 0;
	opacity: 0;
	overflow: hidden;
	transform: translateY(-8px);
	/* Transition settings */
	transition: max-height 0.4s cubic-bezier(0.19, 1, 0.22, 1),
		opacity 0.3s ease,
		transform 0.3s ease,
		margin-top 0.3s ease;
	/* Styling to match card, but subtler */
	background: rgba(20, 27, 45, 0.5);
	border: 1px solid rgba(255, 255, 255, 0.05);
	border-radius: 16px;
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}

.nws-help-panel.visible {
	max-height: 300px;
	/* Sufficient height for content */
	opacity: 1;
	transform: translateY(0);
	margin-top: 16px;
	/* Push down from login card */
}

.nws-help-inner {
	padding: 24px;
}

.nws-popup-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nws-popup-header h3 {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
}

.nws-popup-header button {
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.5);
	cursor: pointer;
	padding: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: all 0.2s;
}

.nws-popup-header button:hover {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}

.nws-popup-content p {
	margin: 0 0 20px;
	color: var(--nws-text-secondary);
	font-size: 14px;
	line-height: 1.5;
}

.nws-help-actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.nws-help-actions .button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 10px;
	border-radius: 8px;
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	transition: all 0.2s;
	text-align: center;
}

.nws-help-actions .button-secondary {
	background: var(--nws-btn-gradient) !important;
	color: #fff !important;
	border: none !important;
	box-shadow: var(--nws-btn-shadow) !important;
}

.nws-help-actions .button-secondary:hover {
	background: var(--nws-btn-hover) !important;
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45) !important;
	border-color: transparent !important;
}

.nws-help-actions .button-link {
	background: transparent;
	color: var(--nws-text-link);
}

.nws-help-actions .button-link:hover {
	color: var(--nws-text-link-hover);
	text-decoration: underline;
}