/**
 * JASET auth flows: register + login. Plugin palette only (navy, purple, yellow, greys).
 */

:root {
	--jase-auth-ink: #0a0f26;
	--jase-auth-purple: #5d2689;
	--jase-auth-purple-dark: #4a1f6e;
	--jase-auth-yellow: #e0b429;
	--jase-auth-gold-light: #ecc95a;
	--jase-auth-muted: #676767;
	--jase-auth-border: #dddddd;
	--jase-auth-paper: #f7f7f7;
	--jase-auth-white: #ffffff;
}

/* ——— Shell ——— */
body.jase-auth-page {
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	overflow-x: hidden;
}

body.jase-auth-page .jase-auth-shell {
	flex: 1 1 auto;
	min-height: 0;
}

body.jase-auth-page .jase-auth-footnote {
	flex-shrink: 0;
}

.jase-reg,
.jase-login {
	min-height: 100%;
	background: var(--jase-auth-paper);
}

.jase-auth-shell.jase-login {
	background: var(--jase-auth-white);
}

@media (min-width: 900px) {
	.jase-auth-shell.jase-login {
		background: var(--jase-auth-paper);
	}
}

/* Split grid */
.jase-reg-split {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

@media (min-width: 900px) {
	.jase-reg-split {
		display: grid;
		grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
		align-items: stretch;
		height: 100%;
		min-height: 0;
	}

	body.jase-auth-page--register .jase-reg-split,
	body.jase-auth-page--login .jase-reg-split {
		min-height: calc(100dvh - 2.75rem);
	}
}

/* Brand column — dark editorial panel */
.jase-reg-split__brand {
	flex: 0 0 auto;
	background: var(--jase-auth-ink);
	color: var(--jase-auth-white);
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

@media (min-width: 900px) {
	.jase-reg-split__brand {
		min-height: 0;
	}
}

.jase-reg-split__brand::after {
	content: "";
	position: absolute;
	inset: 0;
	background:
		radial-gradient(ellipse 70% 55% at 18% 12%, rgba(93, 38, 137, 0.28) 0%, transparent 58%),
		radial-gradient(ellipse 50% 40% at 88% 78%, rgba(255, 217, 61, 0.07) 0%, transparent 52%);
	pointer-events: none;
}

.jase-reg-split__watermark {
	position: absolute;
	right: -8%;
	bottom: -6%;
	width: min(72vw, 420px);
	height: min(72vw, 420px);
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	opacity: 0.07;
	filter: grayscale(1) brightness(1.6);
	pointer-events: none;
	z-index: 0;
}

.jase-reg-split__back {
	position: relative;
	z-index: 2;
	align-self: flex-start;
	margin: 1.15rem 1.15rem 0;
	padding: 0.45rem 0.75rem;
	color: rgba(255, 255, 255, 0.88);
	text-decoration: none;
	font-size: 0.88rem;
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.14);
	background: rgba(255, 255, 255, 0.04);
	transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.jase-reg-split__back:hover,
.jase-reg-split__back:focus-visible {
	color: var(--jase-auth-white);
	background: rgba(93, 38, 137, 0.35);
	border-color: rgba(255, 255, 255, 0.28);
}

.jase-reg-split__back-arrow {
	opacity: 0.9;
}

.jase-reg-split__brand-inner {
	position: relative;
	z-index: 1;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: clamp(2rem, 5vw, 3rem) clamp(1.5rem, 4vw, 2.5rem) clamp(2.5rem, 6vw, 4rem);
	max-width: 380px;
	margin: 0 auto;
}

.jase-reg-split__logo-wrap {
	margin-bottom: 1.5rem;
}

.jase-reg-split__logo {
	display: block;
	width: min(56vw, 200px);
	height: auto;
	filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.35));
}

.jase-reg-split__title {
	margin: 0;
	font-family: "Literata", Georgia, serif;
	font-size: clamp(2rem, 5vw, 2.75rem);
	font-weight: 600;
	letter-spacing: 0.06em;
	color: var(--jase-auth-white);
	line-height: 1;
}

.jase-reg-split__dept {
	margin: 0.75rem 0 0;
	font-size: 0.95rem;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.62);
	line-height: 1.45;
}

.jase-reg-split__main {
	flex: 1 1 auto;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: clamp(1.5rem, 4vw, 3rem) 1.25rem 3rem;
}

@media (min-width: 900px) {
	.jase-reg-split__main {
		align-items: center;
		box-sizing: border-box;
	}
}

.jase-reg-panel {
	width: 100%;
	max-width: 480px;
	background: var(--jase-auth-white);
	border-radius: 20px;
	padding: clamp(1.5rem, 4vw, 2.25rem);
	box-shadow: 0 24px 80px rgba(10, 15, 38, 0.08);
	border: 1px solid rgba(10, 15, 38, 0.06);
}

