/*
 * Visual-only redesign of Frappe's auth pages (login, signup, forgot
 * password, reset/set password) - split brand-panel / form-panel layout
 * with an animated "pulse line" brand motif, built to the exact design
 * spec provided (colors, type, motion) but re-wired onto the REAL form
 * markup and REAL working features rather than the mockup's static
 * placeholders:
 *   - real #login_email / #login_password fields (not a fake #userid)
 *   - real .toggle-password "Show/Hide" control (not a duplicate one)
 *   - real "Login with Email Link" feature in the secondary-button slot
 *     the mockup used for a non-functional "Campus SSO" button
 *   - the site's own working language switch (cookie + reload) in the
 *     language-pill slot, not the mockup's client-only relabel-only script
 * Scoped entirely via body[data-path="login"] / body[data-path="update-password"]
 * / body[data-path="education/pre-admission-activation"] / body[data-path=
 * "education/pre-admission-activation-ar"] (the last two: the "Al-Riyada
 * Verification" page applicants land on after Pre Admission - www/education/
 * pre-admission-activation.html - reuses this exact same core Frappe login
 * markup/classes (.page-card-head, .login-content, .form-signin,
 * .email-field, .btn-login, .page-card-actions), just under a different
 * route/data-path, so every rule below just works for it too once its
 * data-path is added to the selector list)
 * - an attribute Frappe's own base.html stamps onto <body> server-side
 * (`data-path="{{ path }}"`), present from the very first byte of the
 * response - not a class added by login_theme.js. That's deliberate: this
 * used to be scoped under a JS-added body class, which meant every rule
 * here only took effect after that script ran and mutated the DOM, so
 * visitors saw a flash of plain unstyled Frappe login first on every load.
 * Keying off data-path instead means this styling applies immediately on
 * first paint, no JS required - login_theme.js now only has to add the
 * genuinely new decorative markup (brand panel, tagline, language pill),
 * not the restyling itself. Scoping this way also means it never touches
 * preadmission/student-applicant/any other page, and never loads on /app
 * (web_include_css/js are never included there by core Frappe).
 */

/* Google Fonts is loaded via a preloaded <link> injected by login_theme.js
   instead of an @import here. A CSS @import must be fully fetched before
   the browser can apply anything declared after it in this same file - on
   a cold cache that round-trip to fonts.googleapis.com was delaying every
   layout rule below (form width, panel split, etc.), so the login page
   visibly rendered as the small, unstyled core form first and only
   snapped into the real layout once the font fetch finished. Layout no
   longer waits on webfonts at all now; 'Inter'/'Space Grotesk'/'IBM Plex
   Sans Arabic' still list a sans-serif fallback everywhere they're used,
   so text just swaps to the real font whenever it does arrive. */

:root {
	--rchs-blue: #0769B2;
	--rchs-blue-dark: #054C82;
	--rchs-blue-deepest: #062741;
	--rchs-navy-ink: #0A2036;
	--rchs-teal: #13AFA3;
	--rchs-teal-soft: #DFF5F2;
	--rchs-bg-soft: #F3F8FC;
	--rchs-surface: #FFFFFF;
	--rchs-line: #E1EAF2;
	--rchs-muted: #5C7488;
	--rchs-radius-md: 14px;
	--rchs-radius-sm: 10px;
	--rchs-ease: cubic-bezier(.4, 0, .2, 1);
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) {
	font-family: 'Inter', sans-serif;
	background: var(--rchs-bg-soft);
	color: var(--rchs-navy-ink);
	-webkit-font-smoothing: antialiased;
	margin: 0;
}

html:has(:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"])) {
	margin: 0;
}

/* Nothing on this page ever sets a dir="rtl" attribute anywhere (that's
   done by preadmission.js/student_applicant.js's own JS on those pages,
   not by any site-wide or core mechanism) - only html[lang="ar"]. Without
   an explicit direction, this page's logical properties
   (inset-inline-start, margin-inline-start, text-align:start/end) all
   silently resolved as plain LTR even in Arabic, so the panel never
   mirrored. Setting direction explicitly here is what makes them actually
   flip. Selectors also corrected to check html's lang attribute, not
   body's - lang is set on <html>, never copied onto <body>. */
html[lang^="ar"] :is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) {
	direction: rtl;
	font-family: 'IBM Plex Sans Arabic', 'Inter', sans-serif;
}

/* Email/password inputs hold Latin-script content only (an email
   address, a password) - inheriting direction:rtl from the rule right
   above (Arabic UI) makes the browser's bidi algorithm mirror the whole
   field: the caret anchors on the right and advances backwards, so
   students typing an email saw it come out looking reversed/wrong as
   they went, even though the final string was technically stored
   correctly. Pinning these specific fields back to direction:ltr fixes
   the typing behavior, but that also flips what "inset-inline-start/end"
   below resolve to *for these elements specifically* (logical properties
   read the direction of the element they're declared on, not the page) -
   so the icon/padding/toggle-button positions those rules set have to be
   re-pinned to the same physical side explicitly here, or the icon and
   text would land on opposite sides of the gap meant to hold them
   together. */
html[lang^="ar"] :is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) :is(.email-field, .password-field, .rchs-icon-field) .form-control {
	direction: ltr;
	text-align: left;
	padding-left: 48px;
	padding-right: 18px;
}

html[lang^="ar"] :is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) :is(.password-field, .rchs-icon-field):has(.toggle-password) .form-control {
	padding-right: 68px;
}

