/* ---------------------------------------------------------------------------
   Sign-in screen — split in two: the form on the start side over the company
   mark, the Kingdom Tower / Vision 2030 panel on the end side.
   --------------------------------------------------------------------------- */
.login-body { margin: 0; overflow: hidden; }

.signin {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  background: #fff;
}

/* ── form side ── */
.signin-form-side {
  position: relative;
  display: grid;
  place-items: center;
  padding: 40px 28px;
  overflow: hidden;
  background: #fff;
}
.signin-watermark {
  position: absolute;
  inset: 0;
  background: url("../img/brand/logo-mark.4f4da0e791bf.png") no-repeat center center;
  background-size: min(52%, 380px);
  opacity: .035;
  pointer-events: none;
}
.signin-card {
  position: relative;
  width: min(430px, 100%);
  display: grid;
  gap: 14px;
}
.signin-logo { width: 232px; height: auto; margin: 0 auto 4px; display: block; }
.signin-title {
  margin: 0;
  text-align: center;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--brand-red);
}
.signin-sub {
  margin: -8px 0 6px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}
.signin-card .field { display: grid; gap: 6px; }
.signin-card .label { font-size: 13px; font-weight: 700; color: #3f3234; }
.signin-card .input {
  height: 46px;
  border-radius: 10px;
  border: 1px solid #e2d6d7;
  background: #fdfbfb;
  padding-inline: 14px;
  font-size: 15px;
}
.signin-card .input:focus {
  outline: 0;
  border-color: var(--brand-red);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(168, 28, 34, .12);
}
/* الدخول بنفاذ — the national single sign-on button */
.signin-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 52px;
  margin-top: 6px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 800;
}
/* ── brand side ── */
/* The brand half is a photograph of برج المملكة with a burgundy wash over it,
   so the white lockup and the رؤية 2030 badge stay legible on any crop. */
/* Brand half: the photograph is shown whole and unstretched. A blurred,
   darkened copy of the same shot fills the panel behind it, so the frame is
   complete on any screen shape without letterbox bars or distortion. */
.signin-brand-side {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  /* Deeper bottom padding lifts the logo, flag and kingdom name off the
     edge of the frame. */
  padding: 26px 28px 88px;
  overflow: hidden;
  isolation: isolate;
  background: var(--brand-maroon);
}
.signin-photo { position: absolute; inset: 0; z-index: -1; }
.signin-photo::before,
.signin-photo::after { content: ""; position: absolute; inset: 0; }
/* backdrop: same photo, scaled to fill, blurred out of focus */
.signin-photo::before {
  background: url("../img/brand/kingdom-tower.b279bf1744e0.jpg") center/cover no-repeat;
  filter: blur(34px) saturate(.75) brightness(.42);
  transform: scale(1.18);
}
/* the photograph itself, complete and at its true proportions */
.signin-photo::after {
  background: url("../img/brand/kingdom-tower.b279bf1744e0.jpg") center/contain no-repeat;
}
/* brand wash, sitting above both so the copy stays readable */
.signin-brand-side::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(28, 8, 9, .72) 0%,
    rgba(28, 8, 9, .34) 14%,
    rgba(51, 10, 12, .10) 32%,
    rgba(78, 16, 19, .26) 58%,
    rgba(66, 13, 15, .74) 80%,
    rgba(41, 9, 11, .95) 100%);
}

/* رؤية 2030 — set at the top of the panel as its own emblem */
.signin-vision {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 9px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .34);
  background: rgba(20, 8, 9, .34);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  color: #fff;
}
.signin-vision-ar { font-size: 16px; font-weight: 700; letter-spacing: .2px; }
.signin-vision-rule {
  width: 1px;
  height: 18px;
  background: linear-gradient(180deg, transparent, var(--brand-gold), transparent);
}
.signin-vision-num {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--brand-gold);
}

.signin-vision { justify-self: start; margin-inline-start: 6px; }
.signin-brand-copy { position: relative; z-index: 1; grid-row: 3; display: grid; justify-items: center; gap: 10px; text-align: center; }
.signin-brand-logo { width: 240px; height: auto; }
.signin-vision {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 18px;
  border: 1.5px solid rgba(255, 255, 255, .45);
  border-radius: 999px;
  color: #fff;
}
.signin-vision strong { font-size: 17px; font-weight: 800; }
.signin-vision span { font-size: 21px; font-weight: 800; letter-spacing: 1px; }
.signin-brand-note {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: rgba(255, 255, 255, .95);
}
/* The national flag carries the shahada, so it is never mirrored, rotated or
   stretched — fixed 3:2, upright, and only ever scaled as a whole. */
