/* Dashboard Pro branded login experience.
   Applies to native wp-login.php. Native WordPress authentication is preserved;
   this file restyles the screen to match the Dashboard Pro design language. */

@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:ital,wght@0,400..700;1,400..700&family=JetBrains+Mono:wght@400;500&family=Sora:wght@400..800&display=swap');

:root {
	--dpro-primary: #16a34a;
	--dpro-primary-dark: #0d8a3e;
	--dpro-accent: #246bfe;
	--dpro-card-radius: 16px;
	--font-display: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	--font-sans: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	--font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

html,
body.login {
	height: 100%;
	margin: 0;
	padding: 0;
}

/* Page Canvas: Stack Brand Header and Login Card vertically centered */
body.login {
	background-color: #f8fafc;
	min-height: 100vh;
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 32px 16px;
	font-family: var(--font-sans);
	color: #0f172a;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	box-sizing: border-box;
}

body.login #login {
	width: 100%;
	max-width: 410px;
	margin: 0 auto;
	padding: 0;
	position: relative;
	z-index: 10;
}

/* Hide default WordPress logo link */
body.login #login h1 {
	display: none;
}

/* Brand Header Block: Positioned cleanly on TOP of the card */
.dpro-brand {
	text-align: center;
	margin-bottom: 24px;
	width: 100%;
	max-width: 410px;
	margin-left: auto;
	margin-right: auto;
	display: block;
}

.dpro-brand__emblem {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 12px;
	filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.08));
	transition: transform 0.25s ease;
}

.dpro-brand__emblem:hover {
	transform: translateY(-2px);
}

.dpro-brand__logo {
	max-height: 48px;
	width: auto;
	margin: 0 auto 12px;
	display: block;
	filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.06));
}

.dpro-brand__name {
	font-family: var(--font-display);
	font-size: 1.65rem;
	font-weight: 700;
	color: #0f172a;
	letter-spacing: -0.025em;
	margin: 0;
	line-height: 1.2;
	text-align: center;
}

.dpro-brand__tagline {
	font-family: var(--font-sans);
	font-size: 0.875rem;
	color: #64748b;
	margin: 6px 0 0;
	font-weight: 400;
	letter-spacing: -0.01em;
	text-align: center;
}

/* Form Card Container (Flexbox layout for strict vertical element ordering) */
body.login form {
	display: flex !important;
	flex-direction: column !important;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: var(--dpro-card-radius);
	box-shadow: 
		0 10px 25px -5px rgba(0, 0, 0, 0.05),
		0 8px 10px -6px rgba(0, 0, 0, 0.01);
	padding: 28px 28px 24px;
	margin: 0;
	position: relative;
	overflow: hidden;
}

/* Inside-Card Header & Segmented Pill Tabs (Ordered at VERY TOP of Card) */
.dpro-card-header {
	order: 1 !important;
	margin-bottom: 20px;
	text-align: center;
}

.dpro-card-title {
	font-family: var(--font-display);
	font-size: 1.25rem;
	font-weight: 700;
	color: #0f172a;
	margin: 0 0 4px;
	letter-spacing: -0.02em;
}

.dpro-card-subtitle {
	font-family: var(--font-sans);
	font-size: 0.8125rem;
	color: #64748b;
	margin: 0;
	font-weight: 400;
}

.dpro-tabs {
	display: flex;
	gap: 4px;
	background: #f1f5f9;
	padding: 4px;
	border-radius: 10px;
	margin-top: 16px;
}

.dpro-tab {
	flex: 1;
	text-align: center;
	font-family: var(--font-sans);
	font-size: 0.84rem;
	font-weight: 500;
	color: #64748b;
	text-decoration: none;
	padding: 8px 12px;
	border-radius: 7px;
	transition: all 0.15s ease;
	cursor: pointer;
}

