/* =====================================================================
   Public auth pages — login, registration, register, password-reset,
   newpassword (the last four @import this file).
   Aesthetic: "Aurora Minimal" — near-black canvas, two slow drifting
   colour glows, a glassmorphism card with a light edge, Bricolage
   Grotesque display type over Montserrat, staggered entrance, a
   gradient CTA. Modern, minimal, with atmosphere.

   Colours/fonts come from the shared tokens in theme.css (loaded first
   on every page). Aurora glow + glassmorphism below stay auth-only. */
/* ===================================================================== */

body{
	background: var(--bg) !important;
	color: var(--text);
	font-family: 'Montserrat', system-ui, -apple-system, sans-serif;
	min-height: 100vh;
	overflow-x: hidden;
}

/* --- Ambient aurora: two soft glows drifting independently --- */
body::before,
body::after{
	content: "";
	position: fixed;
	z-index: 0;
	border-radius: 50%;
	filter: blur(90px);
	pointer-events: none;
	will-change: transform;
}

body::before{
	width: 60vw;
	height: 60vw;
	top: -18vw;
	left: -12vw;
	background: radial-gradient(circle at center, rgba(46,160,255,0.10), rgba(46,160,255,0) 70%);
	animation: auroraA 24s ease-in-out infinite alternate;
}

body::after{
	width: 54vw;
	height: 54vw;
	bottom: -20vw;
	right: -14vw;
	background: radial-gradient(circle at center, rgba(123,108,255,0.09), rgba(123,108,255,0) 70%);
	animation: auroraB 30s ease-in-out infinite alternate;
}

/* The page outputs two siblings inside <main>: the brand half (#firsthalf)
   and the form half (#secondhalf), in page-dependent DOM order. Explicit
   flex `order` puts the brand on top and the card below, regardless. */
main{
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	padding: 32px 18px 40px;
	box-sizing: border-box;
}

/* faint dot-grid texture for depth, above the aurora, below the content */
main::before{
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	background-image: radial-gradient(rgba(255,255,255,0.025) 1px, transparent 1px);
	background-size: 26px 26px;
	mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 30%, transparent 100%);
	-webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 30%, transparent 100%);
	pointer-events: none;
}

/* Neutralise the old split-screen layout + inline theme backgrounds */
.half,
#firsthalf,
#secondhalf{
	position: relative;
	z-index: 1;
	float: none !important;
	width: 100% !important;
	height: auto !important;
	min-height: 0 !important;
	padding: 0 !important;
	background: none !important;
	background-color: transparent !important;
	background-image: none !important;
	display: flex;
	justify-content: center;
}

#firsthalf{ order: 0; margin-bottom: 16px; }   /* brand on top */
#secondhalf{ order: 1; }                        /* card below   */

/* ----------------------------- Brand ----------------------------- */
.brand-container{
	text-align: center;
	animation: dropIn .7s cubic-bezier(.2,.7,.2,1) both;
}

.brand-logo{
	display: inline-block !important;
	width: 56px;
	max-width: 56px;
	height: auto;
	margin-bottom: 10px;
	filter: drop-shadow(0 0 16px rgba(143,210,255,0.22));
	animation: float 6s ease-in-out infinite;
}

.brand-title{
	margin: 0;
	font-family: 'Bricolage Grotesque', 'Montserrat', sans-serif;
	font-weight: 600;
	font-size: 1.15rem;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: rgba(245,247,252,0.72);
	text-shadow: none;
}

/* ------------------------------ Card ----------------------------- */
.login-container{
	width: 100%;
	max-width: 430px;
	margin: 0 !important;
	animation: riseIn .8s cubic-bezier(.2,.7,.2,1) .1s both;
}

.login-box{
	position: relative;
	width: 100%;
	max-width: 430px;
	margin: auto;
	padding: 32px 28px 26px;
	border-radius: var(--radius-card);
	background: var(--surface);
	border: 1px solid var(--border);
	box-shadow: var(--shadow-card);
}

/* Title */
.login-box h3{
	margin: 0;
	font-family: 'Bricolage Grotesque', 'Montserrat', sans-serif;
	font-weight: 700;
	font-size: 2rem;
	letter-spacing: -0.01em;
	color: #fff;
}

