/*
 * Whitehill Solution — account access.
 *
 * Two consumers, one file:
 *   1. .wh-account — the front-end Account & Sign in page template.
 *   2. body.login — the core wp-login.php screen, restyled to match.
 *
 * Every colour here comes from tokens.css, so both surfaces follow the site
 * palette and the light/dark switch without a second definition.
 */

/* =========================================================================
   1. Front-end account page
   ====================================================================== */

.wh-account {
	display: grid;
	min-height: calc(100vh - var(--header-height));
	background: var(--background);
}

@media (min-width: 960px) {
	.wh-account {
		grid-template-columns: 1.05fr 1fr;
	}
}

/* ---- Left: the brand panel ---- */

.wh-account__aside {
	position: relative;
	display: none;
	overflow: hidden;
	background: var(--gradient-hero);
	color: var(--navy-foreground);
	padding: 4rem 3rem;
}

@media (min-width: 960px) {
	.wh-account__aside {
		display: flex;
		align-items: center;
	}
}

/* A soft cyan bloom behind the copy, so the panel is not a flat rectangle. */
.wh-account__aside::before {
	content: "";
	position: absolute;
	inset-inline-start: -20%;
	top: -25%;
	width: 75%;
	aspect-ratio: 1;
	border-radius: 9999px;
	background: radial-gradient(circle, color-mix(in oklab, var(--cyan) 45%, transparent), transparent 70%);
	filter: blur(60px);
	pointer-events: none;
}

