/* ==========================================================================
   Horizon Studio - Custom WordPress Login Page Styles (2026 Edition)
   ==========================================================================
   Loaded via login_enqueue_scripts to restyle wp-login.php,
   lost password, and reset password pages.
   Font: Onest (loaded via Google Fonts in the PHP hook).
   ========================================================================== */

/* --- Keyframes --- */
@keyframes loginFloat {
	0%, 100% { transform: translate(0, 0) scale(1); }
	33% { transform: translate(30px, -30px) scale(1.05); }
	66% { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes loginFloatSlow {
	0%, 100% { transform: translate(0, 0) scale(1); }
	33% { transform: translate(-25px, 20px) scale(1.03); }
	66% { transform: translate(15px, -25px) scale(0.97); }
}

@keyframes loginMeshShift {
	0% { background-position: 0% 50%; }
	25% { background-position: 50% 100%; }
	50% { background-position: 100% 50%; }
	75% { background-position: 50% 0%; }
	100% { background-position: 0% 50%; }
}

@keyframes loginGrain {
	0%, 100% { transform: translate(0, 0); }
	10% { transform: translate(-5%, -10%); }
	30% { transform: translate(3%, -15%); }
	50% { transform: translate(12%, 9%); }
	70% { transform: translate(9%, 4%); }
	90% { transform: translate(-1%, 7%); }
}

@keyframes loginBorderGlow {
	0% { background-position: 0% 50%; }
	50% { background-position: 100% 50%; }
	100% { background-position: 0% 50%; }
}

@keyframes loginCardEntrance {
	0% {
		opacity: 0;
		transform: translateY(20px) scale(0.97);
	}
	100% {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* --- Hide WP logo, title, back link, language selector, footer --- */
.login h1 a,
.login h1,
#backtoblog,
.language-switcher,
#footer,
.privacy-policy-page-link,
.login .privacy-policy-page-link,
.request-username {
	display: none !important;
}

/* --- Page background: animated mesh gradient (like immersive blocks) --- */
body.login {
	background: linear-gradient(135deg, #002B52 0%, #00519C 25%, #0077CC 50%, #00A3E0 75%, #00519C 100%) !important;
	background-size: 300% 300% !important;
	animation: loginMeshShift 15s ease-in-out infinite !important;
	font-family: 'Onest', sans-serif;
	position: relative;
	overflow: hidden;
}

/* Blob 1 — top right, bright brand blue */
body.login::before {
	content: '' !important;
	position: fixed;
	top: -20%;
	right: -15%;
	width: clamp(350px, 65vw, 650px);
	height: clamp(350px, 65vw, 650px);
	border-radius: 50%;
	background: linear-gradient(135deg, rgba(0, 163, 224, 0.6), rgba(0, 212, 170, 0.3));
	filter: blur(90px);
	animation: loginFloat 18s ease-in-out infinite;
	pointer-events: none;
	z-index: 0;
}

/* Blob 2 — bottom left, warm accent */
body.login::after {
	content: '' !important;
	position: fixed;
	bottom: -15%;
	left: -10%;
	width: clamp(280px, 50vw, 500px);
	height: clamp(280px, 50vw, 500px);
	border-radius: 50%;
	background: linear-gradient(45deg, rgba(255, 107, 53, 0.25), rgba(247, 201, 75, 0.2));
	filter: blur(80px);
	animation: loginFloatSlow 22s ease-in-out infinite;
	pointer-events: none;
	z-index: 0;
}

/* Blob 3 — center-left, teal glow (using #login wrapper) */
#login::before {
	content: '' !important;
	position: fixed;
	top: 30%;
	left: -5%;
	width: clamp(200px, 40vw, 400px);
	height: clamp(200px, 40vw, 400px);
	border-radius: 50%;
	background: linear-gradient(180deg, rgba(0, 212, 170, 0.3), rgba(0, 81, 156, 0.15));
	filter: blur(70px);
	animation: loginFloat 25s ease-in-out infinite reverse;
	pointer-events: none;
	z-index: 0;
}

/* Subtle grain texture overlay */
#login::after {
	content: '' !important;
	position: fixed;
	inset: -200% !important;
	width: 400% !important;
	height: 400% !important;
	background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E") !important;
	background-repeat: repeat !important;
	animation: loginGrain 8s steps(10) infinite !important;
	pointer-events: none;
	z-index: 0;
	opacity: 0.4;
}

/* --- Login form card with animated border glow --- */
.login form {
	background: rgba(255, 255, 255, 0.92) !important;
	backdrop-filter: blur(24px) !important;
	-webkit-backdrop-filter: blur(24px) !important;
	border: 2px solid transparent !important;
	border-radius: 20px !important;
	box-shadow:
		0 12px 40px rgba(0, 0, 0, 0.2),
		0 4px 12px rgba(0, 0, 0, 0.1),
		inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
	padding: 40px 36px 32px !important;
	margin-top: 0 !important;
	position: relative;
	z-index: 2;
	animation: loginCardEntrance 0.8s cubic-bezier(0.16, 1, 0.3, 1) both !important;
	animation-delay: 0.15s !important;
}

/* Animated gradient border glow (like pricing-card.featured) */
.login form::after {
	content: '' !important;
	position: absolute !important;
	inset: -2px !important;
	border-radius: 22px !important;
	padding: 2px !important;
	background: linear-gradient(135deg, #00A3E0, #00519C 50%, #00D4AA, #00519C, #00A3E0) !important;
	background-size: 300% 300% !important;
	animation: loginBorderGlow 8s ease-in-out infinite !important;
	-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0) !important;
	-webkit-mask-composite: xor !important;
	mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0) !important;
	mask-composite: exclude !important;
	pointer-events: none !important;
	z-index: -1 !important;
	opacity: 0.6 !important;
}

/* Subtle glow under the card */
.login form::before {
	content: '' !important;
	position: absolute !important;
	bottom: -20px !important;
	left: 10% !important;
	right: 10% !important;
	height: 40px !important;
	background: radial-gradient(ellipse at center, rgba(0, 81, 156, 0.15) 0%, transparent 70%) !important;
	filter: blur(10px) !important;
	pointer-events: none !important;
	z-index: -1 !important;
}

/* --- Form labels --- */
.login label {
	font-family: 'Onest', sans-serif !important;
	font-weight: 600 !important;
	font-size: 12px !important;
	color: #64748b !important;
	margin-bottom: 6px !important;
	text-transform: uppercase !important;
	letter-spacing: 0.04em !important;
}

/* --- Input fields --- */
.login input[type="text"],
.login input[type="password"],
.login input[type="email"] {
	border: 1.5px solid #e2e8f0 !important;
	border-radius: 12px !important;
	padding: 12px 16px !important;
	font-family: 'Onest', sans-serif !important;
	font-size: 14px !important;
	color: #1e293b !important;
	background: #f8fafc !important;
	transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
	box-shadow: none !important;
}

.login input[type="text"]:focus,
.login input[type="password"]:focus,
.login input[type="email"]:focus {
	border-color: #00519C !important;
	box-shadow: 0 0 0 3px rgba(0, 81, 156, 0.1) !important;
	background: #ffffff !important;
	outline: none !important;
}

/* --- Primary button (Log In, Get New Password, etc.) --- */
.login .button-primary,
.login .button.button-primary {
	background: linear-gradient(135deg, #00519C, #003D75) !important;
	border: none !important;
	border-radius: 12px !important;
	padding: 14px 24px !important;
	font-family: 'Onest', sans-serif !important;
	font-weight: 600 !important;
	font-size: 15px !important;
	color: #ffffff !important;
	cursor: pointer !important;
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, background 0.3s ease !important;
	box-shadow: 0 4px 16px rgba(0, 81, 156, 0.2), 0 1px 2px rgba(0, 81, 156, 0.1) !important;
	text-shadow: none !important;
	float: none !important;
	width: 100% !important;
	position: relative !important;
	overflow: hidden !important;
}

.login .button-primary:hover,
.login .button.button-primary:hover {
	background: linear-gradient(135deg, #0066CC, #00519C) !important;
	transform: translateY(-2px) !important;
	box-shadow: 0 12px 40px rgba(0, 81, 156, 0.3), 0 4px 12px rgba(0, 81, 156, 0.15) !important;
}

.login .button-primary:active,
.login .button.button-primary:active {
	background: linear-gradient(135deg, #003D75, #002d55) !important;
	transform: translateY(0) scale(0.98) !important;
	box-shadow: 0 4px 16px rgba(0, 81, 156, 0.25) !important;
}

/* --- Remember me checkbox --- */
.login .forgetmenot {
	display: flex !important;
	align-items: center !important;
	gap: 0 !important;
	margin-bottom: 20px !important;
	margin-top: 4px !important;
	float: none !important;
}

.login .forgetmenot label {
	font-family: 'Onest', sans-serif !important;
	font-weight: 500 !important;
	font-size: 13px !important;
	color: #64748b !important;
	display: inline-flex !important;
	align-items: center !important;
	gap: 8px !important;
	cursor: pointer !important;
	transition: color 0.2s ease !important;
	line-height: 1 !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
}

.login .forgetmenot label:hover {
	color: #1e293b !important;
}

.login input[type="checkbox"] {
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
	width: 18px !important;
	height: 18px !important;
	min-width: 18px !important;
	min-height: 18px !important;
	border: 2px solid #cbd5e1 !important;
	border-radius: 5px !important;
	background: #f8fafc !important;
	cursor: pointer !important;
	transition: all 0.2s ease !important;
	flex-shrink: 0 !important;
	position: relative !important;
	vertical-align: middle !important;
	margin: 0 8px 0 0 !important;
	display: inline-block !important;
	box-sizing: border-box !important;
}

.login input[type="checkbox"]:checked {
	background: #00519C !important;
	border-color: #00519C !important;
}

.login input[type="checkbox"]:checked::after {
	content: '' !important;
	display: block !important;
	position: absolute !important;
	top: 50% !important;
	left: 50% !important;
	width: 5px !important;
	height: 9px !important;
	margin-top: -6px !important;
	margin-left: -3px !important;
	border: solid #ffffff !important;
	border-width: 0 2px 2px 0 !important;
	transform: rotate(45deg) !important;
}

.login input[type="checkbox"]:hover {
	border-color: #00519C !important;
	box-shadow: 0 0 0 3px rgba(0, 81, 156, 0.1) !important;
}

.login input[type="checkbox"]:focus {
	outline: none !important;
	border-color: #00519C !important;
	box-shadow: 0 0 0 3px rgba(0, 81, 156, 0.15) !important;
}

/* --- Lost password link --- */
.login #nav {
	margin-top: 16px;
	text-align: center;
}

.login #nav a {
	color: rgba(255, 255, 255, 0.7);
	font-family: 'Onest', sans-serif;
	font-weight: 500;
	transition: color 0.2s ease;
}

.login #nav a:hover {
	color: #ffffff;
}

/* --- Messages (errors, info) --- */
.login .message {
	border-left: 4px solid #00519C !important;
	background: rgba(240, 244, 255, 0.95) !important;
	backdrop-filter: blur(12px) !important;
	color: #1e293b !important;
	font-family: 'Onest', sans-serif !important;
	border-radius: 0 12px 12px 0 !important;
	padding: 12px 16px !important;
}

.login #login_error {
	border-left: 4px solid #dc2626 !important;
	background: rgba(254, 242, 242, 0.95) !important;
	backdrop-filter: blur(12px) !important;
	color: #1e293b !important;
	font-family: 'Onest', sans-serif !important;
	border-radius: 0 12px 12px 0 !important;
}

/* --- Lost password / reset form heading --- */
.login p.message,
.login h2 {
	font-family: 'Onest', sans-serif !important;
}

/* --- Center the form vertically --- */
#login {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 100vh;
	padding-top: 0 !important;
	position: relative;
	z-index: 1;
}