.jase-reg-panel__title {
	margin: 0 0 0.35rem;
	font-family: "Literata", Georgia, serif;
	font-size: clamp(1.75rem, 3vw, 2.1rem);
	font-weight: 600;
	color: var(--jase-auth-ink);
	letter-spacing: -0.02em;
}

.jase-reg-panel__lead {
	margin: 0 0 1.75rem;
	color: var(--jase-auth-muted);
	font-size: 0.98rem;
	line-height: 1.55;
}

/* Register role cards */
.jase-reg-rolefield {
	display: block;
	margin-bottom: 1.25rem;
}

.jase-reg-rolefield__label {
	display: block;
	font-size: 0.8rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--jase-auth-ink);
	margin-bottom: 0.65rem;
}

.jase-reg-rolegrid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
}

.jase-reg-role {
	position: relative;
	display: block;
	cursor: pointer;
	margin: 0;
}

.jase-reg-role__input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	pointer-events: none;
}

.jase-reg-role__card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.35rem;
	min-height: 120px;
	padding: 1rem 0.9rem;
	border-radius: 14px;
	border: 2px solid var(--jase-auth-border);
	background: var(--jase-auth-paper);
	transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.jase-reg-role__input:focus-visible + .jase-reg-role__card {
	outline: 2px solid var(--jase-auth-purple);
	outline-offset: 2px;
}

.jase-reg-role__input:checked + .jase-reg-role__card {
	border-color: var(--jase-auth-purple);
	background: var(--jase-auth-purple);
	color: var(--jase-auth-white);
	box-shadow: 0 12px 32px rgba(93, 38, 137, 0.28);
	transform: translateY(-2px);
}

.jase-reg-role__icon {
	color: var(--jase-auth-purple);
}

.jase-reg-role__input:checked + .jase-reg-role__card .jase-reg-role__icon {
	color: var(--jase-auth-yellow);
}

.jase-reg-role__name {
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.jase-reg-role__hint {
	font-size: 0.8rem;
	line-height: 1.4;
	opacity: 0.85;
}

.jase-reg-role__input:checked + .jase-reg-role__card .jase-reg-role__hint {
	opacity: 0.95;
}

.jase-reg-submit {
	width: 100%;
	justify-content: center;
	min-height: 48px;
	border-radius: 12px;
	margin-top: 0.25rem;
}

.jase-reg-altlinks {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.25rem;
	justify-content: space-between;
	font-size: 0.9rem;
}

.jase-reg-altlinks a {
	color: var(--jase-auth-purple);
	font-weight: 600;
}

/* Register form density — plugin fields */
.jase-reg-form .form-group-wrap .form-group {
	margin-bottom: 0.65rem;
}

.jase-reg-form .form-control {
	min-height: 42px !important;
	font-size: 0.95rem !important;
}

.jase-reg-form .sj-placeholder span {
	font-size: 0.88rem;
}

.jase-reg-namegrid {
	display: grid;
	gap: 0.65rem;
}

@media (min-width: 520px) {
	.jase-reg-namegrid {
		grid-template-columns: 1fr 1fr;
	}
}

.jase-reg-form .sj-signup-check {
	margin: 0.35rem 0 0;
	font-size: 0.85rem;
	line-height: 1.45;
}

.jase-reg-form .sj-signup-check label {
	align-items: flex-start;
}

/* Desktop: fit register panel in one viewport */
@media (min-width: 900px) {
	body.jase-auth-page--register {
		overflow: hidden;
	}

	body.jase-auth-page--register .jase-auth-footnote {
		padding: 0.45rem 1rem;
		font-size: 0.72rem;
	}

	.jase-reg-split__brand-inner {
		padding: 1rem 1.5rem 1.5rem;
	}

	.jase-reg-split__logo-wrap {
		margin-bottom: 1rem;
	}

	.jase-reg-split__logo {
		width: min(140px, 16vh);
	}

	.jase-reg-split__title {
		font-size: clamp(1.65rem, 3.2vh, 2.25rem);
	}

	.jase-reg-split__dept {
		margin-top: 0.45rem;
		font-size: 0.88rem;
	}

	.jase-reg-split__back {
		margin: 0.85rem 0 0 0.85rem;
	}

	.jase-reg-split__main {
		align-items: center;
		padding: 0.75rem 1.25rem;
		overflow-y: auto;
	}

	.jase-reg-panel {
		max-width: 520px;
		padding: 1.35rem 1.5rem 1.15rem;
		border-radius: 16px;
	}

	.jase-reg-panel__title {
		font-size: 1.55rem;
		margin-bottom: 0.2rem;
	}

	.jase-reg-panel__lead {
		margin-bottom: 1rem;
		font-size: 0.9rem;
		line-height: 1.45;
	}

	.jase-reg-rolefield {
		margin-bottom: 0.85rem;
	}

	.jase-reg-rolefield__label {
		margin-bottom: 0.45rem;
		font-size: 0.72rem;
	}

	.jase-reg-rolegrid {
		gap: 0.55rem;
	}

	.jase-reg-role__card {
		min-height: 0;
		padding: 0.65rem 0.7rem;
		gap: 0.2rem;
		border-radius: 12px;
	}

	.jase-reg-role__icon svg {
		width: 22px;
		height: 22px;
	}

	.jase-reg-role__name {
		font-size: 0.92rem;
	}

	.jase-reg-role__hint {
		font-size: 0.72rem;
		line-height: 1.35;
	}

	.jase-reg-form .form-group-wrap .form-group {
		margin-bottom: 0.5rem;
	}

	.jase-reg-submit {
		min-height: 44px;
		margin-top: 0.15rem;
	}

	.jase-reg-altlinks {
		margin-top: 0.15rem;
		font-size: 0.82rem;
		gap: 0.5rem 1rem;
	}
}

@media (min-width: 900px) and (max-height: 760px) {
	.jase-reg-split__logo {
		width: min(110px, 14vh);
	}

	.jase-reg-split__logo-wrap {
		margin-bottom: 0.65rem;
	}

	.jase-reg-panel {
		padding: 1rem 1.25rem 0.85rem;
	}

	.jase-reg-panel__lead {
		margin-bottom: 0.75rem;
	}

	.jase-reg-role__hint {
		display: none;
	}

	.jase-reg-role__card {
		padding: 0.55rem 0.65rem;
	}
}

/* Login form */
.jase-auth-login-lead {
	margin-bottom: 1.5rem;
}

.jase-auth-login-form fieldset {
	border: 0;
	margin: 0;
	padding: 0;
}

.jase-auth-field {
	margin-bottom: 1.15rem;
}

.jase-auth-field--submit {
	margin-top: 1.5rem;
	margin-bottom: 0.5rem;
}

.jase-auth-label {
	display: block;
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--jase-auth-ink);
	margin-bottom: 0.4rem;
}