.wh-account__aside::after {
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(color-mix(in oklab, #fff 8%, transparent) 1px, transparent 1px),
		linear-gradient(90deg, color-mix(in oklab, #fff 8%, transparent) 1px, transparent 1px);
	background-size: 56px 56px;
	mask-image: radial-gradient(circle at 30% 20%, #000, transparent 75%);
	pointer-events: none;
}

.wh-account__aside-inner {
	position: relative;
	z-index: 1;
	max-width: 32rem;
	margin-inline-start: auto;
}

.wh-account__brand {
	display: inline-flex;
	align-items: center;
	gap: 0.625rem;
	color: inherit;
	text-decoration: none;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: 1.0625rem;
	letter-spacing: -0.01em;
}

.wh-account__brand-mark {
	display: grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: var(--radius-md);
	background: var(--gradient-accent);
	color: var(--cyan-foreground);
}

.wh-account__pitch {
	margin-top: 3rem;
	font-family: var(--font-display);
	font-size: clamp(2rem, 3.5vw, 2.875rem);
	line-height: 1.1;
	letter-spacing: -0.03em;
}

.wh-account__intro {
	margin-top: 1.25rem;
	font-size: 1rem;
	line-height: 1.7;
	color: color-mix(in oklab, var(--navy-foreground) 78%, transparent);
}

.wh-account__intro > :last-child {
	margin-bottom: 0;
}

.wh-account__points {
	display: grid;
	gap: 1rem;
	margin-top: 2.5rem;
	padding-top: 2.5rem;
	border-top: 1px solid color-mix(in oklab, #fff 14%, transparent);
}

.wh-account__points li {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	font-size: 0.9375rem;
	line-height: 1.6;
	color: color-mix(in oklab, var(--navy-foreground) 82%, transparent);
}

.wh-account__points .wh-icon {
	flex: none;
	margin-top: 0.125rem;
	color: var(--cyan);
}

.wh-account__back {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 3rem;
	font-size: 0.875rem;
	font-weight: 500;
	color: color-mix(in oklab, var(--navy-foreground) 70%, transparent);
	text-decoration: none;
	transition: color 0.2s ease;
}

.wh-account__back:hover {
	color: var(--cyan);
}

/* ---- Right: the form panel ---- */

.wh-account__panel {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 3rem 1.25rem;
}

@media (min-width: 640px) {
	.wh-account__panel {
		padding: 4rem 2.5rem;
	}
}

.wh-account__card {
	width: 100%;
	max-width: 26rem;
}

.wh-account .wh-form__notice {
	outline: none;
}

/* Tabs */

.wh-account__tabs {
	display: flex;
	gap: 0.25rem;
	padding: 0.3125rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	background: var(--muted);
	margin-bottom: 2rem;
}

.wh-account__tab {
	flex: 1;
	padding: 0.5rem 0.5rem;
	border-radius: var(--radius-sm);
	font-size: 0.8125rem;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	color: var(--muted-foreground);
	transition:
		background 0.2s ease,
		color 0.2s ease,
		box-shadow 0.2s ease;
}

.wh-account__tab:hover {
	color: var(--foreground);
}

.wh-account__tab.is-active {
	background: var(--card);
	color: var(--foreground);
	box-shadow: var(--shadow-card);
}

/* Panels: only the active one is on screen once JS is running. With JS off
   every panel keeps its server-rendered state, and exactly one is active. */
.wh-account__form {
	display: none;
}

.wh-account__form.is-active {
	display: block;
}

.wh-account__form-title {
	font-family: var(--font-display);
	font-size: 1.75rem;
	line-height: 1.15;
	letter-spacing: -0.02em;
}

.wh-account__form-text {
	margin-top: 0.5rem;
	font-size: 0.9375rem;
	line-height: 1.6;
	color: var(--muted-foreground);
}

.wh-account__fields {
	display: grid;
	gap: 1.125rem;
	margin-top: 2rem;
}

.wh-account__field {
	margin: 0;
}

/* Password reveal */

.wh-account__password {
	position: relative;
	display: block;
}

.wh-account__password .wh-input {
	padding-inline-end: 4.25rem;
}

.wh-account__reveal {
	position: absolute;
	inset-inline-end: 0.375rem;
	top: calc(50% + 0.25rem);
	transform: translateY(-50%);
	border: 0;
	border-radius: var(--radius-sm);
	background: transparent;
	padding: 0.375rem 0.5rem;
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--muted-foreground);
	cursor: pointer;
}

.wh-account__reveal:hover {
	color: var(--primary);
	background: var(--muted);
}

/* Row: remember + forgot */

.wh-account__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	font-size: 0.8125rem;
}

.wh-account__remember {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--muted-foreground);
	cursor: pointer;
}

.wh-account__remember input {
	width: 1rem;
	height: 1rem;
	accent-color: var(--primary);
}

.wh-account__link,
.wh-account__switch a,
.wh-account__fallback a {
	color: var(--primary);
	font-weight: 600;
	text-decoration: none;
}

.wh-account__link:hover,
.wh-account__switch a:hover,
.wh-account__fallback a:hover {
	text-decoration: underline;
}

.wh-account__consent {
	font-size: 0.75rem;
	line-height: 1.6;
	color: var(--muted-foreground);
}

.wh-account__consent a {
	color: var(--primary);
}

.wh-account__switch {
	margin-top: 1.5rem;
	font-size: 0.875rem;
	color: var(--muted-foreground);
	text-align: center;
}

.wh-account__fallback {
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--border);
	font-size: 0.75rem;
	text-align: center;
	color: var(--muted-foreground);
}

/* Signed-in panel */

.wh-account__welcome {
	text-align: center;
}

.wh-account__avatar {
	border-radius: 9999px;
	box-shadow: var(--shadow-glow);
}

.wh-account__welcome-title {
	margin-top: 1.25rem;
	font-family: var(--font-display);
	font-size: 1.375rem;
	letter-spacing: -0.02em;
}

.wh-account__welcome-text {
	margin-top: 0.375rem;
	font-size: 0.875rem;
	color: var(--muted-foreground);
}

.wh-account__links {
	display: grid;
	gap: 0.75rem;
	margin-top: 2rem;
}

/* =========================================================================
   2. wp-login.php
   ====================================================================== */

body.login {
	background: var(--background);
	color: var(--foreground);
	font-family: var(--font-sans);
}

body.login::before {
	content: "";
	position: fixed;
	inset-inline-start: 50%;
	top: -30vh;
	width: 90vh;
	height: 90vh;
	transform: translateX(-50%);
	border-radius: 9999px;
	background: radial-gradient(circle, color-mix(in oklab, var(--primary) 22%, transparent), transparent 68%);
	filter: blur(70px);
	pointer-events: none;
	z-index: 0;
}

body.login #login {
	position: relative;
	z-index: 1;
	width: 22.5rem;
	max-width: calc(100vw - 2rem);
	padding: 5vh 0 4rem;
}

/* The core logo is a background image on an <h1><a>; swap it for a wordmark. */
body.login h1 a {
	width: auto;
	height: auto;
	margin: 0 auto 1.5rem;
	padding: 0;
	background: none;
	text-indent: 0;
	overflow: visible;
	display: block;
	font-family: var(--font-display);
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.2;
	color: var(--foreground);
	text-decoration: none;
}

body.login h1 a:hover,
body.login h1 a:focus {
	color: var(--primary);
	box-shadow: none;
}

body.login form {
	border: 1px solid var(--border);
	border-radius: var(--radius-2xl);
	background: var(--card);
	box-shadow: var(--shadow-lift);
	padding: 1.75rem;
	margin-top: 0;
}

body.login label {
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--foreground);
}

