/* ORQEXA — login / auth screens for Frappe v16.
   Loaded by the orqexa_branding web_include_css hook.
   Enhancement layer only — Frappe's stock login still works if the JS never runs. */

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&display=swap");

:root {
	--orq-navy: #16303f;
	--orq-navy-2: #1b4152;
	--orq-teal: #178a86;
	--orq-teal-bright: #2bb7af;
	--orq-success: #1fa864;
	--orq-canvas: #eef2f4;
	--orq-ink: #16303f;
	--orq-muted: #6a7d8a;
	--orq-line: #dde4e8;
	--orq-surface: #ffffff;
	--orq-gradient-brand: linear-gradient(135deg, var(--orq-teal) 0%, var(--orq-teal-bright) 100%);
	--orq-gradient-panel: linear-gradient(160deg, var(--orq-navy) 0%, var(--orq-navy-2) 55%, var(--orq-teal) 100%);
	--orq-shadow-card: 0 1px 2px rgba(18, 49, 67, 0.06), 0 12px 32px -20px rgba(18, 49, 67, 0.3);
	--orq-shadow-brand: 0 8px 20px -10px rgba(23, 138, 134, 0.55);
}

/* ---------- page frame ---------- */
body.orqexa-auth-ready {
	margin: 0;
	min-height: 100vh;
	background: var(--orq-canvas);
	font-family: "IBM Plex Sans Arabic", ui-sans-serif, system-ui, sans-serif;
	color: var(--orq-ink);
}

body.orqexa-auth-ready .navbar,
body.orqexa-auth-ready .navbar-light,
body.orqexa-auth-ready footer,
body.orqexa-auth-ready .web-footer,
body.orqexa-auth-ready .page-header {
	display: none !important;
}

body.orqexa-auth-ready .page_content,
body.orqexa-auth-ready .main-section,
body.orqexa-auth-ready main,
body.orqexa-auth-ready #body,
body.orqexa-auth-ready .for-login,
body.orqexa-auth-ready .for-forgot,
body.orqexa-auth-ready .for-email-login,
body.orqexa-auth-ready .for-login-with-email-link,
body.orqexa-auth-ready .for-reset-password {
	display: block;
	min-height: 100vh;
	margin: 0;
	padding: 0;
	max-width: none;
}

/* full-bleed: neutralise Frappe's centered login wrappers */
body.orqexa-auth-ready #page-login .page-content,
body.orqexa-auth-ready .login-box,
body.orqexa-auth-ready .page-card-container {
	max-width: none;
	width: 100%;
	margin: 0;
	padding: 0;
}

body.orqexa-auth-ready .page-content-wrapper {
	min-height: 100vh;
	padding: 0 !important;
}

/* ---------- two-column shell (RTL: form on the right, panel on the left) ---------- */
body.orqexa-auth-ready .login-content.page-card {
	position: relative;
	display: grid;
	grid-template-columns: 1fr 1.05fr;
	width: 100%;
	min-height: 100vh;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
}

/* ---------- left: gradient brand panel (injected) ---------- */
.orqexa-panel {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	overflow: hidden;
	padding: 3.5rem;
	color: #fff;
	background-image: var(--orq-gradient-panel);
}

.orqexa-panel::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background-image:
		linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
		linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
	background-size: 56px 56px;
	-webkit-mask-image: radial-gradient(120% 90% at 70% 20%, #000 0%, transparent 75%);
	mask-image: radial-gradient(120% 90% at 70% 20%, #000 0%, transparent 75%);
}

.orqexa-panel > * { position: relative; z-index: 1; }

.orqexa-panel-brand { display: flex; align-items: center; gap: 0.625rem; }

.orqexa-panel-brand .orq-mark {
	display: grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 0.75rem;
	background: #fff;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
	overflow: hidden;
}

.orqexa-panel-brand .orq-mark img { width: 100%; height: 100%; object-fit: cover; }

.orqexa-panel-brand .orq-word {
	font-weight: 600;
	font-size: 1.25rem;
	letter-spacing: 0.22em;
}

.orqexa-panel-copy { max-width: 28rem; }

.orqexa-panel-copy h2 {
	margin: 0;
	font-size: clamp(1.9rem, 3.1vw, 2.25rem);
	font-weight: 600;
	line-height: 1.35;
	color: #fff;
}

.orqexa-panel-copy p {
	margin: 1.25rem 0 0;
	font-size: 1rem;
	line-height: 2;
	color: rgba(255, 255, 255, 0.7);
}

.orqexa-panel-foot { font-size: 0.875rem; color: rgba(255, 255, 255, 0.5); }

/* ---------- right: form column (injected wrapper) ---------- */
.orqexa-form-col {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	padding: 3rem 3.5rem;
	box-sizing: border-box;
}

.orqexa-form-inner {
	width: 100%;
	max-width: 26rem;
	margin: auto;   /* centres the block vertically inside the flex column */
}

/* header */
body.orqexa-auth-ready .page-card-head {
	display: block;
	margin: 0 0 2rem;
	padding: 0;
	border: 0;
	background: none;
	text-align: start;
}

body.orqexa-auth-ready .page-card-head .app-logo { display: none; }

body.orqexa-auth-ready .page-card-head-text { text-align: start; }

body.orqexa-auth-ready .page-card-head h4 {
	margin: 0;
	font-size: 1.875rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: var(--orq-ink);
}

body.orqexa-auth-ready .page-card-subtitle {
	margin: 0.625rem 0 0;
	font-size: 0.875rem;
	line-height: 1.8;
	color: var(--orq-muted);
}

/* the form becomes the surface card */
body.orqexa-auth-ready form.form-signin {
	margin: 0;
	padding: 2rem;
	border: 1px solid var(--orq-line);
	border-radius: 1rem;
	background: var(--orq-surface);
	box-shadow: var(--orq-shadow-card);
}

body.orqexa-auth-ready .page-card-body {
	width: 100%;
	margin: 0;
}

body.orqexa-auth-ready .form-group {
	width: 100%;
	margin-bottom: 1.25rem;
}

body.orqexa-auth-ready .form-label,
body.orqexa-auth-ready .control-label {
	display: block;
	margin-bottom: 0.5rem;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--orq-ink);
}

