/*
 * Issue #369 (FR-W6, FR-W8): the security screens of the Dashboard (html/security/layout.html and its 7 pages: login,
 * register, register-verify, register-complete, claim-activation, school-admin-invitation, challenge) in the style of the
 * Galac School parent app login (Renewal login stack, docs/design/design-system/mobile/parent-renewal.css .renew-auth and
 * docs/design/assets/app-gs/gs-auth.css, gs-school-web.css): a white page, the "Galac School" wordmark, a centred title
 * and description, box inputs with a left icon and one floating label, a 52px blue button and blue links.
 * The prefix gl-sec- marks these shared rules; the older gl-auth-* rules of galac-dashboard.css were removed (FR-W12).
 */
:root {
	--gsr-primary: #087CFF;
	--gsr-primary-hover: #0670E8;
	--gsr-ink: #111936;
	--gsr-muted: #596683;
	--gsr-faint: #8A96AB;
	--gsr-icon: #7A89A2;
	--gsr-line: #DAE7FF;
	--gsr-soft: #F5F9FF;
	--gsr-orange: #F59E0B;
	--gsr-danger: #DA0025;
	--gsr-success: #12A150;
	--gsr-font: "Nunito", "Noto Sans", system-ui, sans-serif;
}

/* #369: in the app WebView 100vh is taller than the visible area (it ignores the app bar and changes with the keyboard),
   so a short page still scrolled and jumped; the page is no taller than its content, and focus scrolling is not animated */
html:has(> .gl-sec-body) {
	scroll-behavior: auto;
	overscroll-behavior-y: none;
}

.gl-sec-body {
	margin: 0;
	background: #fff;
	color: var(--gsr-ink);
	font-family: var(--gsr-font);
}

/* One column; each page sets its own width (gl-sec-page 420px, gl-sec-page.wide 640px) */
.gl-sec {
	display: flex;
	justify-content: center;
	align-items: flex-start;
	padding: 48px 20px 32px;
	box-sizing: border-box;
}

.gl-sec-col {
	width: 100%;
	max-width: 640px;
}

/* Wordmark "Galac School" as in the app login (.renew-auth-wm) */
.gl-sec-wm {
	margin-bottom: 20px;
	text-align: center;
	font: 800 34px/1 "Baloo 2", "Nunito", system-ui, sans-serif;
	letter-spacing: .3px;
	color: var(--gsr-ink);
}

.gl-sec-wm .g {
	color: var(--gsr-primary);
}

.gl-sec-wm .s {
	color: var(--gsr-orange);
}

.gl-sec-page {
	max-width: 420px;
	margin: 0 auto;
	font-family: var(--gsr-font);
	color: var(--gsr-ink);
}

.gl-sec-page.wide {
	max-width: 640px;
}

.gl-sec-head {
	margin-bottom: 8px;
	text-align: center;
}

.gl-sec-title {
	margin: 0;
	font: 900 25px/1.25 var(--gsr-font);
	letter-spacing: -.4px;
	color: var(--gsr-ink);
}

.gl-sec-sub {
	margin: 6px 0 0;
	font: 600 14px/1.5 var(--gsr-font);
	color: var(--gsr-muted);
}

/* Two columns of fields on a wide screen (register); one column on a phone */
.gl-sec-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	column-gap: 12px;
}

.gl-sec-grid > .full {
	grid-column: 1 / -1;
}

