/* ==========================================================================
   Cent Bank Mitra – BC Login
   Recreated to match approved design (logo top-left, two floating cards with
   the heritage building visible in the centre, no page scroll).
   All class/ID hooks used by bclogin.js / agentauth are preserved.
   ========================================================================== */

:root {
  --cbi-blue: #176fc1;
  --cbi-blue-dark: #075a99;
  --cbi-blue-btn: #3895eb;
  --cbi-blue-light: #e8f4fd;
  --cbi-red-brand: #e31e24;
  --cbi-text: #0f172b;
  --cbi-text-secondary: #1d293d;
  --cbi-text-muted: #62748e;
  --cbi-border: #ececec;
  --cbi-border-light: #e2e8f0;
  --cbi-success: #007a55;
  --cbi-success-bg: #ecfdf5;
  --cbi-warning-bg: #f1f5f9;
  --cbi-error: #dc2626;
  --cbi-error-bg: #fee2e2;
  --cbi-card-radius: 20px;
  --cbi-panel-shadow: 0 10px 30px rgba(15, 23, 43, 0.12);
  --cbi-card-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 1px 1px rgba(0, 0, 0, 0.06);
}

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

/* ---- CSP-safe visibility utilities (no inline styles) ------------------- */
.is-hidden { display: none !important; }
.is-visible-flex { display: flex !important; }
.is-visible-block { display: block !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Page shell -------------------------------------------------------- */
html.cbi-login-html,
html:has(body.cbi-login-page) {
  height: 100%;
  overflow: hidden;
}

body.cbi-login-page {
  /* Default UI scale (mimics browser zoom). 0.8 ≈ 80% zoom. */
  --cbi-zoom: 0.8;
  zoom: var(--cbi-zoom);
  margin: 0 !important;
  /* Height compensated so the zoomed body still fills exactly one viewport. */
  height: calc(100vh / 0.8);
  overflow: hidden;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--cbi-text);
  background: var(--cbi-blue-light) !important;
  display: flex !important;
  flex-direction: column !important;
}

.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url("/kiosk/images/cbi-mitra/bg-page.png") center center / cover no-repeat;
  pointer-events: none;
}

/* ---- Header area (in-flow bar with translucent logo card on the left) -- */
.login-header {
  position: relative;
  z-index: 10;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 14px 24px 0;
  background: transparent;
}

.login-header-inner {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  padding: 10px 22px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(15, 23, 43, 0.1);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.login-bank-logo {
  height: 36px;
  width: auto;
  min-width: 140px;
  max-width: 220px;
  display: block;
  object-fit: contain;
}

/* ---- Main stage -------------------------------------------------------- */
.login-main {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  overflow: hidden;
}

.login-layout {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: clamp(32px, 8vw, 160px);
  width: min(1180px, 94%);
  max-height: 100%;
  margin: 0 auto;
}

/* Left illustration card */
.login-panel-left {
  flex: 0 1 430px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  max-height: 100%;
  padding: 24px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--cbi-card-radius);
  box-shadow: var(--cbi-panel-shadow);
  overflow: hidden;
}

.login-illustration-img {
  width: 100%;
  height: auto;
  max-height: min(440px, calc(100vh - 130px));
  object-fit: contain;
  display: block;
}

/* Right form card */
.login-panel-right {
  flex: 0 1 470px;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px 26px;
  background: #fff;
  border: 1px solid var(--cbi-border);
  border-radius: var(--cbi-card-radius);
  box-shadow: var(--cbi-panel-shadow);
  overflow: hidden;
}

/* ---- Language selector ------------------------------------------------- */
.login-lang-wrap {
  position: absolute;
  top: 20px;
  right: 24px;
}

.login-lang-select {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--cbi-border-light);
  font-size: 13px;
  color: var(--cbi-text-secondary);
  background: #fff;
  cursor: pointer;
}

/* ---- Stepper ----------------------------------------------------------- */
.login-stepper {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
  padding-right: 84px;
  flex-shrink: 0;
}

.stepper-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.stepper-circle {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid #cad5e2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #90a1b9;
  background: #fff;
  transition: all 0.2s ease;
}

.stepper-label {
  font-size: 13px;
  font-weight: 600;
  color: #90a1b9;
  white-space: nowrap;
}

.stepper-item.active .stepper-circle,
.stepper-item.completed .stepper-circle {
  background: var(--cbi-blue);
  color: #fff;
  border-color: var(--cbi-blue);
}