body.orqexa-auth-ready .email-field,
body.orqexa-auth-ready .password-field { position: relative; }

body.orqexa-auth-ready input.form-control {
	height: 3rem !important;
	min-height: 3rem !important;
	width: 100%;
	padding: 0 0.875rem;
	border: 1px solid var(--orq-line);
	border-radius: 0.75rem;
	background: var(--orq-surface);
	font-size: 0.95rem;
	color: var(--orq-ink);
	box-shadow: 0 1px 2px rgba(18, 49, 67, 0.04);
	transition: border-color 0.15s, box-shadow 0.15s;
}

body.orqexa-auth-ready #login_email,
body.orqexa-auth-ready #login_password,
body.orqexa-auth-ready input[type="email"],
body.orqexa-auth-ready input[type="password"] {
	direction: ltr;
	text-align: start;
}

body.orqexa-auth-ready input.form-control:focus {
	outline: none;
	border-color: var(--orq-teal-bright);
	box-shadow: 0 0 0 3px rgba(43, 183, 175, 0.18);
}

body.orqexa-auth-ready input.form-control::placeholder { color: rgba(106, 125, 138, 0.55); }

/* field icons: hide the decorative lock/mail, keep the password toggle as the "eye" */
body.orqexa-auth-ready .field-icon.email-icon,
body.orqexa-auth-ready .field-icon.password-icon { display: none; }

body.orqexa-auth-ready .password-field input.form-control {
	padding-left: 2.75rem !important;
	padding-right: 0.875rem !important;
}

body.orqexa-auth-ready .toggle-password {
	position: absolute;
	top: 50% !important;
	left: 0.875rem !important;
	right: auto !important;
	bottom: auto !important;
	margin: 0 !important;
	width: 1.15rem;
	height: 1.15rem;
	transform: translateY(-50%) !important;
	color: var(--orq-muted);
	cursor: pointer;
}

body.orqexa-auth-ready .toggle-password:hover { color: var(--orq-ink); }

/* password label row: label + forgot link (moved here by JS) */
.orqexa-pass-label-row {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
}

.orqexa-pass-label-row .form-label { margin-bottom: 0; }

body.orqexa-auth-ready .forgot-password-message {
	width: auto !important;
	max-width: none !important;
	flex: 0 0 auto;
	margin: 0;
	font-size: 0.75rem;
	white-space: nowrap;
}

body.orqexa-auth-ready .forgot-password-message a {
	color: var(--orq-teal);
	font-weight: 500;
	text-decoration: none;
}

body.orqexa-auth-ready .forgot-password-message a:hover { text-decoration: underline; }

body.orqexa-auth-ready .field-error {
	margin: 0.375rem 0 0;
	font-size: 0.75rem;
	color: #c0392b;
}

body.orqexa-auth-ready .login-error-banner {
	display: none;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 1rem;
	padding: 0.625rem 0.875rem;
	border-radius: 0.625rem;
	background: rgba(192, 57, 43, 0.08);
	color: #c0392b;
	font-size: 0.8rem;
}

body.orqexa-auth-ready .login-error-banner.show { display: flex; }

/* remember me (injected, cosmetic) */
.orqexa-remember {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	margin: 0.25rem 0 1rem;
	font-size: 0.875rem;
	color: var(--orq-muted);
	cursor: pointer;
	user-select: none;
}

