/**
 * Branded login page styles (shahbandr-core LoginPage).
 *
 * Standalone — this page renders outside the admin SPA and the theme, so nothing
 * here relies on Tailwind or the app bundle. Brand color tokens (`--sh-blue-*`)
 * and the UI font (`--sh-font-sans`) are injected inline by BrandService scoped
 * to `.sh-login`; every value below falls back to a sensible default so a brand
 * that ships no tokens (e.g. Shahbandr today) still renders correctly.
 *
 * Layout mirrors the Figma. Direction-agnostic: logical properties keep it
 * correct in RTL (Arabic) without a separate rule block.
 */

*,
*::before,
*::after {
	box-sizing: border-box;
}

.sh-login {
	min-height: 100vh;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 48px 24px 96px;
	font-family: var( --sh-font-sans, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif );
	color: #0f172a;
	background-color: #050b1f;
	/* Fallback gradient for brands with no login image; the brand image (set
	   inline on <body>) paints over this when present. */
	background-image: radial-gradient( 120% 120% at 68% 34%, #17419a 0%, #0a1f4d 42%, #050b1f 100% );
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	background-attachment: fixed;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

/**
 * Figma specifies Inter. Force it as the primary UI font on the login surface.
 * BrandService injects the brand font stack onto `.sh-login` inline (leading with
 * `Saudi Riyal` for the SPA's currency glyph) — not wanted here, and a system-
 * installed `Saudi Riyal` could hijack the Latin text. The higher-specificity
 * `body.sh-login` selector wins over that `.sh-login` block regardless of the
 * inline <style> order. The Inter @font-face is still supplied by the brand, so
 * this only reorders the stack. Arabic + system faces stay as fallbacks.
 */
body.sh-login {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Expo Arabic', 'Helvetica Neue', Arial, sans-serif;
}

.sh-login__wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 32px;
	width: 100%;
}

/* -- Brand logo (above the card) -------------------------------------------- */

.sh-login__logo {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
}

.sh-login__logo img {
	display: block;
	height: 84px;
	width: auto;
	max-width: 280px;
}

.sh-login__logo-icon {
	height: 72px !important;
}

.sh-login__logo-text {
	font-size: 34px;
	font-weight: 700;
	letter-spacing: -0.5px;
	color: #ffffff;
}

/* -- Card ------------------------------------------------------------------- */

.sh-login__card {
	width: 475px;
	max-width: 100%;
	padding: 28px 24px;
	display: flex;
	flex-direction: column;
	gap: 28px;
	background: #f8f9fc;
	border-radius: 32px;
	box-shadow: 0 24px 60px -20px rgba( 3, 8, 28, 0.55 );
}

.sh-login__head {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.sh-login__title {
	margin: 0;
	font-size: 32px;
	line-height: 1.31;
	font-weight: 600;
	letter-spacing: -0.56px;
	color: #0f172a;
}

.sh-login__subtitle {
	margin: 0;
	font-size: 16px;
	line-height: 1.5;
	font-weight: 400;
	color: #64748b;
}

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

.sh-login__form {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.sh-login__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.sh-login__label {
	font-size: 16px;
	line-height: 1.25;
	font-weight: 500;
	color: #374151;
}

.sh-login__req {
	color: #ef4444;
	margin-inline-start: 2px;
}

.sh-login__input {
	width: 100%;
	height: 48px;
	padding: 0 16px;
	font-size: 14px;
	font-family: inherit;
	color: #1a1a2e;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sh-login__input::placeholder {
	color: rgba( 26, 26, 46, 0.5 );
}

.sh-login__input:focus {
	border-color: var( --sh-blue-600, #0870ff );
	box-shadow: 0 0 0 3px rgba( 8, 112, 255, 0.15 );
}

/* Password field + show/hide eye */

.sh-login__password {
	position: relative;
	display: flex;
	align-items: center;
}

.sh-login__password .sh-login__input {
	padding-inline-end: 46px;
}

.sh-login__eye {
	position: absolute;
	inset-inline-end: 8px;
	top: 50%;
	transform: translateY( -50% );
	width: 34px;
	height: 34px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	background: transparent;
	color: #64748b;
	cursor: pointer;
	border-radius: 8px;
}

.sh-login__eye:hover {
	color: #334155;
}

.sh-login__eye:focus-visible {
	outline: 2px solid var( --sh-blue-600, #0870ff );
	outline-offset: 1px;
}

.sh-login__eye svg {
	width: 18px;
	height: 18px;
}

.sh-login__eye .sh-login__eye-closed {
	display: none;
}

.sh-login__eye[aria-pressed='true'] .sh-login__eye-open {
	display: none;
}

.sh-login__eye[aria-pressed='true'] .sh-login__eye-closed {
	display: block;
}

.sh-login__forgot {
	align-self: flex-end;
	margin-top: 2px;
	font-size: 14px;
	color: #2563eb;
	text-decoration: none;
}

.sh-login__forgot:hover {
	text-decoration: underline;
}

/* -- Button ----------------------------------------------------------------- */

.sh-login__button {
	width: 100%;
	height: 48px;
	margin-top: 4px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.5;
	color: #ffffff;
	background: var( --sh-blue-600, #0870ff );
	border: 1px solid transparent;
	border-radius: 14px;
	cursor: pointer;
	transition: background-color 0.15s ease, opacity 0.15s ease;
}

.sh-login__button:hover {
	background: var( --sh-blue-700, #0760db );
}

.sh-login__button:active {
	opacity: 0.9;
}

.sh-login__button--ghost {
	color: var( --sh-blue-600, #0870ff );
	background: transparent;
	border-color: #e2e8f0;
}

.sh-login__button--ghost:hover {
	background: #eef2ff;
}

.sh-login__back {
	display: block;
	margin-top: 4px;
	text-align: center;
	font-size: 14px;
	color: #64748b;
	text-decoration: none;
}

.sh-login__back:hover {
	color: #334155;
}

/* -- Notices ---------------------------------------------------------------- */

.sh-login__notice {
	padding: 12px 16px;
	border-radius: 12px;
	font-size: 14px;
	line-height: 1.4;
	border: 1px solid transparent;
}

.sh-login__notice--error {
	color: #b91c1c;
	background: #fef2f2;
	border-color: #fecaca;
}

.sh-login__notice--success {
	color: #15803d;
	background: #f0fdf4;
	border-color: #bbf7d0;
}

.sh-login__notice--info {
	color: #475569;
	background: #f8fafc;
	border-color: #e2e8f0;
}

/* -- Small screens ---------------------------------------------------------- */

@media ( max-width: 520px ) {
	.sh-login__card {
		border-radius: 24px;
		padding: 24px 18px;
	}

	.sh-login__title {
		font-size: 28px;
	}

	.sh-login__logo img {
		height: 68px;
	}
}