html[lang^="ar"] :is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) :is(.email-field, .password-field, .rchs-icon-field) .field-icon {
	inset-inline-start: auto;
	left: 16px;
	right: auto;
}

html[lang^="ar"] :is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .toggle-password {
	inset-inline-end: auto;
	right: 16px;
	left: auto;
}

/* The stock navbar's job (logo, name, language switch) is fully absorbed
   into the brand panel + language pill below - a second bar above it
   would just duplicate both and eat vertical space this layout needs. */
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .navbar {
	display: none !important;
}

/* The site-wide footer doesn't fit this full-bleed layout (the reference
   design has none), and its extra height was leaving a gap below the
   fixed-position brand panel, which only ever covers one viewport's worth
   of height. */
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .web-footer {
	display: none !important;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .page_content {
	padding: 0;
	min-height: 100vh;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) main.container {
	max-width: none;
	width: 100%;
	padding: 0;
	margin: 0 !important; /* beats Bootstrap's .my-4 (!important) - it left a 16px strip above and below the page */
}

/* ============ BRAND PANEL (decorative, injected by login_theme.js) ============ */
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-brand-panel {
	position: fixed;
	inset-block: 0;
	inset-inline-start: 0;
	width: 42%;
	min-width: 360px;
	background:
		radial-gradient(120% 140% at 15% 0%, rgba(255, 255, 255, .10) 0%, rgba(255, 255, 255, 0) 45%),
		linear-gradient(160deg, var(--rchs-blue) 0%, var(--rchs-blue-dark) 58%, var(--rchs-blue-deepest) 100%);
	color: #fff;
	padding: 56px 48px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	overflow: hidden;
	z-index: 1;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-brand-watermark {
	position: absolute;
	inset: 0;
	opacity: .10;
	pointer-events: none;
	display: flex;
	align-items: center;
	justify-content: center;
	transform: scale(1.7) translateY(6%);
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-brand-top {
	display: flex;
	align-items: center;
	gap: 14px;
	position: relative;
	z-index: 2;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-brand-top img {
	width: 52px;
	height: 52px;
	border-radius: 12px;
	background: #fff;
	padding: 6px;
	object-fit: contain;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-brand-wordmark {
	display: flex;
	flex-direction: column;
	line-height: 1.15;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-brand-wordmark .en {
	font-family: 'Space Grotesk', sans-serif;
	font-weight: 700;
	font-size: 30px;
	letter-spacing: .06em;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-brand-wordmark .sub {
	font-size: 15px;
	font-weight: 700px;
	color: rgba(255, 255, 255, .72);
	letter-spacing: .03em;
	margin-top: 2px;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-brand-mid {
	position: relative;
	z-index: 2;
	max-width: 460px;
	margin-top: auto;
	margin-bottom: auto;
	padding: 64px 0;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-brand-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: 'Space Grotesk', sans-serif;
	font-size: 14px;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--rchs-teal-soft);
	margin-bottom: 22px;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-brand-eyebrow .dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--rchs-teal-soft);
	box-shadow: 0 0 0 4px rgba(255, 255, 255, .15);
}

/* color set explicitly (not left to inherit #fff from .rchs-brand-panel):
   website.bundle.css's global "h1,h2,...{color:#171717}" directly matches
   this h1 too, and an explicit rule always wins over an inherited value
   regardless of specificity - this was rendering as near-black text on
   the dark blue panel until color was set here directly. */
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-brand-mid h1 {
	font-family: 'Space Grotesk', sans-serif;
	font-weight: 800;
	font-size: clamp(32px, 3.2vw, 50px);
	line-height: 1.2;
	letter-spacing: -.01em;
	color: #fff;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-brand-mid p {
	margin-top: 18px;
	font-size: 17px;
	line-height: 1.65;
	color: rgba(255, 255, 255, .78);
	max-width: 420px;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-pulse-wrap {
	margin-top: 40px;
	height: 64px;
	position: relative;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-pulse-wrap svg {
	width: 100%;
	height: 100%;
	overflow: visible;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-pulse-line {
	fill: none;
	stroke: var(--rchs-teal-soft);
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-dasharray: 600;
	stroke-dashoffset: 600;
	animation: rchs-draw 3.2s var(--rchs-ease) infinite;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-pulse-dot {
	fill: #fff;
	filter: drop-shadow(0 0 6px rgba(255, 255, 255, .9));
	offset-path: path('M0,32 L40,32 L58,32 L70,6 L86,58 L100,32 L120,32 L138,10 L150,32 L560,32');
	animation: rchs-travel 3.2s linear infinite;
}

@keyframes rchs-draw {
	0% { stroke-dashoffset: 600; }
	55% { stroke-dashoffset: 0; }
	100% { stroke-dashoffset: -40; }
}

@keyframes rchs-travel {
	0% { offset-distance: 0%; }
	100% { offset-distance: 100%; }
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-brand-bottom {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 14px;
	color: rgba(255, 255, 255, .6);
	border-top: 1px solid rgba(255, 255, 255, .16);
	padding-top: 20px;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-brand-bottom .roles {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-brand-bottom .roles span {
	padding: 6px 12px;
	border: 1px solid rgba(255, 255, 255, .28);
	border-radius: 999px;
	font-size: 13px;
	color: rgba(255, 255, 255, .85);
}

/* Below 880px the full side brand panel (watermark, headline, pulse
   animation, footnote, logo) has no room - hidden entirely, same as
   before this page had any mobile branding at all. The logo itself is
   NOT lost though: login_theme.js also inserts a separate, plain
   .rchs-mobile-logo node as the first child of .page_content specifically
   (not a sibling bar above/outside it, the way this sidebar panel is) -
   see the dedicated rule for that element further down, right after
   .page_content's own mobile rule. */
@media (max-width: 880px) {
	:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-brand-panel {
		display: none;
	}
}

/* Desktop/tablet already gets the logo from the sidebar .rchs-brand-panel -
   this inline one only ever renders below 880px (its own rule further
   down), so keep it out of the box model up here too. */
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-mobile-logo {
	display: none;
}

/* ============ FORM PANEL (real content, shifted + restyled) ============ */
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .page_content {
	margin-inline-start: 42%;
	background: var(--rchs-surface);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 40px 32px;
	position: relative;
}

/* The page is exactly one screen tall. 100dvh follows the visible area on phones (browser bars), where 100vh is taller than it;
   on short desktop screens (13-14" laptops, ~768px) the form's own height plus 2x40px padding no longer fits, so the padding
   shrinks there instead of the page scrolling. */
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .page_content {
	min-height: 100dvh;
}

@media (min-width: 881px) and (max-height: 860px) {
	:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .page_content {
		padding-block: 14px;
	}
}

/* Very short windows (e.g. a laptop browser ~700px tall): drop the "get it on your phone soon" teaser rather than scroll the sign-in form. */
@media (min-width: 881px) and (max-height: 760px) {
	body[data-path="login"] .rchs-app-badges {
		display: none;
	}
}

/* login_theme.js appends the audience note / app badges / tagline a moment
   after first paint (they depend on core's own login form having rendered
   first). Since .page_content centers its children as a group
   (justify-content: center above), that late append used to visibly
   re-center/"jump" the whole card once that content popped in. Keeping the
   card invisible until login_theme.js adds "rchs-theme-ready" to <body>
   (once all of that has landed) - then fading it in as one already-settled
   block - trades that jump for a single brief, deliberate fade. The
   fallback opacity: 1 with no transition (no ancestor selector) is what
   still applies if this script never runs at all (e.g. JS disabled), so
   the page is never permanently blank. */
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]):not(.rchs-theme-ready) .page_content {
	opacity: 0;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]).rchs-theme-ready .page_content {
	opacity: 1;
	transition: opacity .22s var(--rchs-ease);
}

@media (max-width: 880px) {
	:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .page_content {
		margin-inline-start: 0;
	}
}

/* Language pill - real switching (cookie + reload), styled to the spec. */
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-lang-toggle {
	position: absolute;
	top: 32px;
	inset-inline-end: 40px;
	display: flex;
	align-items: center;
	gap: 2px;
	background: var(--rchs-bg-soft);
	border-radius: 999px;
	padding: 4px;
	border: 1px solid var(--rchs-line);
	z-index: 3;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-lang-toggle button {
	border: none;
	background: transparent;
	font-family: inherit;
	font-size: 12.5px;
	font-weight: 600;
	padding: 6px 14px;
	border-radius: 999px;
	color: var(--rchs-muted);
	cursor: pointer;
	transition: background .2s var(--rchs-ease), color .2s var(--rchs-ease);
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-lang-toggle button.active {
	background: var(--rchs-surface);
	color: var(--rchs-blue);
	box-shadow: 0 1px 3px rgba(10, 32, 54, .12);
}

/* Fixed (not absolute) here specifically so it renders pinned to the
   viewport's very top-right regardless of where it sits in the DOM/normal
   flow relative to .rchs-mobile-logo right below it - the desired
   stacking order is language switch first, then the logo, then the page
   heading, and this is what makes that order hold even though
   .rchs-mobile-logo is inserted as .page_content's first child (i.e.
   structurally *before* this toggle, which is appended as its last
   child) - position:fixed takes it out of flow entirely so DOM order
   between the two doesn't matter. */
@media (max-width: 880px) {
	:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-lang-toggle {
		position: fixed;
		top: 14px;
		inset-inline-end: 16px;
		z-index: 20;
	}
}

/* The logo now lives INSIDE .page_content (login_theme.js inserts it as
   that element's first child) rather than in a separate bar outside/above
   it - .page_content is already display:flex/flex-direction:column/
   align-items:center (see its own rule above), so this just needs to size
   the image and clear the fixed language pill sitting on top of it.
   display:none by default (the earlier rule right after .rchs-brand-panel's
   own mobile rule) is overridden back to flex only below 880px, since
   desktop/tablet already has the logo via the sidebar panel. */
@media (max-width: 880px) {
	:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-mobile-logo {
		display: flex;
		justify-content: center;
		width: 100%;
		margin-top: 44px;
		margin-bottom: 8px;
	}

	:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-mobile-logo img {
		width: 88px;
		height: 88px;
		object-fit: contain;
	}
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) section[class^="for-"] {
	width: 100%;
	max-width: 460px;
}

/* display:contents removes the wrapper from the box model entirely - its
   children (the actual form) lay out as if .page-card wasn't there at
   all, rather than just being invisibly styled away. */
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .page-card {
	display: contents;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .page-card-head {
	text-align: start;
	padding: 0 0 8px;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .page-card-head .app-logo,
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .page-card-head .rchs-card-logo {
	display: none;
}

/* h3 also covered - the activation page's own logo_section() macro
   (www/education/pre-admission-activation.html) renders "Al-Riyada
   Verification" as an <h3>, not the <h4> core's own login.html uses. */
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .page-card-head h4,
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .page-card-head h3 {
	font-family: 'Space Grotesk', sans-serif;
	font-weight: 600;
	font-size: 34px;
	letter-spacing: -.01em;
	color: var(--rchs-navy-ink);
}

/* Core's generic message.html (frappe.respond_as_web_page - /?cmd=web_logout,
   permission errors, etc.) renders .page-card-head AS the heading itself
   (a bare <h5>), not as a wrapper div around one like login.html's - so
   the h4/h3-nested rule above never matches it. Styled directly here
   instead; the ::before-rendered status indicator dot (.indicator) it
   also contains is handled separately below. */
:is(body[data-path="message"]) h5.page-card-head {
	font-family: 'Space Grotesk', sans-serif;
	font-weight: 600;
	font-size: 30px;
	letter-spacing: -.01em;
	color: var(--rchs-navy-ink);
	border: none;
	margin: 0 0 6px;
}

:is(body[data-path="message"]) .page-card-head .indicator {
	color: inherit;
	font-size: inherit;
}

:is(body[data-path="message"]) .page-card-body {
	color: var(--rchs-muted);
	font-size: 15.5px;
	line-height: 1.6;
}

:is(body[data-path="message"]) .page-card-body p {
	margin: 0 0 22px;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .page-card-head .rchs-card-tagline {
	margin: 10px 0 0;
	font-family: 'Inter', sans-serif;
	font-size: 16px;
	color: var(--rchs-muted);
	line-height: 1.55;
	max-width: none;
}

/* Core Frappe's own bundled login CSS (login.bundle.*.css) ships
   ".for-login .page-card form, .for-forgot .page-card form, ..." at
   max-width: 320px - that's what was actually capping the width of this
   redesigned, deliberately wider form. .page-card itself is display:contents
   now (doesn't remove it from the DOM, just the box model), so that core
   selector still matches; overriding it here rather than touching core. */
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .page-card form {
	max-width: none !important;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) form {
	margin-top: 36px;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .form-group {
	margin-bottom: 22px;
}

/* Un-hide the (originally sr-only) field labels - the design calls for
   them visible above each input. */
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .form-label.sr-only {
	position: static;
	width: auto;
	height: auto;
	margin: 0 0 8px;
	padding: 0;
	overflow: visible;
	clip: auto;
	white-space: normal;
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--rchs-navy-ink);
	letter-spacing: .01em;
	font-family: 'Inter', sans-serif;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .email-field,
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .password-field {
	position: relative;
	display: flex;
	align-items: center;
}

/* Used by enhancePasswordFields() for update-password's old/new/confirm
   password fields - unlike .password-field above (a dedicated row wrapper
   for just the icon+input), this class goes directly on the existing
   .form-group, which also holds the label - so it only adds the
   positioning context the icon needs, without making the label sit
   inline in a flex row alongside the input instead of stacked above it. */
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-icon-field {
	position: relative;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .field-icon {
	position: absolute;
	inset-inline-start: 16px;
	width: 20px;
	height: 20px;
	color: var(--rchs-muted);
	opacity: 0.8;
	pointer-events: none;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .form-control {
	width: 100%;
	font-family: inherit;
	font-size: 16.5px;
	color: var(--rchs-navy-ink);
	background: var(--rchs-bg-soft);
	border: 1.5px solid var(--rchs-line);
	border-radius: var(--rchs-radius-sm);
	padding: 16px 18px;
	padding-inline-start: 48px;
	outline: none;
	transition: border-color .18s var(--rchs-ease), background .18s var(--rchs-ease), box-shadow .18s var(--rchs-ease);
}

/* Only login_password has a "Show/Hide" toggle to leave room for -
   enhancePasswordFields() reuses this same .password-field wrapper for
   old_password/new_password/confirm_password too (update-password.html),
   none of which have that toggle, so they'd otherwise get the same wide
   empty gap on their end reserved for nothing. */
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .password-field:has(.toggle-password) .form-control {
	padding-inline-end: 68px;
}

/* enhancePasswordFields() (login_theme.js) gives old/new/confirm_password
   their own .toggle-password inside the .rchs-icon-field .form-group
   wrapper rather than a .password-field row - reserve the same end gap. */
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-icon-field:has(.toggle-password) .form-control {
	padding-inline-end: 68px;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-icon-field {
	position: relative;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-icon-field .toggle-password {
	top: 50%;
	transform: translateY(-50%);
	user-select: none;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .form-control::placeholder {
	color: #9AACBB;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .form-control:focus {
	background: var(--rchs-surface);
	border-color: var(--rchs-blue);
	box-shadow: 0 0 0 4px rgba(7, 105, 178, .12);
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .toggle-password {
	position: absolute;
	inset-inline-end: 16px;
	font-family: 'Inter', sans-serif;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--rchs-blue);
	cursor: pointer;
	background: none;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .toggle-password:hover {
	color: var(--rchs-blue-dark);
	text-decoration: underline;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .forgot-password-message {
	text-align: end;
	margin: 4px 0 30px;
	font-size: 14.5px;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .forgot-password-message a {
	color: var(--rchs-blue);
	text-decoration: none;
	font-weight: 600;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .forgot-password-message a:hover {
	text-decoration: underline;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .btn-login,
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .btn-primary {
	width: fit-content;
	min-width: 220px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-family: 'Space Grotesk', sans-serif;
	font-size: 17px;
	font-weight: 600;
	letter-spacing: .01em;
	color: #fff;
	background: linear-gradient(135deg, var(--rchs-blue) 0%, var(--rchs-blue-dark) 100%);
	border: none;
	border-radius: var(--rchs-radius-sm);
	padding: 17px 32px;
	box-shadow: 0 8px 20px rgba(7, 105, 178, .28);
	transition: transform .15s var(--rchs-ease), box-shadow .15s var(--rchs-ease), filter .15s var(--rchs-ease);
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .btn-login:hover,
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .btn-primary:hover {
	filter: brightness(1.05);
	box-shadow: 0 10px 24px rgba(7, 105, 178, .36);
	transform: translateY(-1px);
	/* The "Home" link on message.html (e.g. the post-logout page) is a
	   plain <a class="btn btn-primary"> - core's own generic `a:hover`
	   and .btn-primary:hover rules both carry the same specificity as
	   this one, so which wins came down to stylesheet load order and was
	   flipping the label to dark/black on hover instead of staying
	   white. Pinned explicitly here so it can't lose that tie. */
	color: #fff !important;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .btn-login:active,
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .btn-primary:active {
	transform: translateY(1px);
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-btn-arrow {
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	transition: transform .18s var(--rchs-ease);
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .btn-login:hover .rchs-btn-arrow {
	transform: translateX(3px);
}

html[lang^="ar"] :is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-btn-arrow {
	transform: scaleX(-1);
}

html[lang^="ar"] :is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .btn-login:hover .rchs-btn-arrow {
	transform: scaleX(-1) translateX(3px);
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .btn-update:disabled {
	opacity: 0.5;
	box-shadow: none;
	transform: none;
}

/* Login/Forgot Password/Login-with-Email-Link buttons, disabled for the
   duration of their request by login_theme.js's guardAuthSubmitButtons()
   (core's own login.js never disables them itself - only .btn-update
   above gets that natively, via frappe.call's `btn` option). Same treatment
   as .btn-update:disabled, just also killing the hover lift/shadow so a
   disabled button doesn't still look interactive on mouseover. */
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .btn-login:disabled,
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .btn-primary:disabled {
	opacity: 0.5;
	box-shadow: none;
	transform: none;
	cursor: not-allowed;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .btn-login:disabled:hover,
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .btn-primary:disabled:hover {
	filter: none;
	box-shadow: none;
	transform: none;
}

/* "or" divider + secondary action (real "Login with Email Link" /
   "Back to Login" / signup link occupy this slot - not a fake SSO
   button). */
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .login-divider {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 26px 0;
	color: var(--rchs-muted);
	font-size: 12px;
	text-align: center;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .login-divider::before,
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .login-divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--rchs-line);
}

/* !important throughout this rule: core's own login.bundle.css targets
   this same button via .btn-login-option with a much more specific
   compound selector (".for-login-with-email-link .page-card
   .page-card-body .btn-login-option", 4 chained classes) that otherwise
   beats this file's selectors on plain specificity and silently overrode
   the background/border/color below. Scoped to .btn-default only now -
   .btn-login-with-email-link has its own plain-text treatment below
   instead (kept separate since .btn-default is also shared by any SSO/
   provider login buttons, e.g. login.html's btn-{{ provider.name }}
   buttons, which should stay looking like real buttons). */
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .btn-default {
	width: fit-content;
	min-width: 220px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	background: linear-gradient(135deg, var(--rchs-blue) 0%, var(--rchs-blue-dark) 100%) !important;
	border: none !important;
	border-radius: var(--rchs-radius-sm);
	padding: 12px 24px;
	font-family: 'Inter', sans-serif;
	font-size: 13.5px;
	font-weight: 600;
	color: #fff !important;
	box-shadow: 0 8px 20px rgba(7, 105, 178, .28);
	transition: transform .15s var(--rchs-ease), box-shadow .15s var(--rchs-ease), filter .15s var(--rchs-ease);
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .btn-default:hover {
	filter: brightness(1.05);
	box-shadow: 0 10px 24px rgba(7, 105, 178, .36);
	transform: translateY(-1px);
}

/* "Login with Email Link" - plain text link, not a button. Same
   .btn-login-option specificity problem as above (core's compound
   selector beats a plain class), so !important is needed here too to
   actually strip the button chrome rather than just visually hide it
   under core's own gray pill styling.

   Scoped to ".btn-login-option.btn-login-with-email-link" specifically
   (both classes together) - not just ".btn-login-with-email-link" alone.
   That plain class is reused by TWO different buttons in login.html:
   this one (the secondary CTA on the main login form, which also carries
   .btn-login-option - line ~105) and the real "Send login link" *submit*
   button inside section.for-login-with-email-link itself (line ~209,
   which carries .btn-primary instead, no .btn-login-option). Originally
   scoped to the bare class, this rule's !important was stripping the
   submit button's button chrome too, leaving it looking like plain
   underlined text - .btn-primary already gets the exact same gradient
   treatment as the main login button from the .btn-login/.btn-primary
   rule above; narrowing this selector is what lets that rule actually
   apply to it instead of being overridden. */
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .btn-login-option.btn-login-with-email-link {
	width: auto !important;
	min-width: 0 !important;
	display: inline-flex !important;
	margin: 0 auto !important;
	background: none !important;
	border: none !important;
	box-shadow: none !important;
	padding: 4px !important;
	font-family: 'Inter', sans-serif;
	font-size: 14px;
	font-weight: 600;
	color: var(--rchs-blue) !important;
	text-decoration: underline;
	transition: color .15s var(--rchs-ease);
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .btn-login-option.btn-login-with-email-link:hover {
	color: var(--rchs-blue-dark) !important;
	background: none !important;
	box-shadow: none !important;
	transform: none;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) a {
	color: var(--rchs-blue);
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) a:hover {
	color: var(--rchs-blue-dark);
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .password-strength-message,
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .password-mismatch-message {
	font-family: 'Inter', sans-serif;
}

/* "Re-Send Activation Code" - .btn-secondary is only ever used on the
   activation page (www/education/pre-admission-activation.html), not any
   other page this file already styles, so it had no themed treatment at
   all until now (plain unstyled Bootstrap gray). Styled as a quieter
   outline counterpart to the .btn-login/.btn-primary gradient button
   above it, not a second competing call to action. */
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .btn-secondary {
	width: fit-content;
	min-width: 220px;
	margin: 10px auto 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--rchs-surface) !important;
	border: 1.5px solid var(--rchs-line) !important;
	border-radius: var(--rchs-radius-sm);
	padding: 12px 24px;
	font-family: 'Inter', sans-serif;
	font-size: 13.5px;
	font-weight: 600;
	color: var(--rchs-navy-ink) !important;
	text-decoration: none !important;
	transition: border-color .15s var(--rchs-ease), color .15s var(--rchs-ease);
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .btn-secondary:hover {
	border-color: var(--rchs-blue) !important;
	color: var(--rchs-blue) !important;
}

/* Admission banner - inserted as the login section's own first child
   (section.for-login, ahead of .page-card-head/the form itself), login
   page only. Injected by login_theme.js's buildAdmissionBanner(). The
   max-width here just mirrors "section[class^='for-']" above (its own
   parent already caps it at that width) so it reads as part of this
   card's content rather than a page-wide strip. A real link (not a JS
   "coming soon" button like .rchs-app-badge below) pointing at the
   public pre-admission form. */
body[data-path="login"] .rchs-admission-banner {
	width: 100%;
	max-width: 460px;
	margin: 0 0 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	background: var(--rchs-blue-soft, #EAF1FF);
	border: 1px solid var(--rchs-blue, #2563EB);
	border-radius: var(--rchs-radius-sm);
	padding: 12px 16px;
}

body[data-path="login"] .rchs-admission-banner-text {
	font-size: 13px;
	font-weight: 600;
	color: var(--rchs-navy-ink);
	line-height: 1.45;
}

body[data-path="login"] .rchs-admission-banner-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 7px 16px;
	border-radius: 999px;
	background: var(--rchs-blue, #2563EB);
	color: #fff !important;
	font-size: 12.5px;
	font-weight: 600;
	white-space: nowrap;
	text-decoration: none !important;
	transition: filter .15s var(--rchs-ease), transform .15s var(--rchs-ease);
}

body[data-path="login"] .rchs-admission-banner-btn:hover {
	filter: brightness(1.1);
	transform: translateY(-1px);
}

/* Mobile: stack text above the button and stretch it full-width, same
   breakpoint the mobile logo/lang-toggle already switch at (880px) - the
   card itself narrows well before that (.page_content drops its 42%
   inline-start margin then), but the banner's own row only needs to wrap
   once the text and button can no longer sit comfortably side by side. */
@media (max-width: 480px) {
	body[data-path="login"] .rchs-admission-banner {
		flex-direction: column;
		align-items: stretch;
		text-align: center;
		padding: 14px;
	}

	body[data-path="login"] .rchs-admission-banner-btn {
		width: 100%;
	}
}

/* "Login link sent!" confirmation - Login-with-Email-Link section only,
   injected by login_theme.js's buildEmailLinkSentBanner(). Hidden by
   default ([hidden] below just makes that explicit/immediate instead of
   waiting on the element's own `hidden` attribute to apply); toggled by
   guardAuthSubmitButtons() on a successful send. Distinct green, not the
   audience note's teal below - this is a one-time confirmation of an
   action just taken, not standing informational copy. */
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-email-link-sent {
	margin-top: 18px;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	background: #EAF7EE;
	border: 1px solid #BEE8C7;
	border-radius: var(--rchs-radius-sm);
	padding: 12px 14px;
	font-size: 13px;
	font-weight: 600;
	color: #1E7B34;
	line-height: 1.5;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-email-link-sent[hidden] {
	display: none;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-email-link-sent svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	margin-top: 1px;
}

/* Audience note + helper footer - decorative informational copy only,
   injected by login_theme.js on the login section specifically. */
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-audience-note {
	margin-top: 22px;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	background: var(--rchs-teal-soft);
	border: 1px solid #BFE8E2;
	border-radius: var(--rchs-radius-sm);
	padding: 12px 14px;
	font-size: 12.5px;
	color: #0E6F66;
	line-height: 1.55;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-audience-note svg {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	margin-top: 1px;
}

/* Android/Apple "get the app" badges - login section only, injected by
   login_theme.js's buildAppBadges(). Buttons, not links: there's no real
   store destination yet, only a "coming soon" notice. */
:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-app-badges {
	margin-top: 16px;
	text-align: center;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-app-badges-label {
	display: block;
	font-size: 12px;
	color: var(--rchs-muted);
	margin-bottom: 8px;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-app-badges-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	flex-wrap: wrap;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-app-badge {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 8px 14px;
	border: 1px solid var(--rchs-border, #E2E8F0);
	border-radius: var(--rchs-radius-sm);
	background: #fff;
	color: var(--rchs-navy-ink);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: border-color .15s var(--rchs-ease), color .15s var(--rchs-ease), transform .15s var(--rchs-ease);
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-app-badge:hover {
	border-color: var(--rchs-blue);
	color: var(--rchs-blue);
	transform: translateY(-1px);
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-app-badge svg {
	flex-shrink: 0;
}

:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-helper-foot {
	margin-top: 30px;
	text-align: center;
	font-size: 12.5px;
	color: var(--rchs-muted);
	line-height: 1.7;
}

@media (prefers-reduced-motion: reduce) {
	:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-pulse-line,
	:is(body[data-path="login"], body[data-path="update-password"], body[data-path="education/pre-admission-activation"], body[data-path="education/pre-admission-activation-ar"], body[data-path="message"]) .rchs-pulse-dot {
		animation: none;
		stroke-dashoffset: 0;
	}
}

/* ============================================================
 * Error/permission message pages (login_theme.js's "message-error"
 * kind - a red/orange/etc indicator on core's generic message.html, e.g.
 * "Not Permitted"). Keeps the same split brand-panel shell every rule
 * above already sets up for "message" pages generally (the panel itself
 * is untouched here - it renders fine off the shared rules above, just
 * with buildBrandPanel()'s "error" copy variant instead of the login
 * one), but gives the actual card its own compact, distinct design
 * instead of reusing .for-login/.for-reset-password's own layout -
 * wrapping a permission error in literal login-form styling read as
 * wrong for what it actually is. body[data-path="message"].rchs-message-error
 * is more specific than the plain body[data-path="message"] used
 * throughout the rules above (an extra class selector), so this cleanly
 * overrides just the card-area rules for this one case without needing
 * !important anywhere.
 * ============================================================ */
body[data-path="message"].rchs-message-error {
	font-family: 'Inter', sans-serif;
	background: var(--rchs-bg-soft);
	color: var(--rchs-navy-ink);
	-webkit-font-smoothing: antialiased;
	margin: 0;
}

html[lang^="ar"] body[data-path="message"].rchs-message-error {
	direction: rtl;
	font-family: 'IBM Plex Sans Arabic', 'Inter', sans-serif;
}

body[data-path="message"].rchs-message-error .navbar {
	display: none !important;
}

body[data-path="message"].rchs-message-error .web-footer {
	display: none;
}

/* Same split as the login page's own .page_content rule (margin-inline-start:
   42% to clear the fixed brand panel) - the shared rules above already give
   every "message" page (this one included) display:flex/flex-direction:
   column/align-items:center/justify-content:center, so this only needs to
   add the margin back. NOTE this selector (body[data-path="message"]
   .rchs-message-error .page_content, specificity 0,3,1) is MORE specific
   than the shared <880px reset further up (an :is(...) selector, which only
   carries the specificity of its most specific argument - 0,2,1) - so that
   reset was silently losing to this rule below 880px despite matching,
   leaving the 42% gap even once .rchs-brand-panel itself was hidden. Repeated
   here at the same breakpoint so it actually wins. */
body[data-path="message"].rchs-message-error .page_content {
	margin-inline-start: 42%;
}

@media (max-width: 880px) {
	body[data-path="message"].rchs-message-error .page_content {
		margin-inline-start: 0;
	}
}

body[data-path="message"].rchs-message-error .page-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	width: 100%;
	max-width: 380px;
	background: var(--rchs-surface);
	border: 1px solid var(--rchs-line);
	border-radius: var(--rchs-radius-md);
	box-shadow: 0 20px 44px -20px rgba(10, 32, 54, .18);
	padding: 40px 32px 32px;
}

/* Below 880px this loses the brand panel (its own rule further up resets
   margin-inline-start to 0), but .page_content still carries the desktop
   40px/32px padding from the shared "message" rule above plus this card's
   own 40px/32px - on a narrow phone (e.g. 375px wide) that's ~144px of
   combined horizontal padding eaten before any actual text, same problem
   .rchs-student-404's own .page_content rule (24px, further up) already
   avoids by not reusing the desktop padding at all. */
@media (max-width: 480px) {
	body[data-path="message"].rchs-message-error .page_content {
		padding: 24px 16px;
	}

	body[data-path="message"].rchs-message-error .page-card {
		padding: 32px 20px 24px;
	}
}

body[data-path="message"].rchs-message-error .page-card::before {
	content: "";
	display: block;
	width: 56px;
	height: 56px;
	margin: 0 auto 20px;
	border-radius: 50%;
	background: #FDEDEC;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23DC2626' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='9' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 24px 24px;
}

body[data-path="message"].rchs-message-error h5.page-card-head {
	font-family: 'Space Grotesk', sans-serif;
	font-weight: 600;
	font-size: 22px;
	letter-spacing: -.01em;
	color: var(--rchs-navy-ink);
	border: none;
	margin: 0 0 10px;
}

body[data-path="message"].rchs-message-error .page-card-head .indicator {
	color: inherit;
	font-size: inherit;
}

body[data-path="message"].rchs-message-error .page-card-head .indicator::before {
	display: none;
}

body[data-path="message"].rchs-message-error .page-card-body {
	color: var(--rchs-muted);
	font-size: 14.5px;
	line-height: 1.6;
}

body[data-path="message"].rchs-message-error .page-card-body p {
	margin: 0 0 22px;
}

body[data-path="message"].rchs-message-error .btn-primary {
	width: 100%;
	min-width: 0;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: 'Space Grotesk', sans-serif;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	background: linear-gradient(135deg, var(--rchs-blue) 0%, var(--rchs-blue-dark) 100%);
	border: none;
	border-radius: var(--rchs-radius-sm);
	padding: 13px 24px;
	box-shadow: 0 8px 20px rgba(7, 105, 178, .28);
	transition: transform .15s var(--rchs-ease), box-shadow .15s var(--rchs-ease), filter .15s var(--rchs-ease);
}

body[data-path="message"].rchs-message-error .btn-primary:hover {
	filter: brightness(1.05);
	box-shadow: 0 10px 24px rgba(7, 105, 178, .36);
	transform: translateY(-1px);
	color: #fff !important;
}

/* ============================================================
 * Student-only 404 ("student-not-found" kind in login_theme.js). Only
 * reached for the Student role hitting an invalid /app/<route>, never for
 * any other role or any other message type (those keep the plain default
 * Frappe design, or .rchs-message-error above, exactly as before). Deliberately
 * NOT the split brand-panel shell (.rchs-brand-panel is never injected for
 * this kind) - a standalone centered card, its own distinct look rather
 * than reusing either the login layout or .rchs-message-error's.
 * ============================================================ */
body[data-path="message"].rchs-student-404 {
	font-family: 'Inter', sans-serif;
	background: var(--rchs-bg-soft);
	color: var(--rchs-navy-ink);
	-webkit-font-smoothing: antialiased;
	margin: 0;
}

html[lang^="ar"] body[data-path="message"].rchs-student-404 {
	direction: rtl;
	font-family: 'IBM Plex Sans Arabic', 'Inter', sans-serif;
}

body[data-path="message"].rchs-student-404 .navbar {
	display: none !important;
}

body[data-path="message"].rchs-student-404 .web-footer {
	display: none;
}

body[data-path="message"].rchs-student-404 .page_content {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	margin: 0;
	padding: 24px;
}

body[data-path="message"].rchs-student-404 .page-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	width: 100%;
	max-width: 400px;
	background: var(--rchs-surface);
	border: 1px solid var(--rchs-line);
	border-radius: var(--rchs-radius-md);
	box-shadow: 0 20px 44px -20px rgba(10, 32, 54, .18);
	padding: 36px 32px 32px;
}

/* Added by decorateStudentNotFound() - not part of core's message.html markup. */
body[data-path="message"].rchs-student-404 .rchs-404-logo {
	width: 40px;
	height: 40px;
	margin-bottom: 18px;
	object-fit: contain;
}

body[data-path="message"].rchs-student-404 .page-card::before {
	content: "";
	display: block;
	width: 56px;
	height: 56px;
	margin: 0 auto 20px;
	border-radius: 50%;
	background: #FFF4E5;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23D97706' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m14.5 9.5-2 5-5 2 2-5 5-2Z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 26px 26px;
}

body[data-path="message"].rchs-student-404 h5.page-card-head {
	font-family: 'Space Grotesk', sans-serif;
	font-weight: 600;
	font-size: 21px;
	letter-spacing: -.01em;
	color: var(--rchs-navy-ink);
	border: none;
	margin: 0 0 8px;
}

body[data-path="message"].rchs-student-404 .page-card-head .indicator {
	color: inherit;
	font-size: inherit;
}

body[data-path="message"].rchs-student-404 .page-card-head .indicator::before {
	display: none;
}

body[data-path="message"].rchs-student-404 .page-card-body {
	color: var(--rchs-muted);
	font-size: 14.5px;
	line-height: 1.6;
}

body[data-path="message"].rchs-student-404 .page-card-body p {
	margin: 0 0 16px;
}

/* Added by decorateStudentNotFound() - the attempted /app/... path. */
body[data-path="message"].rchs-student-404 .rchs-404-path {
	display: block;
	margin: 0 0 20px;
	padding: 6px 12px;
	border-radius: 6px;
	background: var(--rchs-bg-soft);
	border: 1px solid var(--rchs-line);
	font-family: monospace;
	font-size: 12.5px;
	color: var(--rchs-muted);
	word-break: break-all;
}

body[data-path="message"].rchs-student-404 .btn-primary {
	width: 100%;
	min-width: 0;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: 'Space Grotesk', sans-serif;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	background: linear-gradient(135deg, var(--rchs-blue) 0%, var(--rchs-blue-dark) 100%);
	border: none;
	border-radius: var(--rchs-radius-sm);
	padding: 13px 24px;
	box-shadow: 0 8px 20px rgba(7, 105, 178, .28);
	transition: transform .15s var(--rchs-ease), box-shadow .15s var(--rchs-ease), filter .15s var(--rchs-ease);
}

body[data-path="message"].rchs-student-404 .btn-primary:hover {
	filter: brightness(1.05);
	box-shadow: 0 10px 24px rgba(7, 105, 178, .36);
	transform: translateY(-1px);
	color: #fff !important;
}

/* core's own "Status: 404" line - redundant next to the attempted-path
   chip above, which already communicates the same thing more usefully. */
body[data-path="message"].rchs-student-404 p.text-muted.text-center.small {
	display: none;
}