.jase-auth-label-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.4rem;
}

.jase-auth-label-row .jase-auth-label {
	margin-bottom: 0;
}

.jase-auth-link-forgot {
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--jase-auth-purple);
	text-decoration: none;
	white-space: nowrap;
}

.jase-auth-link-forgot:hover,
.jase-auth-link-forgot:focus-visible {
	text-decoration: underline;
}

.jase-auth-input-wrap {
	display: flex;
	align-items: center;
	gap: 0;
	border: 1.5px solid var(--jase-auth-border);
	border-radius: 12px;
	background: var(--jase-auth-white);
	overflow: hidden;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.jase-auth-input-wrap:focus-within {
	border-color: var(--jase-auth-purple);
	box-shadow: 0 0 0 3px rgba(93, 38, 137, 0.12);
}

.jase-auth-input-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	flex-shrink: 0;
	color: #999999;
}

.jase-auth-input {
	flex: 1 1 auto;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	padding: 0.85rem 0.75rem 0.85rem 0 !important;
	min-height: 48px;
	font-size: 1rem;
	background: transparent;
}

.jase-auth-input:focus {
	outline: none;
}

.jase-auth-pass-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	min-height: 48px;
	border: 0;
	background: transparent;
	color: var(--jase-auth-muted);
	cursor: pointer;
	flex-shrink: 0;
}

.jase-auth-pass-toggle:hover,
.jase-auth-pass-toggle:focus-visible {
	color: var(--jase-auth-purple);
}

.jase-auth-btn-continue {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 52px;
	border-radius: 14px !important;
	background: var(--jase-auth-purple) !important;
	color: var(--jase-auth-white) !important;
	font-weight: 700 !important;
	font-size: 1.05rem;
	text-decoration: none !important;
	border: none !important;
	box-shadow: 0 10px 28px rgba(93, 38, 137, 0.28);
	transition: filter 0.2s ease, transform 0.2s ease;
}

.jase-auth-btn-continue:hover,
.jase-auth-btn-continue:focus-visible {
	filter: brightness(1.06);
	color: var(--jase-auth-white) !important;
	transform: translateY(-1px);
}

.jase-auth-register-prompt {
	text-align: center;
	margin: 1.25rem 0 0;
	font-size: 0.95rem;
}

.jase-auth-register-prompt a {
	color: var(--jase-auth-purple);
	font-weight: 600;
	text-decoration: none;
}

.jase-auth-register-prompt a:hover {
	text-decoration: underline;
}

/* Plugin submit on register — match purple primary */
.jase-auth-shell .sj-secondery-btn.jase-reg-submit {
	background: var(--jase-auth-purple) !important;
	color: var(--jase-auth-white) !important;
	border-color: var(--jase-auth-purple) !important;
	border-radius: 14px !important;
	box-shadow: 0 10px 28px rgba(93, 38, 137, 0.28);
}