.stepper-item.active .stepper-label {
  color: var(--cbi-blue);
  font-weight: 600;
}

.stepper-item.completed .stepper-label {
  color: var(--cbi-blue);
}

.stepper-item.completed .stepper-circle {
  font-size: 0;
  background-image: url("/kiosk/images/cbi-mitra/icon-check.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}

.stepper-line {
  flex: 1;
  height: 2px;
  min-width: 16px;
  margin: 0 8px;
  background: var(--cbi-border-light);
}

.stepper-item.completed + .stepper-line {
  background: var(--cbi-blue);
}

/* ---- Step containers --------------------------------------------------- */
.login-step {
  display: none;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.login-step.active {
  display: flex;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-gutter: stable;
}

.login-step-title {
  margin: 0;
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 700;
  color: var(--cbi-text);
  line-height: 1.2;
}

.login-step-subtitle {
  margin: 4px 0 0;
  font-size: clamp(13px, 1.4vw, 15px);
  color: var(--cbi-text-muted);
  line-height: 1.4;
}

/* ---- Device status ----------------------------------------------------- */
.device-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}

.device-status-header .device-status-heading {
  margin: 0;
}

.device-status-heading {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--cbi-blue);
}

.apk-download-btn {
  color: var(--cbi-blue);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(23, 111, 193, 0.08); /* 8% opacity of --cbi-blue */
  text-decoration: none;
}

.apk-download-btn:hover {
  color: #fff;
  background: var(--cbi-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(23, 111, 193, 0.25);
  text-decoration: none;
}

.apk-download-btn:active {
  transform: translateY(0);
}

.device-status-panel {
  margin-top: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(248, 250, 252, 0.7);
  border: 1px solid var(--cbi-border-light);
  border-radius: 16px;
}

.device-status-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--cbi-card-shadow);
  overflow: hidden;
}

.device-status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
}

.device-status-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-status-icon img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.device-status-info {
  flex: 1;
  min-width: 0;
}

.device-status-name {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--cbi-text-secondary);
  line-height: 1.3;
}

.device-status-desc {
  display: block;
  font-size: 13px;
  color: var(--cbi-text-muted);
  line-height: 1.3;
}

/* Status badges */
.device-status-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-checking {
  background: var(--cbi-warning-bg);
  color: var(--cbi-text-muted);
}

.badge-connected {
  background: var(--cbi-success-bg);
  color: var(--cbi-success);
}

.badge-failed {
  background: var(--cbi-error-bg);
  color: var(--cbi-error);
}

.badge-spinner,
.btn-spinner {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.badge-icon-check {
  width: 18px;
  height: 18px;
  display: none;
  flex-shrink: 0;
}

.badge-connected .badge-icon-check {
  display: block;
}

.badge-spinner.hidden,
.btn-spinner.hidden,
.badge-connected .badge-spinner,
.badge-failed .badge-spinner {
  display: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* RD progress bar */
.device-status-card--rd .device-progress-bar {
  display: none;
  margin: 0 16px 16px;
  height: 6px;
  background: var(--cbi-warning-bg);
  border-radius: 999px;
  overflow: hidden;
}

.device-status-card--rd .device-progress-bar.active {
  display: block;
}

.device-progress-fill {
  height: 100%;
  width: 50%;
  background: var(--cbi-blue);
  border-radius: 999px;
  opacity: 0.69;
  animation: progressPulse 1.5s ease-in-out infinite;
}

@keyframes progressPulse {
  0% { width: 10%; }
  50% { width: 70%; }
  100% { width: 10%; }
}

/* RD ready section / port selection */
.device-ready-section {
  margin-top: 4px;
  padding: 16px 16px 16px;
  border-top: 1px solid var(--cbi-border-light);
}

.device-ready-label {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--cbi-text-secondary);
}

.device-ready-hint {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--cbi-text-muted);
  line-height: 1.5;
}

.rd-port-select-wrap {
  margin-top: 8px;
}

.rd-port-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--cbi-border-light);
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--cbi-text-secondary);
  box-shadow: var(--cbi-card-shadow);
}