.signin-flag {
  width: 48px;
  height: 32px;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .40), 0 3px 10px rgba(0, 0, 0, .45);
  object-fit: contain;
}
.signin-brand-copy { text-shadow: 0 2px 14px rgba(0, 0, 0, .45); }
.signin-brand-logo { filter: drop-shadow(0 4px 14px rgba(0, 0, 0, .4)); }

/* الدخول بنفاذ — present but switched off until the national SSO is wired. */
.signin-nafath {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 46px;
  border-radius: 10px;
  border: 1.5px solid #e2d6d7;
  background: #fbf7f7;
  color: #9b8a8c;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: not-allowed;
}
.signin-soon {
  padding: 2px 9px;
  border-radius: 999px;
  background: #efe4e4;
  color: #8b7a7c;
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 900px) {
  .login-body { overflow: auto; }
  .signin { grid-template-columns: 1fr; min-height: 100dvh; }
  /* Stacked: the strip is short and wide, so a contained portrait would be a
     sliver. Fill it instead, framed on the skyline. */
  .signin-brand-side {
    order: -1;
    min-height: 230px;
    padding: 18px 20px 22px;
    grid-template-rows: auto 1fr auto;
  }
  .signin-photo::before { filter: none; transform: none; }
  .signin-photo::after {
    background-size: cover;
    background-position: center 34%;
  }
  .signin-vision { padding: 7px 16px; }
  .signin-vision-ar { font-size: 14px; }
  .signin-vision-num { font-size: 19px; }
  .signin-flag { width: 40px; height: 27px; }
  .signin-brand-logo { width: 180px; }
  .signin-form-side { padding: 28px 20px 40px; }
}

/* Which product this sign-in is for — the three share one login screen. */
.signin-system {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 2px 0 14px; padding: 7px 14px;
  border-radius: 999px; border: 1px solid #f0dcdd;
  background: #fdf4f4; color: var(--brand-maroon, #691619);
  font-size: 12.5px; font-weight: 700;
}
.signin-system strong { font-weight: 800; }
.signin-system[data-system="inventory"] {
  border-color: #d6dbe2; background: #f3f5f8; color: #1f2937;
}
.signin-system[data-system="maintenance"] {
  border-color: #bfe0d8; background: #eef8f5; color: #0a4f43;
}

/* ── choosing the product before signing in ─────────────────────────────── */
.signin-picker { width: 100%; margin: 4px 0 14px; }
.signin-picker-label {
  display: block; margin-bottom: 7px;
  font-size: 12px; font-weight: 700; color: #8a7676;
}
.signin-picker-options { display: grid; gap: 8px; }
.signin-option { display: block; cursor: pointer; }
.signin-option input { position: absolute; opacity: 0; pointer-events: none; }
.signin-option-body {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid #ece2e2; background: #fff;
  color: #6b5b5b; transition: border-color .15s, background .15s, color .15s;
}
.signin-option:hover .signin-option-body { border-color: #e5999d; }
.signin-option-text { display: grid; line-height: 1.25; min-width: 0; }
.signin-option-text strong { font-size: 13px; font-weight: 800; }
.signin-option-text small { font-size: 10.5px; opacity: .7; direction: ltr; text-align: start; }
.signin-option input:focus-visible + .signin-option-body { outline: 2px solid #a81c22; outline-offset: 2px; }

/* The selected product colours the row in its own palette, so the choice is
   unmistakable before the credentials are typed. */
.signin-option input:checked + .signin-option-body {
  border-color: var(--brand-red, #a81c22);
  background: #fdeff0; color: var(--brand-maroon, #691619);
  box-shadow: 0 0 0 1px rgba(168, 28, 34, .18);
}
.signin-option[data-system="inventory"] input:checked + .signin-option-body {
  border-color: #334155; background: #eef2f7; color: #1f2937;
  box-shadow: 0 0 0 1px rgba(51, 65, 85, .18);
}
.signin-option[data-system="maintenance"] input:checked + .signin-option-body {
  border-color: #0f6b5c; background: #e7f5f1; color: #0a4f43;
  box-shadow: 0 0 0 1px rgba(15, 107, 92, .18);
}
@media (min-width: 420px) {
  .signin-picker-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .signin-option-body { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; }
  .signin-option-text small { display: none; }
}
/* The sign-in button takes the chosen product's colour. */
.signin-card[data-system="inventory"] .signin-submit { background: #334155; border-color: #334155; }
.signin-card[data-system="maintenance"] .signin-submit { background: #0f6b5c; border-color: #0f6b5c; }
.signin-card[data-system="inventory"] .signin-title { color: #1f2937; }
.signin-card[data-system="maintenance"] .signin-title { color: #0a4f43; }