.jase-auth-shell .sj-secondery-btn.jase-reg-submit:hover,
.jase-auth-shell .sj-secondery-btn.jase-reg-submit:focus-visible {
	background: var(--jase-auth-purple-dark) !important;
	color: var(--jase-auth-white) !important;
}

/* Footer strip */
.jase-auth-footnote {
	background: var(--jase-auth-ink);
	color: rgba(255, 255, 255, 0.5);
	padding: 0.65rem 1.25rem;
	text-align: center;
	font-size: 0.75rem;
}

.jase-auth-footnote__inner {
	max-width: 1400px;
	margin: 0 auto;
}

.jase-auth-footnote__text {
	margin: 0;
}

/* ——— Mobile: compact dark brand header + form ——— */
@media (max-width: 899px) {
	.jase-auth-shell {
		background: var(--jase-auth-white);
	}

	.jase-auth-shell .jase-reg,
	.jase-auth-shell .jase-login {
		background: var(--jase-auth-white);
		min-height: auto;
	}

	.jase-auth-shell .jase-reg-split {
		min-height: auto;
	}

	.jase-auth-shell .jase-reg-split__brand {
		flex: none;
		width: 100%;
		min-height: 0;
	}

	.jase-reg-split__watermark {
		width: 180px;
		height: 180px;
		right: -24px;
		bottom: -28px;
		opacity: 0.06;
	}

	.jase-reg-split__back {
		margin: 0.85rem 1rem 0;
	}

	.jase-auth-shell .jase-reg-split__brand-inner {
		display: grid;
		grid-template-columns: 52px 1fr;
		grid-template-rows: auto auto;
		column-gap: 0.85rem;
		row-gap: 0.15rem;
		align-items: center;
		text-align: left;
		justify-content: stretch;
		padding: 0.85rem 1rem 1.25rem;
		max-width: none;
		flex: none;
	}

	.jase-auth-shell .jase-reg-split__logo-wrap {
		grid-row: 1 / span 2;
		margin: 0;
		align-self: center;
	}

	.jase-auth-shell .jase-reg-split__logo {
		width: 52px;
	}

	.jase-auth-shell .jase-reg-split__title {
		grid-column: 2;
		margin: 0;
		font-size: 1.25rem;
		letter-spacing: 0.04em;
	}

	.jase-auth-shell .jase-reg-split__dept {
		grid-column: 2;
		margin: 0;
		font-size: 0.8rem;
	}

	.jase-auth-shell .jase-reg-split__main {
		padding: 1rem 1rem 2rem;
		align-items: stretch;
	}

	.jase-auth-shell .jase-reg-panel {
		max-width: none;
		border-radius: 0;
		border: 0;
		box-shadow: none;
		padding: 0.5rem 0 2rem;
	}

	.jase-auth-shell .jase-reg-panel__title {
		font-family: "Inter", system-ui, sans-serif;
		font-weight: 700;
		font-size: 1.35rem;
	}
}

@media (max-width: 480px) {
	.jase-reg-rolegrid {
		grid-template-columns: 1fr;
	}

	.jase-reg-role__card {
		min-height: 0;
	}
}

.jase-auth-btn-continue,
.jase-auth-shell .sj-secondery-btn.jase-reg-submit {
	cursor: pointer;
	font-family: inherit;
}

.jase-auth-btn-continue[disabled],
.jase-auth-shell .sj-secondery-btn.jase-reg-submit[disabled] {
	opacity: 0.72;
	cursor: wait;
	transform: none;
}

.jase-auth-feedback {
	margin: 0 0 1.25rem;
	padding: 0.85rem 1rem;
	border-radius: 12px;
	border: 1px solid transparent;
	font-size: 0.9375rem;
}

.jase-auth-feedback--error {
	background: #fef2f2;
	border-color: #fecaca;
	color: #991b1b;
}

.jase-auth-feedback--success {
	background: #ecfdf5;
	border-color: #a7f3d0;
	color: #065f46;
}

.jase-auth-feedback__title {
	display: block;
	font-size: 0.9375rem;
	margin: 0 0 0.25rem;
}

.jase-auth-feedback__message {
	margin: 0;
}

.jase-auth-loading {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	background: rgba(10, 15, 38, 0.42);
	color: #fff;
}

.jase-auth-loading__spinner {
	width: 2rem;
	height: 2rem;
	border: 3px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: jase-auth-spin 0.75s linear infinite;
}

.jase-auth-loading__text {
	font-size: 0.9375rem;
	font-weight: 500;
}

@keyframes jase-auth-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.jase-auth-loading__spinner {
		animation: none;
		border-top-color: rgba(255, 255, 255, 0.35);
	}
}
