/* ==========================================================================
   Auth pages — login, signup, forgot password, reset password.

   Split-screen shell: photo on the left, form panel on the right, stacking to
   a banner + form on narrow screens. Shared by all four pages so they read as
   one flow; each page only supplies its own copy and fields.

   These pages no longer load Bootstrap, so the few Bootstrap classes the
   inline JS still toggles (.hide/.show, .alert-*, .text-*) are defined here.
   Keep them — authenticate_login.php responses drive them.

   Type stack matches nav_include_2.php (Inter, then system) so the admin and
   the door into it feel like the same product. No webfont request.
   ========================================================================== */

:root {
	--auth-ink:      #101828;
	--auth-muted:    #667085;
	--auth-faint:    #98a2b3;
	--auth-line:     #e4e7ec;
	--auth-accent:   #5369f8;   /* same indigo as the admin nav */
	--auth-danger:   #b42318;
	--auth-radius:   10px;
}

html, body { height: 100%; }

body.auth-body {
	margin: 0;
	background: #fff;
	color: var(--auth-ink);
	font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
	             "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	font-size: 15px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* ---------- shell ---------- */

.auth-shell {
	display: flex;
	min-height: 100vh;
	min-height: 100dvh;
}

/* Photo half. The skyline sits along the bottom edge of bg.jpg, so anchor the
   background there — centering crops the buildings out on tall viewports. */
.auth-visual {
	position: relative;
	flex: 1 1 52%;
	background-color: #d7e3ee;
	background-position: center bottom;
	background-size: cover;
	background-repeat: no-repeat;
	overflow: hidden;
}

/* Scrim: the photo is a pale sky, so white type needs its own darkness. */
.auth-visual::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(16,24,40,0) 45%, rgba(16,24,40,.78) 100%);
}

.auth-visual__brand {
	position: absolute;
	z-index: 1;
	left: 48px;
	right: 48px;
	bottom: 44px;
	color: #fff;
}

.auth-visual__mark {
	display: block;
	font-size: 30px;
	font-weight: 650;
	letter-spacing: -.025em;
	margin: 0 0 6px;
}

.auth-visual__tagline {
	margin: 0;
	font-size: 15px;
	line-height: 1.45;
	color: rgba(255,255,255,.82);
	max-width: 30ch;
}

/* Form half. */
.auth-panel {
	flex: 1 1 48%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 56px 40px;
	background: #fff;
}

.auth-card {
	width: 100%;
	max-width: 360px;
}

.auth-logo {
	display: block;
	width: 38px;
	height: 38px;
	margin-bottom: 26px;
}

.auth-title {
	margin: 0 0 6px;
	font-size: 26px;
	font-weight: 650;
	letter-spacing: -.02em;
	line-height: 1.25;
}

.auth-sub {
	margin: 0 0 26px;
	font-size: 14.5px;
	color: var(--auth-muted);
}

/* ---------- fields ---------- */

.auth-field { margin-bottom: 16px; }

.auth-label,
.auth-label-row {
	display: block;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 7px;
}

.auth-label-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
}

/* Scoped to inputs: the submit buttons also carry .form-control (the inline JS
   re-enables them with $('.form-control').removeAttr('disabled')), so a bare
   .form-control rule would restyle the button too. */
input.form-control {
	display: block;
	width: 100%;
	height: 46px;
	padding: 0 14px;
	font: inherit;
	font-size: 15px;
	color: var(--auth-ink);
	background: #fff;
	border: 1px solid var(--auth-line);
	border-radius: var(--auth-radius);
	box-sizing: border-box;
	transition: border-color .15s ease, box-shadow .15s ease;
}

input.form-control::placeholder { color: var(--auth-faint); }

input.form-control:focus {
	outline: none;
	border-color: var(--auth-accent);
	box-shadow: 0 0 0 3.5px rgba(83,105,248,.14);
}

input.form-control[disabled] {
	background: #f9fafb;
	color: var(--auth-faint);
}

.auth-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

/* Password field with a show/hide control. */
.auth-pw { position: relative; }
.auth-pw input.form-control { padding-right: 44px; }

/* Anchored to the input's own centre (46px tall), not the wrapper's — a
   jquery.validate error label lands inside .auth-pw and would otherwise drag
   the toggle down with it. */
