/* =============================================================================
   Auth shell (sauth) — split brand panel + form
   Desktop: 30% brand | 70% form
   Mobile: top brand bar + collapse for theme switch; form full width
   ============================================================================= */

html,
body.sauth-body {
	height: 100%;
	margin: 0;
}

body.sauth-body {
	min-height: 100vh;
	background-color: var(--pb-body-bg, #f5f6f9);
	color: var(--pb-text, #4a5568);
	font-family: var(--bs-font-sans-serif, system-ui, sans-serif);
}

.sauth-shell {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	width: 100%;
	position: relative;
}

/* ---------------------------------------------------------------------------
   Background effects — soft radial glows only (no grid)
   Brand: light spotlight + depth vignette
   Form: brand-tinted corner washes
   --------------------------------------------------------------------------- */

.sauth-brand-panel,
.sauth-mobile-bar {
	/* Brand base + glow only (no grid) */
	background-color: var(--pb-primary, #837dd2);
	background-image:
		radial-gradient(circle 420px at 12% 18%, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0.12) 35%, transparent 70%),
		radial-gradient(circle 380px at 88% 78%, rgba(0, 0, 0, 0.28) 0%, transparent 65%),
		radial-gradient(circle 260px at 70% 25%, rgba(255, 255, 255, 0.18) 0%, transparent 60%),
		linear-gradient(160deg, rgba(255, 255, 255, 0.1) 0%, transparent 45%);
	background-repeat: no-repeat;
}

.sauth-form-panel {
	/* Body base + brand glows from --pb-primary-rgb (follows PilotApps / Amber / any pack) */
	background-color: var(--pb-body-bg, #f5f6f9);
	background-image:
		radial-gradient(circle 480px at 100% 0%, rgba(var(--pb-primary-rgb, 131, 125, 210), 0.28) 0%, transparent 62%),
		radial-gradient(circle 420px at 0% 100%, rgba(var(--pb-primary-rgb, 131, 125, 210), 0.18) 0%, transparent 58%),
		radial-gradient(circle 320px at 60% 50%, rgba(var(--pb-primary-rgb, 131, 125, 210), 0.08) 0%, transparent 55%);
	background-repeat: no-repeat;
}

[data-bs-theme="dark"] .sauth-form-panel {
	background-color: var(--pb-body-bg, #12141c);
	background-image:
		radial-gradient(circle 480px at 100% 0%, rgba(var(--pb-primary-rgb, 155, 149, 224), 0.32) 0%, transparent 62%),
		radial-gradient(circle 420px at 0% 100%, rgba(var(--pb-primary-rgb, 155, 149, 224), 0.22) 0%, transparent 58%),
		radial-gradient(circle 320px at 60% 50%, rgba(var(--pb-primary-rgb, 155, 149, 224), 0.1) 0%, transparent 55%);
	background-repeat: no-repeat;
}

/* ---------------------------------------------------------------------------
   Mobile top brand bar
   --------------------------------------------------------------------------- */

.sauth-mobile-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.65rem 1rem;
	color: #ffffff;
	position: sticky;
	top: 0;
	z-index: 1030;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
}

.sauth-mobile-bar .sauth-brand-inline {
	display: inline-flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0.55rem;
	text-decoration: none;
	color: #ffffff !important;
	min-width: 0;
	flex: 1 1 auto;
	max-width: calc(100% - 3rem);
}

.sauth-mobile-bar .sauth-brand-inline img {
	width: 36px;
	height: 36px;
	object-fit: contain;
	background: rgba(255, 255, 255, 0.18);
	border-radius: 50%;
	padding: 4px;
	flex: 0 0 auto;
}

.sauth-mobile-bar .sauth-brand-name {
	font-size: 1.35rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	white-space: nowrap;
	line-height: 1.2;
	flex: 0 1 auto;
}

.sauth-mobile-bar .sauth-bar-toggler {
	border: 1px solid rgba(255, 255, 255, 0.45);
	border-radius: var(--pb-radius-sm, 4px);
	background: rgba(255, 255, 255, 0.12);
	color: #ffffff;
	padding: 0.35rem 0.55rem;
	line-height: 1;
	flex: 0 0 auto;
}

.sauth-mobile-bar .sauth-bar-toggler:focus {
	outline: 0;
	box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
}

.sauth-mobile-bar .sauth-bar-toggler .navbar-toggler-icon {
	width: 1.15em;
	height: 1.15em;
	display: inline-block;
	vertical-align: middle;
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 100%;
}

.sauth-mobile-tools {
	flex: 1 0 100%;
	padding: 0.65rem 0 0.25rem;
	border-top: 1px solid rgba(255, 255, 255, 0.22);
	margin-top: 0.35rem;
}

.sauth-mobile-tools .pb-theme-switch-root,
.sauth-mobile-tools .pb-theme-switch {
	color: #ffffff;
}

.sauth-mobile-tools .pb-theme-switch-label,
.sauth-mobile-tools .pb-theme-toggle-label,
.sauth-mobile-tools .pb-theme-toggle-icon {
	color: #ffffff !important;
}

.sauth-mobile-tools .form-check-input {
	border-color: rgba(255, 255, 255, 0.55);
	background-color: rgba(255, 255, 255, 0.2);
}

.sauth-mobile-tools .form-check-input:checked {
	background-color: #ffffff;
	border-color: #ffffff;
}

/* ---------------------------------------------------------------------------
   Desktop brand panel (30%) — full-width link, logo + title one line
   --------------------------------------------------------------------------- */

.sauth-brand-panel {
	display: none;
	flex-direction: column;
	justify-content: center; /* vertical center of panel */
	align-items: center; /* horizontal center of panel */
	padding: 3rem 1.5rem;
	color: #ffffff;
	min-height: 100vh;
	box-sizing: border-box;
	width: 100%;
}

/*
  Anchor wraps lockup; size to content and sit in the panel center.
*/
.sauth-brand-panel > .sauth-brand-link,
.sauth-brand-panel a.sauth-brand-link {
	display: block !important;
	width: auto !important;
	max-width: 100% !important;
	align-self: center !important;
	box-sizing: border-box !important;
	margin: 0 auto !important;
	padding: 0 !important;
	text-decoration: none !important;
	color: #ffffff !important;
	text-align: center;
}

/* Inner lockup: horizontal logo + title, centered as a unit */
.sauth-brand-panel .sauth-brand-lockup {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 1.15rem;
	width: auto !important;
	max-width: 100% !important;
	box-sizing: border-box !important;
	margin: 0 auto;
}

.sauth-brand-panel .sauth-brand-lockup > img {
	width: 48px;
	height: 48px;
	object-fit: contain;
	background: rgba(255, 255, 255, 0.18);
	border-radius: 50%;
	padding: 7px;
	flex: 0 0 48px !important;
	display: block;
	margin: 0 !important;
	vertical-align: middle;
}

.sauth-brand-panel .sauth-brand-name {
	display: flex !important;
	align-items: center !important;
	font-size: clamp(1.65rem, 2.2vw + 0.85rem, 2.45rem);
	font-weight: 600;
	line-height: 1 !important;
	height: 48px; /* match logo box for true optical middle */
	letter-spacing: 0.01em;
	white-space: nowrap !important;
	flex: 0 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	color: #ffffff !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* Theme switch spacing on auth form toolbar + mobile collapse */
.sauth-form-toolbar .pb-theme-switch-root,
.sauth-mobile-tools .pb-theme-switch-root {
	padding: 0.25rem 0;
}

.sauth-form-toolbar .pb-theme-switch,
.sauth-mobile-tools .pb-theme-switch {
	display: inline-flex !important;
	align-items: center !important;
	gap: 0.7rem !important;
}

.sauth-form-toolbar .pb-theme-switch-label,
.sauth-mobile-tools .pb-theme-switch-label {
	display: inline-flex !important;
	align-items: center !important;
	gap: 0.5rem !important;
	margin: 0 !important;
	line-height: 1 !important;
}

.sauth-form-toolbar .form-check-input,
.sauth-mobile-tools .form-check-input {
	margin: 0 !important;
	float: none !important;
	position: relative !important;
}

/* ---------------------------------------------------------------------------
   Form panel
   --------------------------------------------------------------------------- */

.sauth-form-panel {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	min-width: 0;
	color: var(--pb-text, #4a5568);
}

.sauth-form-toolbar {
	display: none;
	justify-content: flex-end;
	align-items: center;
	padding: 1rem 1.5rem 0;
}

.sauth-form-inner {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	padding: 1.5rem 1.25rem 2.5rem;
	width: 100%;
}

.sauth-form-inner .sauth-card-stack {
	width: 100%;
	max-width: 26rem;
}

.sauth-form-inner .card {
	background-color: var(--pb-surface, #ffffff);
	border: 1px solid var(--pb-border, #e4e6ef);
	border-radius: var(--pb-radius-lg, 10px);
	box-shadow:
		var(--pb-shadow-md, 0 4px 12px rgba(26, 32, 44, 0.08)),
		0 12px 40px rgba(131, 125, 210, 0.08);
	color: var(--pb-text, #4a5568);
}

[data-bs-theme="dark"] .sauth-form-inner .card {
	box-shadow:
		var(--pb-shadow-md, 0 4px 16px rgba(0, 0, 0, 0.45)),
		0 12px 40px rgba(0, 0, 0, 0.25);
}

.sauth-form-inner .card .card-body {
	padding: 1.75rem 1.5rem;
}

.sauth-form-inner .card h3 {
	color: var(--pb-heading, #1a202c);
}

.sauth-form-inner .card .form-label {
	color: var(--pb-text-strong, #1a202c);
}

.sauth-form-inner .card .form-control {
	background-color: var(--pb-input-bg, #ffffff);
	border-color: var(--pb-input-border, #e4e6ef);
	color: var(--pb-text, #4a5568);
}

.sauth-form-inner .card .form-control:focus {
	border-color: var(--pb-input-focus-border, var(--pb-primary));
	box-shadow: 0 0 0 0.2rem var(--pb-primary-focus, rgba(131, 125, 210, 0.28));
	background-color: var(--pb-input-bg, #ffffff);
	color: var(--pb-text, #4a5568);
}

.sauth-form-inner .card a {
	color: var(--pb-link, var(--pb-primary));
}

.sauth-form-inner .card a:hover {
	color: var(--pb-link-hover, var(--pb-primary-hover));
}

.sauth-form-inner .btn-sauth-secondary {
	color: var(--pb-text-strong) !important;
	background-color: var(--pb-surface-muted) !important;
	border: 1px solid var(--pb-border) !important;
}

.sauth-form-inner .btn-sauth-secondary:hover {
	background-color: var(--pb-hover-bg) !important;
	border-color: var(--pb-border-strong) !important;
	color: var(--pb-text-strong) !important;
}

.sauth-form-inner .btn-sauth-secondary img {
	width: 1.1rem;
	height: 1.1rem;
	vertical-align: -0.15em;
}

.sauth-form-toolbar .pb-theme-switch-root {
	color: var(--pb-text);
}

.sauth-form-toolbar .pb-theme-switch {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

/* ---------------------------------------------------------------------------
   Desktop layout: 30 / 70
   --------------------------------------------------------------------------- */

@media (min-width: 768px) {
	.sauth-shell {
		flex-direction: row;
		align-items: stretch;
	}

	.sauth-mobile-bar {
		display: none !important;
	}

	.sauth-brand-panel {
		display: flex;
		flex: 0 0 30%;
		width: 30%;
		max-width: 30%;
	}

	.sauth-form-panel {
		flex: 1 1 70%;
		width: 70%;
		max-width: 70%;
		min-height: 100vh;
	}

	.sauth-form-toolbar {
		display: flex;
	}

	.sauth-form-inner {
		padding: 2rem 2.5rem 3rem;
	}
}

@media (min-width: 1200px) {
	.sauth-brand-panel {
		padding: 3.5rem 2rem;
	}

	.sauth-brand-panel .sauth-brand-lockup > img {
		width: 56px;
		height: 56px;
		padding: 8px;
		flex-basis: 56px !important;
	}

	.sauth-brand-panel .sauth-brand-name {
		font-size: clamp(1.9rem, 2vw + 0.9rem, 2.65rem);
	}

	.sauth-form-inner .sauth-card-stack {
		max-width: 28rem;
	}
}