@media (min-width: 768px) {
	.gl-sec-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Input "box": icon left, label inside the box, eye button on a password (.renew-auth .gs-auth-field) */
.gl-sec-field {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 60px;
	margin-top: 12px;
	padding: 8px 14px;
	box-sizing: border-box;
	border: 1px solid var(--gsr-line);
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 2px 8px #1838610a;
	transition: border-color .15s, box-shadow .15s;
}

.gl-sec-field:focus-within {
	border-color: var(--gsr-primary);
	box-shadow: 0 0 0 3px #087cff22;
}

.gl-sec-field.invalid {
	border-color: var(--gsr-danger);
	background: #FFF5F6;
}

/* A read-only value (the email of the account): the same box, greyed */
.gl-sec-field.readonly {
	background: var(--gsr-soft);
	box-shadow: none;
}

.gl-sec-lic {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	color: var(--gsr-icon);
}

.gl-sec-field:focus-within .gl-sec-lic {
	color: var(--gsr-primary);
}

/* Floating label (design v4 scWeb, gs-auth.css .gs-auth-fl .lb): inside the box while the field is empty, small at the
   top when the field has text or focus. Every input has a placeholder (" " when there is no hint), so :placeholder-shown
   means empty; a hint placeholder shows only while the field has focus and the label sits at the top. */
.gl-sec-fl {
	position: relative;
	flex: 1;
	min-width: 0;
	height: 44px;
}

.gl-sec-in {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	height: 24px;
	padding: 0;
	border: 0;
	outline: 0;
	background: transparent;
	font: 600 16px/24px var(--gsr-font);
	color: var(--gsr-ink);
}

.gl-sec-in::placeholder {
	color: transparent;
}

.gl-sec-in:focus::placeholder {
	color: #A9B4C6;
}

.gl-sec-in:disabled {
	color: var(--gsr-muted);
	-webkit-text-fill-color: var(--gsr-muted);
	opacity: 1;
}

.gl-sec-lb {
	position: absolute;
	left: 0;
	right: 0;
	top: 12px;
	margin: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	font: 600 16px/20px var(--gsr-font);
	color: var(--gsr-faint);
	pointer-events: none;
	transition: top .2s, font-size .2s, line-height .2s;
}

.gl-sec-in:focus ~ .gl-sec-lb,
.gl-sec-in:not(:placeholder-shown) ~ .gl-sec-lb {
	top: 0;
	font-size: 12px;
	line-height: 16px;
	font-weight: 700;
	color: var(--gsr-muted);
}

/* separate rule: a browser without this pseudo-class would drop the whole list above */
.gl-sec-in:-webkit-autofill ~ .gl-sec-lb {
	top: 0;
	font-size: 12px;
	line-height: 16px;
	font-weight: 700;
	color: var(--gsr-muted);
}

.gl-sec-lb.required::after {
	content: " *";
	color: var(--gsr-danger);
}

.gl-sec-in:focus-visible {
	outline: 0;
}

/* jQuery Validation puts its message after the box (layout.html errorPlacement) */
.gl-sec .invalid-feedback {
	margin: 6px 4px 0;
	font: 700 13px/1.4 var(--gsr-font);
	color: var(--gsr-danger);
}

.gl-sec-hint {
	margin: 6px 4px 0;
	font: 600 13px/1.4 var(--gsr-font);
	color: var(--gsr-muted);
}

.gl-sec-eye {
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	margin-right: -8px;
	padding: 0;
	border: 0;
	border-radius: 12px;
	background: none;
	color: var(--gsr-icon);
	cursor: pointer;
}

.gl-sec-eye:hover {
	color: var(--gsr-primary);
}

.gl-sec-eye .eye-off,
.gl-sec-eye[aria-pressed="true"] .eye-on {
	display: none;
}

.gl-sec-eye[aria-pressed="true"] .eye-off {
	display: block;
}

.gl-sec-check {
	margin: 16px 0 0;
	font: 700 14px/1.5 var(--gsr-font);
	color: var(--gsr-muted);
}

.gl-sec-check .form-check-input:checked {
	background-color: var(--gsr-primary);
	border-color: var(--gsr-primary);
}

.gl-sec-alert {
	margin: 16px 0 0;
	border-radius: 14px;
	font: 600 14px/1.5 var(--gsr-font);
}

/* Primary button (.renew-auth .gs-auth-btn.school); also used on a link */
.gl-sec-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	height: 52px;
	margin-top: 24px;
	padding: 0 12px;
	box-sizing: border-box;
	border: 1px solid var(--gsr-primary);
	border-radius: 18px;
	background: var(--gsr-primary);
	color: #fff;
	font: 800 16px var(--gsr-font);
	text-decoration: none;
	box-shadow: 0 8px 18px #087cff30;
	cursor: pointer;
}

.gl-sec-btn:hover,
.gl-sec-btn:focus-visible {
	background: var(--gsr-primary-hover);
	color: #fff;
}

.gl-sec-btn:disabled {
	opacity: .7;
	cursor: default;
}

/* Secondary button (Cancel next to Sign in on the 2-step page) */
.gl-sec-btn.ghost {
	background: #fff;
	border-color: var(--gsr-line);
	color: var(--gsr-ink);
	box-shadow: none;
}

.gl-sec-btn.ghost:hover,
.gl-sec-btn.ghost:focus-visible {
	background: var(--gsr-soft);
	color: var(--gsr-ink);
}

.gl-sec-actions {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
	margin-top: 24px;
}

.gl-sec-actions .gl-sec-btn {
	margin-top: 0;
}

.gl-sec-switch {
	margin: 20px 0 0;
	text-align: center;
	font: 600 15px/1.5 var(--gsr-font);
	color: var(--gsr-muted);
}

.gl-sec-switch a,
.gl-sec-link {
	font-weight: 800;
	color: var(--gsr-primary);
	text-decoration: none;
}

.gl-sec-switch a:hover,
.gl-sec-link:hover {
	color: var(--gsr-primary-hover);
	text-decoration: underline;
}

/* A link-style button (Resend the code) */
button.gl-sec-link {
	padding: 4px 0;
	border: 0;
	background: none;
	font: 800 15px/1.5 var(--gsr-font);
	cursor: pointer;
}

button.gl-sec-link:disabled {
	color: var(--gsr-faint);
	text-decoration: none;
	cursor: default;
}

.gl-sec-note {
	margin: 4px 0 0;
	text-align: center;
	font: 600 13px/1.5 var(--gsr-font);
	color: var(--gsr-muted);
}

/* Done screens: a green round check above the title */
.gl-sec-done {
	display: grid;
	place-items: center;
	width: 64px;
	height: 64px;
	margin: 8px auto 16px;
	border-radius: 50%;
	background: #E7F8EE;
	color: var(--gsr-success);
}

/* A labelled value (the platform code after sign-up) */
.gl-sec-info {
	margin-top: 20px;
	padding: 12px 16px;
	border: 1px solid var(--gsr-line);
	border-radius: 16px;
	background: var(--gsr-soft);
	text-align: left;
}

.gl-sec-info small {
	display: block;
	font: 700 12px/16px var(--gsr-font);
	color: var(--gsr-muted);
}

.gl-sec-info strong {
	font: 800 16px/24px var(--gsr-font);
	color: var(--gsr-ink);
	word-break: break-all;
}

@media (min-width: 992px) {
	.gl-sec {
		align-items: center;
		padding: 40px 20px;
	}
}