.btn-reconnect {
  margin-top: 10px;
  padding: 6px 14px;
  border: 1px solid var(--cbi-border-light);
  border-radius: 8px;
  background: #fff;
  color: var(--cbi-blue);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-reconnect:hover {
  background: #f8fafc;
}

/* Download / note helpers */
.device-download-link {
  margin-top: 12px;
  font-size: 13px;
}

.device-download-link a {
  color: var(--cbi-blue);
  text-decoration: underline;
}

.device-note {
  margin-top: 8px;
  font-size: 13px;
  color: var(--cbi-error);
}

/* Device summary banner (after verification) */
.device-summary-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  padding: 10px 14px;
  background: rgba(236, 253, 245, 0.8);
  border: 1px solid #bbf7d0;
  border-radius: 14px;
  flex-shrink: 0;
}

.device-summary-banner.is-visible-flex {
  display: flex !important;
}

.device-summary-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.device-summary-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  background: #ecfdf5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.device-summary-icon img {
  width: 20px;
  height: 20px;
}

.device-summary-title {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--cbi-text-secondary);
}

.device-summary-device {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 14px;
  color: var(--cbi-text-muted);
}

.device-summary-device.is-hidden {
  display: none !important;
}

.device-summary-device-icon {
  width: 16px;
  height: 16px;
}

.btn-change-device {
  flex-shrink: 0;
  padding: 6px 12px;
  border: 1px solid var(--cbi-border-light);
  border-radius: 8px;
  background: #fff;
  color: var(--cbi-blue);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-change-device:hover {
  background: #f8fafc;
}

/* ---- Username step ----------------------------------------------------- */
.login-field-group {
  margin-top: 16px;
  margin-bottom: 16px;
}

.login-field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--cbi-text-secondary);
}

.required-mark {
  color: var(--cbi-error);
}

.login-field-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--cbi-border-light);
  border-radius: 8px;
  font-size: 15px;
  color: var(--cbi-text-secondary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-field-input-lg {
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 15px;
}

.login-field-input:focus {
  outline: none;
  border-color: var(--cbi-blue);
  box-shadow: 0 0 0 3px rgba(23, 111, 193, 0.15);
}

.login-field-input:disabled {
  background: #f8fafc;
  color: #94a3b8;
}

.login-field-input.border-danger {
  border-color: var(--cbi-error) !important;
}

/* ---- Buttons ----------------------------------------------------------- */
.btn-login-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  margin-top: auto;
  padding: 12px 22px;
  border: none;
  border-radius: 14px;
  background: var(--cbi-blue-btn);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: var(--cbi-card-shadow);
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn-login-primary:hover:not(:disabled) {
  background: var(--cbi-blue);
}

.btn-login-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-login-secondary {
  padding: 13px 24px;
  border: 1px solid var(--cbi-border-light);
  border-radius: 8px;
  background: #fff;
  color: var(--cbi-text-secondary);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-login-secondary:hover {
  background: #f8fafc;
}

.login-actions {
  display: flex;
  gap: 12px;
  margin-top: auto;
}

.login-actions .btn-login-primary {
  flex: 2;
  margin-top: 0;
}

.login-actions .btn-login-secondary {
  flex: 1;
}

.login-actions-split {
  margin-top: auto;
  flex-shrink: 0;
}

.login-actions-split .btn-login-secondary,
.login-actions-split .btn-login-primary {
  flex: 1;
  min-height: 48px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
}

.btn-link-reset {
  margin-top: 12px;
  padding: 0;
  border: none;
  background: none;
  color: var(--cbi-blue);
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
}

/* ---- Authentication step (shared with agentauth) ----------------------- */
.login-panel-right--auth {
  min-height: auto;
}

.login-panel-right--auth .login-step.active {
  overflow-y: auto;
  scrollbar-width: thin;
}

.auth-details-panel {
  margin-top: 16px;
  border: 1px solid var(--cbi-border-light);
  border-radius: 14px;
  /* overflow: hidden; */
   overflow-x: hidden;
  overflow-y: auto;
  max-height: 220px;
  scrollbar-width: thin;
  background: #fff;
}

.auth-details-row {
  display: grid;
  grid-template-columns: 152px 1fr;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--cbi-border-light);
  font-size: 16px;
}

.auth-details-row:last-child {
  border-bottom: none;
}

.auth-details-label {
  font-weight: 600;
  color: var(--cbi-text-muted);
}

.auth-details-value {
  font-weight: 600;
  color: var(--cbi-text-secondary);
  word-break: break-word;
}

.password-field-wrap {
  position: relative;
}

.password-field-wrap .login-field-input-lg {
  padding-right: 52px;
}

.btn-toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  color: var(--cbi-text-muted);
}