.dpro-tab--active {
	background: #ffffff;
	color: #0f172a;
	font-weight: 600;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.dpro-tab:not(.dpro-tab--active):hover {
	color: #0f172a;
}

/* Messages and Errors (Ordered right after card header) */
body.login #login_error,
body.login .message,
body.login .success {
	order: 1 !important;
	background: #fff0f3;
	border: 1px solid #fca5a5;
	border-left: 4px solid #ef3154;
	border-radius: 10px;
	padding: 12px 14px;
	font-family: var(--font-sans);
	font-size: 0.85rem;
	color: #991b1b;
	box-shadow: 0 4px 12px rgba(239, 49, 84, 0.08);
	margin-bottom: 20px;
}

body.login .message {
	background: #edf3ff;
	border-color: #93c5fd;
	border-left-color: var(--dpro-accent, #246bfe);
	color: #1e40af;
	box-shadow: 0 4px 12px rgba(36, 107, 254, 0.08);
}

body.login .success {
	background: #eaf9ef;
	border-color: #abf5c5;
	border-left-color: #119c42;
	color: #0b6b34;
	box-shadow: 0 4px 12px rgba(17, 156, 66, 0.08);
}

/* ------------------------------------------------------------- */
/* STRICT FIELD ORDERING (POSITION 2: Username, POSITION 3: Password) */
/* ------------------------------------------------------------- */

/* USERNAME FIELD: ALWAYS FIRST INPUT (order: 2) */
body.login form > p:has(#user_login),
body.login form > div:has(#user_login),
body.login p.login-username {
	order: 2 !important;
	margin: 0 0 16px 0 !important;
	padding: 0 !important;
}

/* PASSWORD FIELD: ALWAYS SECOND INPUT (order: 3) */
body.login form > div.user-pass-wrap,
body.login form > p.user-pass-wrap,
body.login form > p:has(#user_pass),
body.login form > div:has(#user_pass),
body.login .user-pass-wrap {
	order: 3 !important;
	margin: 0 0 16px 0 !important;
	padding: 0 !important;
}

/* Generic fallback for any other form paragraphs */
body.login form > p:not(.forgetmenot):not(.submit):not(.dpro-card-header) {
	margin: 0 0 16px 0 !important;
	padding: 0 !important;
}

/* Form Field Labels */
body.login label {
	display: block;
	font-family: var(--font-sans);
	font-weight: 600;
	font-size: 0.8125rem;
	color: #1e293b;
	margin-bottom: 6px;
	text-transform: none;
	letter-spacing: normal;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	padding: 0 !important;
}

/* Soft Tinted Input Fields */
body.login input[type="text"],
body.login input[type="password"],
body.login input[type="email"] {
	width: 100%;
	box-sizing: border-box;
	background-color: #edf2fa;
	border: 1px solid transparent;
	border-radius: 10px;
	min-height: 42px;
	padding: 10px 14px;
	font-family: var(--font-sans);
	font-size: 0.925rem;
	color: #0f172a;
	transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
	margin: 0;
}

body.login input[type="text"]::placeholder,
body.login input[type="password"]::placeholder,
body.login input[type="email"]::placeholder {
	color: #94a3b8;
}

body.login input[type="text"]:focus,
body.login input[type="password"]:focus,
body.login input[type="email"]:focus {
	background-color: #ffffff;
	border-color: var(--dpro-primary, #16a34a);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--dpro-primary, #16a34a) 15%, transparent);
	outline: none;
}

/* REMEMBER ME OPTION (order: 4, clear 12px gap between checkbox and label) */
body.login .forgetmenot,
body.login form > p.forgetmenot,
body.login form > div.forgetmenot {
	order: 4 !important;
	float: none !important;
	width: 100% !important;
	margin: 4px 0 16px 0 !important;
	display: flex !important;
	align-items: center !important;
	gap: 12px !important; /* Ensures clear spacing between checkbox and text */
}

body.login .forgetmenot label {
	text-transform: none !important;
	letter-spacing: normal !important;
	font-size: 0.8125rem !important;
	color: #475569 !important;
	font-weight: 500 !important;
	cursor: pointer !important;
	border: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	padding: 0 !important;
	margin: 0 !important;
	line-height: 1 !important;
}

body.login .forgetmenot input[type="checkbox"] {
	border: 1px solid #cbd5e1 !important;
	border-radius: 4px !important;
	width: 16px !important;
	height: 16px !important;
	margin: 0 8px 0 0 !important;
	cursor: pointer;
	accent-color: #0f172a;
	flex-shrink: 0;
}

/* LOG IN SUBMIT BUTTON (order: 5, full width, centered below Remember Me) */
body.login .submit,
body.login form > p.submit,
body.login form > div.submit {
	order: 5 !important;
	float: none !important;
	width: 100% !important;
	margin: 0 !important;
	display: flex !important;
	justify-content: center !important;
}

body.login .button-primary,
body.login .wp-pwd .button,
body.login input[type="submit"] {
	width: 100% !important;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	float: none;
	clear: both;
	background: #0f172a;
	border: 0;
	border-radius: 10px;
	padding: 12px 16px;
	font-family: var(--font-sans);
	font-size: 0.925rem;
	font-weight: 600;
	color: #ffffff;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
	text-shadow: none;
	transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
	height: auto;
	line-height: 1.4;
	text-align: center;
}

body.login .button-primary:hover,
body.login input[type="submit"]:hover {
	background: #1e293b;
	transform: translateY(-1px);
	box-shadow: 0 6px 16px rgba(15, 23, 42, 0.22);
}

body.login .button-primary:active,
body.login input[type="submit"]:active {
	transform: translateY(0) scale(0.99);
	box-shadow: 0 2px 4px rgba(15, 23, 42, 0.12);
}

body.login .button-primary:focus,
body.login input[type="submit"]:focus {
	outline: 2px solid var(--dpro-accent, #246bfe);
	outline-offset: 2px;
}

/* Password Toggle Eye Button */
body.login .wp-pwd .button {
	width: auto !important;
	min-height: auto;
	margin: 0;
	padding: 8px 12px;
	background: transparent;
	color: #64748b;
	box-shadow: none;
	border-radius: 6px;
}

body.login .wp-pwd .button:hover {
	background: #e2e8f0;
	color: #0f172a;
	transform: none;
	box-shadow: none;
}

/* Navigation Links below form card */
body.login #nav,
body.login #backtoblog {
	text-align: center;
	margin: 18px 0 0;
	padding: 0;
	font-family: var(--font-sans);
	font-size: 0.8125rem;
}

body.login #backtoblog {
	margin-top: 8px;
}

body.login #nav a,
body.login #backtoblog a,
body.login .privacy-policy-page-link a {
	color: #64748b;
	text-decoration: none;
	font-weight: 500;
	transition: color 0.15s ease;
}

body.login #nav a:hover,
body.login #backtoblog a:hover,
body.login .privacy-policy-page-link a:hover {
	color: #0f172a;
	text-decoration: underline;
}

.dpro-support {
	text-align: center;
	color: #64748b;
	font-family: var(--font-sans);
	font-size: 0.8125rem;
	margin-top: 18px;
}

.dpro-support a {
	color: var(--dpro-accent, #246bfe);
	text-decoration: none;
	font-weight: 500;
}

.dpro-support a:hover {
	text-decoration: underline;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
	body.login *,
	body.login *::before,
	body.login *::after {
		transition: none !important;
		animation: none !important;
	}
	body.login .button-primary:hover,
	body.login input[type="submit"]:hover {
		transform: none;
	}
}