.auth-pw-toggle {
	position: absolute;
	top: 23px;
	right: 8px;
	transform: translateY(-50%);
	display: flex;
	padding: 7px;
	background: none;
	border: 0;
	border-radius: 6px;
	color: var(--auth-faint);
	cursor: pointer;
}
.auth-pw-toggle:hover  { color: var(--auth-muted); }
.auth-pw-toggle:focus-visible {
	outline: 2px solid var(--auth-accent);
	outline-offset: 1px;
}

/* ---------- button ---------- */

.auth-btn {
	display: block;
	width: 100%;
	height: 46px;
	margin-top: 22px;
	padding: 0 16px;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	background: var(--auth-ink);
	border: 0;
	border-radius: var(--auth-radius);
	cursor: pointer;
	transition: background .15s ease, opacity .15s ease;
}

.auth-btn:hover:not([disabled]) { background: #000; }
.auth-btn:active:not([disabled]) { transform: translateY(1px); }
.auth-btn:focus-visible {
	outline: 2px solid var(--auth-accent);
	outline-offset: 2px;
}
.auth-btn[disabled] { opacity: .55; cursor: progress; }

/* ---------- links & fine print ---------- */

.auth-link {
	color: var(--auth-accent);
	font-weight: 500;
	text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }

.auth-label-row .auth-link { font-size: 12.5px; font-weight: 500; }

.auth-alt {
	margin: 22px 0 0;
	font-size: 14px;
	color: var(--auth-muted);
	text-align: center;
}

.auth-fine {
	margin: 26px 0 0;
	padding-top: 18px;
	border-top: 1px solid var(--auth-line);
	font-size: 12px;
	line-height: 1.55;
	color: var(--auth-faint);
	text-align: center;
}

.auth-note {
	margin: 0 0 16px;
	font-size: 13px;
	color: var(--auth-muted);
}

/* ---------- status message + validation ----------
   Class names kept from Bootstrap because the page JS toggles them. */

.alert {
	margin: 0 0 18px;
	padding: 12px 14px;
	font-size: 13.5px;
	line-height: 1.5;
	border: 1px solid transparent;
	border-radius: var(--auth-radius);
	text-align: left;
}
.alert-danger  { background: #fef3f2; border-color: #fecdca; color: var(--auth-danger); }
.alert-success { background: #ecfdf3; border-color: #abefc6; color: #067647; }
.alert a { color: inherit; text-decoration: underline; }

.hide { display: none !important; }
.show { display: block !important; }
.text-left   { text-align: left !important; }
.text-center { text-align: center !important; }

/* jquery.validate injects these after the offending input. */
label.error {
	display: block;
	margin: 7px 0 0;
	font-size: 12.5px;
	font-weight: 500;
	color: var(--auth-danger);
}
input.form-control.error { border-color: #f97066; }

/* ---------- narrow screens ---------- */

@media (max-width: 900px) {
	.auth-shell { flex-direction: column; }

	.auth-visual {
		flex: 0 0 172px;
		min-height: 172px;
	}
	.auth-visual::after {
		background: linear-gradient(180deg, rgba(16,24,40,0) 30%, rgba(16,24,40,.72) 100%);
	}
	.auth-visual__brand { left: 24px; right: 24px; bottom: 20px; }
	.auth-visual__mark  { font-size: 24px; margin-bottom: 3px; }
	.auth-visual__tagline { font-size: 13.5px; }

	.auth-panel {
		flex: 1 1 auto;
		align-items: flex-start;
		padding: 34px 22px 48px;
	}
	.auth-card { max-width: 420px; margin: 0 auto; }
	.auth-logo { display: none; }
	.auth-title { font-size: 23px; }

	/* 16px minimum: iOS Safari zooms the whole page in when a focused field is
	   smaller than that, and the signup/recover/reset pages allow scaling. */
	input.form-control { font-size: 16px; }
}

@media (max-width: 420px) {
	.auth-row { grid-template-columns: 1fr; gap: 0; }
	.auth-row .auth-field { margin-bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
	.auth-btn, input.form-control { transition: none; }
	.auth-btn:active:not([disabled]) { transform: none; }
}