.btn-toggle-password:hover {
  background: #f1f5f9;
}

.captcha-panel {
  margin-top: 16px;
}

.captcha-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

#divCaptchaData {
  flex: 1;
  min-width: 200px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--cbi-border-light);
  border-radius: 12px;
  background: #f8fafc;
}

.captcha-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  min-height: 48px;
  border: 1px solid var(--cbi-border-light);
  border-radius: 12px;
  background: #fff;
  color: var(--cbi-text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.captcha-action-btn:hover {
  background: #f8fafc;
}

.captcha-hint {
  margin-top: 12px;
  font-size: 14px;
  color: var(--cbi-text-muted);
}

.not-you-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid var(--cbi-border-light);
  border-radius: 12px;
  font-size: 16px;
  color: var(--cbi-text-muted);
}

.btn-change-user {
  padding: 0;
  border: none;
  background: none;
  color: var(--cbi-blue);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}

.legacy-auth-fields {
  display: none;
}

.legacy-auth-fields.visible-legacy {
  display: block;
}

.shPwdLblTb.hidden-field,
.shOTPLblTb.hidden-field,
.shResetPWD.hidden-field,
.clsCaptch.hidden-field {
  display: none !important;
}

#divOTPBtns {
  margin-top: 12px;
}

/* ---- Message overlay --------------------------------------------------- */
.login-msg-shell {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-msg-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 43, 0.52);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.login-msg-dialog {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  background: #fff;
  border: 1px solid var(--cbi-border);
  border-radius: var(--cbi-card-radius);
  box-shadow: 0 18px 48px rgba(15, 23, 43, 0.22);
  overflow: hidden;
}

.login-msg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
  border-bottom: 1px solid var(--cbi-border-light);
}

.login-msg-header-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.login-msg-icon {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  font-size: 22px;
  line-height: 1;
}

.login-msg-icon--success {
  color: var(--cbi-success);
}

.login-msg-icon--error {
  color: var(--cbi-error);
}

.login-msg-dialog:has(#lblToAddMsg.successMsg) .login-msg-icon--success,
.login-msg-dialog:has(.login-msg-body.successMsg) .login-msg-icon--success {
  display: inline-flex;
}

.login-msg-dialog:has(#lblToAddMsg.failureMsg) .login-msg-icon--error,
.login-msg-dialog:has(.login-msg-body.failureMsg) .login-msg-icon--error {
  display: inline-flex;
}

#loginMsgTitle {
  font-size: 18px;
  font-weight: 700;
  color: var(--cbi-text);
}

.login-msg-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--cbi-text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.login-msg-close:hover {
  background: rgba(15, 23, 43, 0.06);
  color: var(--cbi-text);
}

.login-msg-body,
#lblToAddMsg {
  display: block;
  padding: 16px 20px;
  margin: 16px 20px 8px;
  font-size: 14px;
  line-height: 1.55;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 12px;
}

.login-msg-dialog:has(#lblToAddMsg.successMsg) #lblToAddMsg,
.login-msg-dialog:has(.login-msg-body.successMsg) .login-msg-body {
  background: var(--cbi-success-bg);
  border: 1px solid rgba(0, 122, 85, 0.18);
  color: var(--cbi-success) !important;
  font-weight: 600;
}

.login-msg-dialog:has(#lblToAddMsg.failureMsg) #lblToAddMsg,
.login-msg-dialog:has(.login-msg-body.failureMsg) .login-msg-body {
  background: var(--cbi-error-bg);
  border: 1px solid rgba(220, 38, 38, 0.18);
  color: var(--cbi-error) !important;
  font-weight: 600;
}

.login-msg-footer {
  padding: 8px 20px 20px;
  text-align: center;
}

.login-msg-ok {
  width: 100%;
  min-width: 0;
  margin-top: 0;
  min-height: 44px;
  border-radius: 12px;
}

body.login-msg-open {
  overflow: hidden;
}

/* Legacy alias kept for older markup references */
.login-msg-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10001;
  width: min(480px, 90vw);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  border: 1px solid var(--cbi-border-light);
  overflow: hidden;
}

/* ---- PAN consent modal ------------------------------------------------- */
body.consent-modal-open {
  overflow: hidden;
}

.login-consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-consent-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 43, 0.52);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.login-consent-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(82vh, 640px);
  background: #fff;
  border: 1px solid var(--cbi-border);
  border-radius: var(--cbi-card-radius);
  box-shadow: 0 18px 48px rgba(15, 23, 43, 0.22);
  overflow: hidden;
}