#loginform,
#lostpasswordform,
#resetpassform {
	margin-top: 0 !important;
}

/* --- Submit container: stack remember-me above button --- */
.login .submit {
	display: flex !important;
	flex-direction: column !important;
	float: none !important;
}

/* --- Form paragraph spacing --- */
.login form p {
	margin-bottom: 20px !important;
}

.login form p.submit {
	margin-bottom: 0 !important;
}

/* --- Responsive --- */
@media (max-width: 480px) {
	body.login::before {
		width: clamp(220px, 60vw, 380px);
		height: clamp(220px, 60vw, 380px);
	}

	body.login::after {
		width: clamp(180px, 50vw, 320px);
		height: clamp(180px, 50vw, 320px);
	}

	#login::before {
		width: clamp(150px, 40vw, 280px);
		height: clamp(150px, 40vw, 280px);
	}

	.login form {
		border-radius: 16px !important;
		padding: 28px 24px 24px !important;
	}

	.login .button-primary,
	.login .button.button-primary {
		padding: 13px 20px !important;
		font-size: 14px !important;
		border-radius: 10px !important;
	}
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
	body.login {
		animation: none !important;
	}

	body.login::before,
	body.login::after,
	#login::before,
	#login::after,
	.login form::after {
		animation: none !important;
	}

	.login form {
		animation: none !important;
		opacity: 1 !important;
	}

	.login .button-primary,
	.login .button.button-primary {
		transition: background 0.15s ease !important;
	}
}