body.login input[type="text"],
body.login input[type="password"],
body.login input[type="email"] {
	width: 100%;
	min-height: 2.75rem;
	margin: 0.5rem 0 0;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--input);
	border-radius: var(--radius-md);
	background: var(--background);
	color: var(--foreground);
	font-size: 0.9375rem;
	box-shadow: none;
	transition:
		border-color 0.2s ease,
		box-shadow 0.2s ease;
}

body.login input[type="text"]:focus,
body.login input[type="password"]:focus,
body.login input[type="email"]:focus {
	border-color: var(--ring);
	outline: 2px solid transparent;
	box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 25%, transparent);
}

body.login .button.wp-hide-pw {
	color: var(--muted-foreground);
}

body.login .button.wp-hide-pw:hover {
	color: var(--primary);
}

body.login .button-primary,
body.login #wp-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 2.75rem;
	border: 0;
	border-radius: var(--radius-md);
	background: var(--primary);
	color: var(--primary-foreground);
	font-size: 0.9375rem;
	font-weight: 600;
	text-shadow: none;
	box-shadow: none;
	transition: filter 0.2s ease;
}

body.login .button-primary:hover,
body.login #wp-submit:hover {
	background: var(--primary);
	filter: brightness(1.06);
}

body.login .forgetmenot label {
	font-size: 0.8125rem;
	color: var(--muted-foreground);
}

body.login #nav,
body.login #backtoblog,
body.login .wh-login__back {
	position: relative;
	z-index: 1;
	padding: 0;
	margin: 1.25rem 0 0;
	text-align: center;
	font-size: 0.8125rem;
}

body.login #nav a,
body.login #backtoblog a,
body.login .wh-login__back a {
	color: var(--muted-foreground);
	text-decoration: none;
}

body.login #nav a:hover,
body.login #backtoblog a:hover,
body.login .wh-login__back a:hover {
	color: var(--primary);
}

body.login .message,
body.login .success,
body.login #login_error {
	border-radius: var(--radius-lg);
	border-inline-start-width: 4px;
	background: var(--card);
	color: var(--foreground);
	box-shadow: var(--shadow-card);
	padding: 0.875rem 1rem;
}

body.login .message,
body.login .success {
	border-inline-start-color: var(--primary);
}

body.login #login_error {
	border-inline-start-color: var(--destructive);
}

body.login .privacy-policy-page-link {
	position: relative;
	z-index: 1;
}

body.login .language-switcher {
	position: relative;
	z-index: 1;
}

/* Respect a reduced-motion preference: nothing here animates, but the blurred
   bloom is expensive to repaint, so drop it on low-power requests. */
@media (prefers-reduced-motion: reduce) {
	body.login::before,
	.wh-account__aside::before {
		filter: none;
		opacity: 0.5;
	}
}