.login-box h3::after{
	content: "";
	display: block;
	width: 46px;
	height: 3px;
	margin: 14px auto 0;
	border-radius: 3px;
	background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

#title-row{ margin-bottom: 18px; }

/* Helper / message / info paragraphs */
.login-box p{
	color: var(--muted);
	line-height: 1.65;
}

/* ----------------------------- Inputs ---------------------------- */
.login-box .input-field{ margin-top: 8px; }

.login-box input:not([type=checkbox]){
	font-size: 16px !important;
	color: #fff !important;
	border-bottom: 1px solid var(--border-soft) !important;
	box-shadow: none !important;
	transition: border-color .2s ease, box-shadow .2s ease;
}

.login-box input:not([type=checkbox]):focus{
	border-bottom: 1px solid var(--accent) !important;
	box-shadow: 0 1px 0 0 var(--accent), 0 10px 30px -16px rgba(143,210,255,0.5) !important;
}

.login-box .input-field label{
	color: var(--muted);
	font-size: 0.95rem;
	letter-spacing: .01em;
}

.login-box .input-field label.active{ color: var(--accent) !important; }

/* kill the ugly browser autofill colour on dark glass */
.login-box input:-webkit-autofill,
.login-box input:-webkit-autofill:hover,
.login-box input:-webkit-autofill:focus{
	-webkit-text-fill-color: #fff;
	-webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
	caret-color: #fff;
	transition: background-color 9999s ease-in-out 0s;
}

/* -------------------------- Primary CTA -------------------------- */
.login-box .btn{
	height: 52px;
	line-height: 52px;
	border-radius: 999px;
	font-family: 'Montserrat', sans-serif;
	font-weight: 600;
	font-size: 1rem;
	letter-spacing: .02em;
	text-transform: none;
	color: #fff !important;
	background: linear-gradient(135deg, #3aa0ff 0%, #7b6cff 100%) !important;
	box-shadow: 0 14px 36px -14px rgba(91,108,255,0.65);
	transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.login-box .btn:hover{
	transform: translateY(-2px);
	filter: brightness(1.06);
	box-shadow: 0 20px 48px -14px rgba(91,108,255,0.8);
}

.login-box .btn:active{ transform: translateY(0); }

/* ------------------------ Secondary links ------------------------ */
.login-box a:not(.btn){
	color: var(--muted);
	font-weight: 500;
	text-decoration: none;
	transition: color .15s ease;
}

.login-box a:not(.btn):hover{ color: var(--accent); }

/* Error message */
.login-box #errors,
#errors.red-text{ color: #ff8a8a !important; display: inline-block; }

/* Legal-text / consent checkboxes */
.login-box [type=checkbox] + span{ color: #cfd6e4; }

.no-bottom-margin{ margin-bottom: 0; }

/* ---------------------------- Keyframes -------------------------- */
@keyframes auroraA{
	0%   { transform: translate(0, 0) scale(1); }
	100% { transform: translate(10vw, 8vh) scale(1.2); }
}
@keyframes auroraB{
	0%   { transform: translate(0, 0) scale(1.05); }
	100% { transform: translate(-9vw, -7vh) scale(1.25); }
}
@keyframes float{
	0%, 100% { transform: translateY(0); }
	50%      { transform: translateY(-7px); }
}
@keyframes dropIn{
	from { opacity: 0; transform: translateY(-16px); }
	to   { opacity: 1; transform: translateY(0); }
}
@keyframes riseIn{
	from { opacity: 0; transform: translateY(22px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------- Responsive -------------------------- */
@media (max-width: 600px){
	main{ padding: 28px 14px 44px; }

	.login-box{
		padding: 26px 20px 22px;
		border-radius: var(--radius-card);
	}

	.login-box h3{ font-size: 1.7rem; }
	.brand-logo{ width: 50px; max-width: 50px; }
}

/* respect users who prefer no motion */
@media (prefers-reduced-motion: reduce){
	body::before,
	body::after,
	.brand-logo,
	.brand-container,
	.login-container{
		animation: none !important;
	}
}
