/* Fix-ups for the mirrored NCB personal page.
   The captured page's outer layout is table/float based and leaned on the bank's (stripped) JS for
   sizing — without it every container collapses to ~8px and the page renders as a thread. These
   rules put the widths back. Everything is scoped so it cannot affect other clones. */

.toprow,
.toprow > *,
.parentTable,
.next-genHeader,
.login-body-container,
.loginHeader,
.wrapper,
.width100percent_main_login,
.width100percent_main_loginbg {
  width: 100% !important;
  max-width: 100% !important;
}

html, body {
  background: #f4f6f9 !important;
  min-height: 100%;
}

/* the two-column hero band of the real page: keep the card readable and centred */
.toprow { display: block !important; }
.next-genHeader { position: static !important; }

/* in-card footer links: white !important via #id on the real page, invisible on our white card */
#PrivacyPolicyfooter, #TermsCondionsfooter { color: #14589f !important; }

/* the in-card link row ships as width:46% + nowrap, so five labels squeeze and clip at any
   screen size — let it use the card's full width and wrap */

/* the card's rows are laid out against the page, not the card, so they reached the card's very
   edge and their last characters were clipped by overflow:hidden. inset the card's content area. */
.loginScreenContainer, .loginScreenContainer > div { padding-left: 12px !important; padding-right: 12px !important; box-sizing: border-box !important; }
.loginLinkcontainer { width: auto !important; margin-left: 0 !important; margin-right: 0 !important; }

.loginLinkcontainer { width: auto !important; max-width: 100% !important; flex-wrap: wrap !important;
                      justify-content: center !important; gap: 2px 7px !important; padding: 0 4px !important; }
.loginLinkcontainer > div { flex: none !important; }
.loginLinkcontainer a, .loginLinkcontainer #loginScreenSep { font-size: 11.5px !important; line-height: 1.5 !important; }

.loginLinkcontainer a { text-decoration: underline !important; }


/* the bank sized these rows to the viewport (390px) while the card is narrower, so the contact
   line and the link row spilled past the card and were sliced by its overflow:hidden */
[id^="LoginHDisplay"] { width: auto !important; max-width: 100% !important; box-sizing: border-box !important; }
[id$="R1"], [id$="R1.C1"], .loginScreenContainer p { padding: 0 14px !important; text-align: center !important; box-sizing: border-box !important; }
.login-card { padding-bottom: 14px !important; }


/* the captured page gives the header a hard 700px height (its own hero lived there); with the
   background already on #global that is ~700px of blank before the card */
#header, #header-main, #header-wrapper, #header-row, .loginHeader, .newheaderbg {
  height: auto !important; min-height: 0 !important; padding-top: 10px !important; padding-bottom: 10px !important;
}
/* #header renders empty once the bank's JS is gone — an empty white band above the card */
#header, .loginHeader { display: none !important; }
.toprow { height: auto !important; min-height: 0 !important; padding-bottom: 0 !important; }

/* the login card itself */
.loginScreenContainer,
.parentTable form,
.login-panel {
  max-width: 640px !important;
  margin: 0 auto !important;
}

/* images the bank sized from JS */
img[src*="login-logo"], .login-logo { height: auto !important; max-width: 220px !important; }
img { max-width: 100%; }

/* stepped screens: step 1 only shows the username, step 2 the password (as the real page does) */
body.step-1 input[name="AuthenticationFG.PASSWORD"],
body.step-1 input[name="dummy1"],
body.step-1 input[name="AuthenticationFG.ACCESS_CODE"] { display: none !important; }
body.step-1 [class*="password"], body.step-1 [id*="password"] { }

@media (max-width: 720px) {
  .loginScreenContainer, .parentTable form, .login-panel { max-width: 100% !important; }
  .toprow { padding: 0 !important; }
}

/* ---------- small screens: the captured page is a desktop layout ----------
   Without the bank's own JS the card floats absolutely and the footer stacks on top of it,
   so on a phone the form collides with the footer and gets clipped. Put the card back in flow,
   full width, and give the footer room underneath. */
@media (max-width: 720px) {
  .toprow, .parentTable { display: block !important; height: auto !important; min-height: 0 !important; padding: 0 !important; }
  .login-main { display: block !important; position: static !important; width: 100% !important;
                max-width: 100% !important; padding: 0 !important; margin: 8px auto 0 !important; box-sizing: border-box; }
  .login-card, .login-card-header, .login-card-body, .row-login, .login-container {
    width: 100% !important; max-width: 100% !important; flex: 0 0 100% !important; float: none !important;
    box-sizing: border-box;
  }
  .login-card { border-radius: 10px 10px 0 0 !important; overflow: hidden !important; height: auto !important; min-height: 0 !important; }
  .login-card-header { padding: 14px 16px !important; }
  .login-card-body { padding: 18px 16px 22px !important; }
  .footer-wrapper, #footer, .loginfoorter-wrapper {
    position: static !important; width: 100% !important; margin: 20px 0 0 !important; padding: 14px 14px 22px !important;
    clear: both !important; height: auto !important;
  }
  .footer-links { flex-wrap: wrap !important; }
  table, td, th { width: auto !important; max-width: 100% !important; }
  #flashcontent { height: auto !important; min-height: 0 !important; }
  img { max-width: 100% !important; height: auto !important; }

  /* nothing chopped here */}
