/* BitsAuto sign-in page restyle (front door, presentation only) — owner reference: SC Mobile Pakistan's launch screen.
   Full-screen landmark photos with a slow push-in behind everything, dark fade top (logo + welcome) and bottom (form),
   no text on the pictures. Loaded only on /accounts/login/ (nginx map $ba_login_head). BitsAuto's own form, fields,
   buttons and the token step keep their ids/names; this file only changes how they look. */
body.loginPage {
  --bl-ink: #FFFFFF;
  --bl-muted: rgba(255, 255, 255, .78);
  --bl-faint: rgba(255, 255, 255, .6);
  --bl-glass: rgba(255, 255, 255, .14);
  --bl-glass-line: rgba(255, 255, 255, .34);
  --bl-accent: #E0409D;          /* BitsWits magenta */
  --bl-accent-2: #6D4AE0;        /* BitsWits violet  */
  --bl-night: #0B1020;
  --bl-danger: #B42345;
  --bl-danger-bg: #FDEFF3;
  --bl-font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bl-night) !important;
  background-image: none !important;
  color: var(--bl-ink) !important;
  font-family: var(--bl-font) !important;
  min-height: 100vh;
  margin: 0 !important;
  overflow-x: hidden;
}
html.bl-on, html.bl-on body.loginPage { background: #0B1020 !important; }
body.loginPage *, body.loginPage *::before, body.loginPage *::after { box-sizing: border-box; }

/* ---- background: photos fill the screen behind everything ---- */
.bl-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; background: #1A2238; }
.bl-map { position: absolute; inset: 0; transition: opacity 1.2s ease; }
.bl-map svg { position: absolute; left: 50%; top: 50%; width: max(140vw, 1500px); height: auto; transform: translate(-56%, -46%); }
.bl-map .bl-land { fill: #2A3350; }
.bl-map .bl-pk { fill: #5B3F73; }
body.bl-photos .bl-map { opacity: 0; }
.bl-photo { position: absolute; inset: 0; background-size: cover; background-position: var(--pos, 50% 50%); opacity: 0;
  transition: opacity 1.4s ease; will-change: opacity, transform; transform-origin: 50% 70%; }
.bl-photo.on { opacity: 1; z-index: 2; animation: bl-push 7s cubic-bezier(.25, .1, .25, 1) forwards; }
.bl-photo.off { opacity: 0; z-index: 1; animation: bl-push-out 1.6s linear forwards; }
@keyframes bl-push { from { transform: scale(1.02) translateY(1.5%); } to { transform: scale(1.14) translateY(-1%); } }
@keyframes bl-push-out { from { transform: scale(1.14) translateY(-1%); } to { transform: scale(1.17) translateY(-1.4%); } }
/* dark fade top (logo, welcome) and bottom (form); the middle of the picture stays clear */
.bl-wash { position: absolute; inset: 0; z-index: 3;
  background:
    linear-gradient(180deg, rgba(8, 11, 24, .62) 0%, rgba(8, 11, 24, .18) 26%, rgba(8, 11, 24, 0) 42%, rgba(8, 11, 24, 0) 52%, rgba(8, 11, 24, .55) 78%, rgba(8, 11, 24, .82) 100%); }

/* ---- layout: BitsAuto's own markup, laid over the photos ---- */
body.loginPage .D-container { position: relative; z-index: 2; display: block !important; width: 100% !important; height: auto !important; min-height: 100vh; min-height: 100svh; }
body.loginPage .ba-login { display: flex !important; flex-direction: column; width: 100%; min-height: 100vh; min-height: 100svh; text-align: left !important;
  padding: max(28px, env(safe-area-inset-top)) clamp(20px, 6vw, 88px) max(22px, env(safe-area-inset-bottom)); }
body.loginPage .ba-login > img { content: url(/bitsauto-app/logo-bitswits-dark.png) !important; width: 190px !important; max-width: 56% !important; height: auto !important;
  margin: 0 !important; align-self: flex-start; filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .35)); }
.bl-head { margin-top: clamp(28px, 8vh, 90px); max-width: 560px; }
.bl-head h1 { margin: 0; font: 600 clamp(30px, 4.6vw, 46px)/1.12 var(--bl-font); letter-spacing: -.02em; color: #FFF; text-wrap: balance;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .35); }
.bl-head h1 .d1, .bl-head h1 .d2 { display: inline-block; width: .32em; height: .22em; border-radius: 0 60% 60% 0 / 0 50% 50% 0; vertical-align: .18em; }
.bl-head h1 .d1 { background: var(--bl-accent-2); margin-right: .22em; transform: scaleX(-1); }
.bl-head h1 .d2 { background: var(--bl-accent); margin-left: .18em; }
.bl-head p { margin: 10px 0 0; font: 400 15px/1.5 var(--bl-font); color: var(--bl-muted); text-shadow: 0 1px 10px rgba(0, 0, 0, .35); }
body.loginPage .ba-login .ba-login-container { margin: auto 0 0 !important; width: 100%; max-width: 420px; background: transparent !important; box-shadow: none !important;
  padding: 0 !important; border-radius: 0 !important; }

/* first screen: only the Sign in button; the fields slide up when it is pressed */
body.loginPage .bl-intro-btn { display: none; }
body.loginPage.bl-intro .bl-intro-btn { display: flex; align-items: center; justify-content: center; width: 100%; height: 54px; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(90deg, var(--bl-accent-2), var(--bl-accent)); color: #FFF; font: 600 17px/1 var(--bl-font); letter-spacing: .01em;
  box-shadow: 0 14px 30px -14px rgba(224, 64, 157, .8); transition: transform .12s ease, filter .2s ease; }
body.loginPage.bl-intro .bl-intro-btn:hover { filter: brightness(1.07); }
body.loginPage.bl-intro .bl-intro-btn:active { transform: translateY(1px); }
body.loginPage.bl-intro .bl-intro-btn:focus-visible { outline: 3px solid #FFF; outline-offset: 3px; }
/* no flash of the fields while the page loads: hidden from the first paint until login.js has decided;
   if login.js never runs, they appear by themselves after 10 s (nobody is locked out) */
body.loginPage #login_form { visibility: hidden; animation: bl-failsafe 0s 10s forwards; }
@keyframes bl-failsafe { to { visibility: visible; } }
body.loginPage.bl-ready #login_form { visibility: visible; animation: none; }
body.loginPage.bl-intro #login_form { display: none !important; }
body.loginPage.bl-ready.bl-open #login_form { animation: bl-rise .45s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes bl-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* fields: glass on the photo */
body.loginPage .ui.form2 .field { margin: 0 0 12px !important; }
body.loginPage .bl-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body.loginPage .ui.form2 .field input:not([type="checkbox"]):not([type="radio"]) {
  height: 54px !important; max-height: none !important; font: 400 16px/1 var(--bl-font) !important; color: #FFF !important;
  padding: 0 20px !important; background: var(--bl-glass) !important; border: 1px solid var(--bl-glass-line) !important; border-radius: 999px !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: none !important; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
body.loginPage .ui.form2 .field input:not([type="checkbox"]):not([type="radio"]):focus {
  background: rgba(255, 255, 255, .22) !important; border-color: #FFF !important; box-shadow: 0 0 0 4px rgba(224, 64, 157, .35) !important; outline: none !important; }
body.loginPage .ui.form2 .field input::placeholder { color: rgba(255, 255, 255, .78) !important; }
body.loginPage .ui.form2 .field input:-webkit-autofill { -webkit-box-shadow: 0 0 0 100px rgba(40, 46, 70, .96) inset !important; -webkit-text-fill-color: #FFF !important; caret-color: #FFF; }
body.loginPage .bl-pw { position: relative; }
body.loginPage .bl-pw input { padding-right: 76px !important; }
body.loginPage .bl-eye { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); height: 34px; padding: 0 12px; border: 0; border-radius: 999px;
  background: transparent; font: 600 13px/34px var(--bl-font); color: #FFF; cursor: pointer; }
body.loginPage .bl-eye:hover { background: rgba(255, 255, 255, .14); }
body.loginPage .bl-eye:focus-visible { outline: 2px solid #FFF; outline-offset: 1px; }
/* primary button: a pill, like the reference */
body.loginPage .ui.form2 .field .ui.button[name="done"] {
  display: flex !important; align-items: center; justify-content: center; gap: 10px; height: 54px; margin: 4px 0 0 !important; padding: 0 !important;
  background: linear-gradient(90deg, var(--bl-accent-2), var(--bl-accent)) !important; color: #FFF !important; border-radius: 999px !important; border: 0 !important;
  font: 600 17px/1 var(--bl-font) !important; letter-spacing: .01em; text-shadow: none !important; box-shadow: 0 14px 30px -14px rgba(224, 64, 157, .8) !important;
  transition: transform .12s ease, filter .2s ease; }
body.loginPage .ui.form2 .field .ui.button[name="done"]:hover { filter: brightness(1.07); }
body.loginPage .ui.form2 .field .ui.button[name="done"]:active { transform: translateY(1px); }
body.loginPage .ui.form2 .field .ui.button[name="done"]:focus-visible { outline: 3px solid #FFF !important; outline-offset: 3px; }
body.loginPage.bl-busy .ui.form2 .field .ui.button[name="done"] { pointer-events: none; filter: saturate(.7); }
body.loginPage.bl-busy .ui.form2 .field .ui.button[name="done"]::after { content: ""; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .4); border-top-color: #FFF; animation: bl-spin .7s linear infinite; }
@keyframes bl-spin { to { transform: rotate(360deg); } }
body.loginPage #pre_loader { display: none !important; }
body.loginPage .alert.alert-danger { display: flex; gap: 8px; align-items: flex-start; margin: 2px 0 12px !important; padding: 12px 16px !important;
  border: 0 !important; border-radius: 18px !important; background: var(--bl-danger-bg) !important; color: var(--bl-danger) !important;
  font: 500 14px/1.4 var(--bl-font) !important; box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .5) !important; }
body.loginPage .alert.alert-danger .glyphicon { display: none; }
body.loginPage .alert.alert-danger::before { content: "!"; flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--bl-danger); color: #FFF; font: 700 12px/18px var(--bl-font); text-align: center; }
/* token step (second screen) */
body.loginPage #auth_form .qrcode { display: flex; justify-content: center; margin-bottom: 14px !important; }
body.loginPage #auth_form .qrcode img { padding: 10px; background: #FFF; border-radius: 16px; }
body.loginPage #auth_form #token { letter-spacing: .32em; font-variant-numeric: tabular-nums; text-align: center; }
body.loginPage .ba-login > .center.aligned.column { margin-top: 16px; text-align: left; max-width: 420px;
  font: 400 12px/1.5 var(--bl-font) !important; color: var(--bl-faint) !important; }
body.loginPage .ba-login > .center.aligned.column a { color: #FFF !important; text-decoration: none; font-weight: 600; }

/* the app's bottom bar (Back / Bits Dashboard) and its end-of-page room are not for the sign-in page: they made the
   page taller than the screen, so it scrolled and pushed the logo under the iPhone status bar (5 Oct 2026) */
body.loginPage #bam-appbar { display: none !important; }
html.bam-hasbar body.loginPage::after { display: none !important; content: none !important; height: 0 !important; }
body.loginPage.bl-intro { overflow: hidden !important; height: 100vh; height: 100svh; }

/* ---- wide screens: logo + welcome top-left, the form bottom-left, the landmark fills the rest ---- */
@media (min-width: 900px) {
  .bl-wash { background:
      linear-gradient(90deg, rgba(8, 11, 24, .7) 0%, rgba(8, 11, 24, .38) 30%, rgba(8, 11, 24, 0) 55%),
      linear-gradient(180deg, rgba(8, 11, 24, .35) 0%, rgba(8, 11, 24, 0) 30%, rgba(8, 11, 24, 0) 70%, rgba(8, 11, 24, .45) 100%); }
  .bl-photo { transform-origin: 65% 60%; }
}
@media (prefers-reduced-motion: reduce) {
  .bl-photo, .bl-map { transition: opacity .01s; }
  .bl-photo.on, .bl-photo.off, body.loginPage.bl-ready.bl-open #login_form { animation: none; }
}

/* >>> ba-block token-step (8 Nov 2026, package p3-signin-token-step; remove with that package's undo) */
/* ===== Sign-in STEP 2 ("token page", theme step 7, 8 Nov 2026): same look as step 1 — presentation only =====
   BitsAuto builds step 2 itself inside #auth_form (QR code on first sign-in, field #token, button name=done) and handles it;
   this only dresses it: step pill, enrolment help under the QR, a large code field, no stray first-screen button. */
body.loginPage.bl-step2 .bl-intro-btn { display: none !important; }
body.loginPage.bl-step2 #auth_form { animation: bl-rise .45s cubic-bezier(.2, .8, .2, 1) both; }
body.loginPage .bl-head .bl-step { display: inline-flex; align-items: center; margin: 0 0 14px; padding: 5px 12px; border-radius: 999px;
  background: var(--bl-glass); border: 1px solid var(--bl-glass-line); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  font: 600 12px/1.3 var(--bl-font); letter-spacing: .08em; text-transform: uppercase; color: #FFF; }
body.loginPage .bl-head[data-step="2"] h1 { font-size: clamp(28px, 4vw, 40px); }
body.loginPage #auth_form .qrcode { flex-direction: column; align-items: center; gap: 10px; }
body.loginPage #auth_form .qrcode.bl-noqr { display: none !important; }
body.loginPage #auth_form .qrcode img { width: 186px !important; height: 186px !important; padding: 12px; background: #FFF; border-radius: 18px;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .7); }
body.loginPage #auth_form .bl-qr-help { margin: 0; max-width: 360px; font: 400 14px/1.5 var(--bl-font); color: var(--bl-muted); text-align: center;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .35); }
body.loginPage #auth_form #token { width: 100% !important; height: 60px !important; font: 600 26px/1 ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace !important;
  letter-spacing: .42em !important; text-indent: .42em; text-align: center; caret-color: #FFF; }
body.loginPage #auth_form #token::placeholder { font: 400 15px/1 var(--bl-font); letter-spacing: 0; text-indent: 0; color: rgba(255, 255, 255, .78) !important; }
body.loginPage #auth_form .ui.button[name="done"] { text-decoration: none !important; }
@media (prefers-reduced-motion: reduce) { body.loginPage.bl-step2 #auth_form { animation: none; } }
/* <<< ba-block token-step */