.login-consent-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--cbi-border-light);
  background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
}

.login-consent-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--cbi-blue-light);
  color: var(--cbi-blue);
  font-size: 20px;
}

.login-consent-heading {
  min-width: 0;
}

.login-consent-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--cbi-text);
}

.login-consent-subtitle {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--cbi-text-muted);
}

.login-consent-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 24px;
  overflow-y: auto;
}

.login-consent-message {
  padding: 16px 18px;
  border: 1px solid var(--cbi-border-light);
  border-radius: 12px;
  background: #f8fafc;
  font-size: 14px;
  line-height: 1.6;
  color: var(--cbi-text-secondary);
  word-break: break-word;
}

.login-consent-message p {
  margin: 0 0 10px;
}

.login-consent-message p:last-child {
  margin-bottom: 0;
}

.login-consent-message ul,
.login-consent-message ol {
  margin: 0 0 10px;
  padding-left: 20px;
}

.login-consent-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--cbi-border-light);
  background: #fff;
}

.login-consent-footer .btn-login-secondary,
.login-consent-footer .btn-login-primary {
  width: auto;
  min-width: 120px;
  margin-top: 0;
  min-height: 44px;
  border-radius: 12px;
}

/* Blocking overlay */
.login-blocking-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 43, 0.45);
}

.login-blocking-message {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: min(420px, 90vw);
  padding: 20px 24px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--cbi-border-light);
  font-size: 14px;
  color: var(--cbi-text-secondary);
}

.login-blocking-message img {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

/* Legacy jQuery blockUI override */
div.blockUI.blockMsg {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: min(420px, 90vw) !important;
  background-color: #fff !important;
  text-align: center !important;
  padding: 20px !important;
  border-radius: 12px !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15) !important;
  z-index: 10000 !important;
  border: 1px solid var(--cbi-border-light) !important;
}

/* ---- Footer ------------------------------------------------------------ */
.login-footer {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  text-align: center;
  padding: 5px 16px;
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid var(--cbi-border-light);
  font-size: 11px;
  line-height: 1.2;
}

.login-footer img {
  height: 16px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .login-main {
    align-items: flex-start;
    padding: 16px 20px;
    overflow-y: auto;
  }

  .login-layout {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-height: none;
  }

  .login-panel-left {
    flex: none;
    width: min(420px, 100%);
    max-height: none;
  }

  .login-illustration-img {
    max-height: 320px;
  }

  .login-panel-right {
    flex: none;
    width: min(480px, 100%);
    max-height: none;
  }
}

@media (max-width: 768px) {
  .login-panel-left {
    max-width: 320px;
  }

  .login-panel-right {
    padding: 20px 18px 22px;
  }

  .login-stepper {
    padding-right: 0;
    flex-wrap: wrap;
    gap: 4px;
  }

  .stepper-line {
    min-width: 8px;
  }

  .login-lang-wrap {
    position: static;
    margin-bottom: 12px;
    text-align: right;
  }

  .device-status-row {
    flex-wrap: wrap;
  }

  .device-status-badge {
    margin-left: 52px;
  }
}

@media (max-width: 480px) {
  .login-header {
    padding: 10px 14px 0;
  }

  .login-header-inner {
    padding: 7px 14px;
  }

  .login-bank-logo {
    height: 28px;
    max-width: 160px;
  }

  .login-consent-overlay {
    padding: 12px;
  }

  .login-consent-header,
  .login-consent-body,
  .login-consent-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .login-consent-footer {
    flex-direction: column-reverse;
  }

  .login-consent-footer .btn-login-secondary,
  .login-consent-footer .btn-login-primary {
    width: 100%;
  }

  .stepper-label {
    display: none;
  }

  .login-actions {
    flex-direction: column;
  }

  .device-status-badge {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
}


.apk-download-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #0d6efd; /* Optional */
}

.apk-download-btn i {
    font-size: 18px;
    line-height: 1;
}

.apk-download-btn .apk-text {
    font-size: 11px;
    margin-top: 2px;
    line-height: 1;
}