/* ==========================================================================
   orglx-login.css - the Orglx sign-in pages (Views/Home/LoginAr.cshtml and Login.cshtml).
   The DMS estate sign-in (DMS_ERP / SocialPlus / HorsePlus): the photo on the LEFT and the form on the RIGHT in
   both languages, our logo and the client's side by side, floating-label fields (loginStyle.css) with the eye on
   the password, the two-segment language pill, and the copyright line at the foot of the form panel.
   Loads after loginStyle.css. Logical properties only, so one file serves Arabic (RTL) and English (LTR).
   ========================================================================== */

/* Tajawal in both languages, as on the estate sign-in pages */
.login,
.login button,
.login input {
  font-family: 'Tajawal', 'Open Sans', 'Segoe UI', sans-serif;
}

/* ------------------------------ photo ------------------------------------ */
/* The HR-journey picture runs its eight steps from edge to edge, so `cover` on the tall panel would cut the first
   and last step. The whole picture sits in the middle at the panel's width (::after, edges faded), and the same
   picture, blurred, fills the panel around it (::before). No text over the photo. */
.bg-image.orglx-photo {
  position: relative;
  overflow: hidden;
  background-image: none;
  background-color: #eaf1f8;
}

.bg-image.orglx-photo::before {
  content: "";
  position: absolute;
  inset: -60px;
  background: url('../images/orglx/login-bg.jpg') center / cover no-repeat;
  filter: blur(30px);
}

.bg-image.orglx-photo::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 50%;
  transform: translateY(-50%);
  aspect-ratio: 1536 / 1024;
  background: url('../images/orglx/login-bg.jpg') center / cover no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 91%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 91%, transparent 100%);
}

/* ------------------------------ logos ------------------------------------ */
/* Ours (Orglx) and the client's (HHA) side by side, a thin rule between them. `direction: ltr` pins the order in
   both languages - ours on the left, the client's on the right (as HorsePlus pins its logo row). The logos shrink
   rather than wrap. */
.logo-row {
  display: flex;
  direction: ltr;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: nowrap;
}

.logo-row img {
  width: auto;
  min-width: 0;
  flex: 0 1 auto;
  object-fit: contain;
}

/* The row spans the panel's full width (about 456px at 1440px): ours ~79px wide, the client's ~231px */
.logo-row .login-logo {
  height: 84px;           /* orglx-logo.png, 378x400 */
}

.logo-row .client-logo {
  height: 42px;           /* hha-logo.png, 840x153 (5.5 : 1) */
}

.logo-row-rule {
  flex: none;
  width: 1px;
  height: 60px;
  background: #dfe5ec;
}

@media (min-width: 1600px) {
  .logo-row .login-logo { height: 96px; }
  .logo-row .client-logo { height: 48px; }
  .logo-row-rule { height: 68px; }
}

@media (max-width: 575.98px) {
  .logo-row { gap: 14px; }
  .logo-row .login-logo { height: 70px; }
  .logo-row .client-logo { height: 36px; }
  .logo-row-rule { height: 50px; }
}

/* ------------------------------ show / hide password ---------------------- */
/* An overlay, not a Bootstrap .input-group: the floating label in loginStyle.css depends on the input being a
   direct child of .form-label-group (padding, the rising label, the .invalid-feedback message). */
.pw-toggle {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  padding: var(--input-padding-y, .75rem) 1rem;
  border: 0;
  background: transparent;
  color: #777;
  font-size: 1rem;
  line-height: 1.5;
  cursor: pointer;
  z-index: 3;             /* the overlay <label> is 100% wide; without this it takes the click */
}

.pw-toggle:hover,
.pw-toggle:focus-visible {
  color: #055e99;
  outline: none;
}

.pw-toggle > i {
  margin: 0;
}

/* Room for the eye on the END side only, so "Password" lines up with "Username" above it */
.form-label-group > input.has-pw-toggle,
.form-label-group > input.has-pw-toggle ~ label {
  padding-inline-end: 3rem;
}

/* ------------------------------ language pill ----------------------------- */
/* Two segments, each language written in its own script, so someone who cannot read the current language still
   finds the other. The two sign-in pages are separate views, so the segments are links. */
.lang-switch {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lang-toggle {
  --lang-dir: 1;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: 210px;
  padding: 4px;
  border-radius: 999px;
  background: #eef1f5;
  box-shadow: inset 0 1px 2px rgba(5, 35, 81, .09);
}

/* A transform is not direction-aware: under RTL the thumb travels the other way */
.login-container[dir="rtl"] .lang-toggle {
  --lang-dir: -1;
}

.lang-toggle__thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  inset-inline-start: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(5, 35, 81, .18);
  pointer-events: none;
}

.lang-toggle[data-active="en"] .lang-toggle__thumb {
  transform: translateX(calc(var(--lang-dir) * 100%));
}

.lang-toggle__option {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: .35rem .9rem;
  border-radius: 999px;
  font-family: 'Tajawal', 'Segoe UI', sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: #6b7680;
  text-decoration: none;
  transition: color .2s ease;
}

.lang-toggle__option[aria-current="page"] {
  color: #055e99;
  cursor: default;
}

.lang-toggle__option:not([aria-current="page"]):hover {
  color: #052351;
  text-decoration: none;
}

.lang-toggle__option:focus-visible {
  outline: 2px solid #055e99;
  outline-offset: 2px;
}

/* ------------------------------ copyright -------------------------------- */
/* Centred at the foot of the form panel (not the viewport) */
.login {
  position: relative;
}

.login-copyright {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 1rem;
  text-align: center;
  font-size: 13px;
  color: #3f7cc8;
}