.orqexa-remember input {
	appearance: none;
	-webkit-appearance: none;
	width: 1rem;
	height: 1rem;
	margin: 0;
	border: 1px solid var(--orq-teal);
	border-radius: 0.25rem;
	cursor: pointer;
	position: relative;
	flex: none;
}

.orqexa-remember input:checked { background: var(--orq-teal); }

.orqexa-remember input:checked::after {
	content: "";
	position: absolute;
	inset: 2px 3px;
	border: solid #fff;
	border-width: 0 0 2px 2px;
	transform: rotate(-45deg) translateY(-1px);
}

/* actions */
body.orqexa-auth-ready .page-card-actions { margin: 0; }

body.orqexa-auth-ready .btn-login,
body.orqexa-auth-ready .btn-forgot {
	width: 100%;
	height: 3rem;
	border: 0;
	border-radius: 0.75rem;
	background: var(--orq-gradient-brand) !important;
	color: #fff !important;
	font-size: 0.95rem;
	font-weight: 500;
	font-family: inherit;
	box-shadow: var(--orq-shadow-brand);
	transition: opacity 0.15s;
}

body.orqexa-auth-ready .btn-login:hover,
body.orqexa-auth-ready .btn-forgot:hover { opacity: 0.95; color: #fff; }
body.orqexa-auth-ready .btn-login:active,
body.orqexa-auth-ready .btn-forgot:active { opacity: 0.9; }

body.orqexa-auth-ready .btn-forgot:disabled,
body.orqexa-auth-ready .btn-login:disabled {
	opacity: 0.55;
	cursor: not-allowed;
}

body.orqexa-auth-ready .btn-login-with-email-link,
body.orqexa-auth-ready .btn-login-option {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 2.75rem !important;
	margin-top: 0 !important;
	padding: 0 1rem !important;
	border: 1px solid var(--orq-line) !important;
	border-radius: 0.75rem !important;
	background: #fff !important;
	color: rgba(22, 48, 63, 0.8);
	font-size: 0.875rem;
	font-weight: 500;
	text-align: center;
	text-decoration: none;
}

body.orqexa-auth-ready .btn-login-with-email-link:hover,
body.orqexa-auth-ready .btn-login-option:hover {
	color: var(--orq-teal);
	text-decoration: none;
	border-color: rgba(23, 138, 134, 0.45) !important;
	background: rgba(23, 138, 134, 0.04) !important;
}

body.orqexa-auth-ready .sign-up-message {
	margin: 1rem 0 0;
	font-size: 0.875rem;
}

body.orqexa-auth-ready .sign-up-message a,
body.orqexa-auth-ready .resend-link a {
	color: var(--orq-teal);
	font-weight: 500;
	text-decoration: none;
}

body.orqexa-auth-ready .sign-up-message a:hover,
body.orqexa-auth-ready .resend-link a:hover { text-decoration: underline; }

/* injected: status pill + column footer */
.orqexa-status {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	margin-top: 1.5rem;
	font-size: 0.75rem;
	color: var(--orq-muted);
}

.orqexa-ping { position: relative; display: inline-flex; width: 0.5rem; height: 0.5rem; }

.orqexa-ping::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 999px;
	background: rgba(31, 168, 100, 0.6);
	animation: orqexa-ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}

.orqexa-ping::after {
	content: "";
	position: relative;
	width: 0.5rem;
	height: 0.5rem;
	border-radius: 999px;
	background: var(--orq-success);
}

@keyframes orqexa-ping { 75%, 100% { transform: scale(2); opacity: 0; } }

.orqexa-col-foot { font-size: 0.75rem; text-align: center; color: rgba(106, 125, 138, 0.8); }

.orqexa-logo-mobile { display: none; text-align: center; }
.orqexa-logo-mobile img {
	width: 4rem;
	height: 4rem;
	border-radius: 1rem;
	object-fit: cover;
	box-shadow: 0 8px 24px -14px rgba(18, 49, 67, 0.5);
}

body.orqexa-auth-ready a:focus-visible,
body.orqexa-auth-ready button:focus-visible,
body.orqexa-auth-ready .toggle-password:focus-visible {
	outline: 3px solid rgba(43, 183, 175, 0.35);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.orqexa-ping::before { animation: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 991px) {
	body.orqexa-auth-ready .login-content.page-card { grid-template-columns: 1fr; }
	.orqexa-panel { display: none; }
	.orqexa-logo-mobile { display: block; margin-bottom: 1.75rem; }
	.orqexa-form-col { padding: 1.75rem 1.5rem; justify-content: center; }
}

@media (max-width: 480px) {
	body.orqexa-auth-ready form.form-signin { padding: 1.375rem; }
	body.orqexa-auth-ready .page-card-head h4 { font-size: 1.6rem; }
	body.orqexa-auth-ready .page-card-head { margin-bottom: 1.5rem; }
	.orqexa-form-col { padding-inline: 1rem; }
}
