/*
 * BrokerPoint look for the RD Web Client (HTML5): the sign-in page and the
 * app list after sign-in.
 *
 * A one-to-one port of the PowerSoft Keycloak login
 * (ps_iam/PS-Keycloak Auth/themes/powersoft/login/resources/css/powersoft.css):
 * PowerSoft title band with the tile stripe, one rounded card on a quiet
 * workspace, labels above full-width fields, a solid green button. The
 * BrokerPoint name sits to the right of the PowerSoft logo.
 *
 * After sign-in, the app list gets the same band, workspace and card, with
 * the apps in the card in place of the sign-in form.
 *
 * How it hooks in: index.html links this file and brokerpoint.js, and adds the
 * <header class="bp-head"> band. Everything else targets the web client's own
 * markup by the stable class names Microsoft gives it (rdweb-credentials-modal,
 * tenants, tenant-resources, ...) and Fluent UI's ms-* classes. Fluent also adds
 * generated classes (root-159, field-161, ...) that change between builds, so
 * none are used here.
 *
 * Two page states are styled, each detected with :has():
 *   sign-in   body:has(.rdweb-credentials-modal)
 *   app list  body:has(.tenants):not(:has(.session-tab.active))
 * While a remote session is in front, its tab in the top bar is
 * .session-tab.active, so none of the app-list styling applies and the
 * session looks exactly as Microsoft ships it.
 *
 * Fluent injects its styles at runtime after this file, so rules here use two
 * or more classes to win on specificity, plus !important where Fluent sets
 * inline-equivalent values.
 *
 * The title band is white.
 */

/* Rajdhani (SIL Open Font License, fonts/OFL.txt): the closest free match to the
   lettering in the PowerSoft logo. Used for the BrokerPoint name in the header. */
@font-face {
  font-family: "Rajdhani";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/rajdhani-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bp:          #00693f;
  --bp-dark:     #005a36;
  --bp-darker:   #00482b;
  --ink:         #2b2b2b;
  --ink-soft:    #4f5560;
  --ink-faint:   #66707c;
  --ground:      #e1e7e4;
  --line:        #c9d3ce;
  --line-soft:   #e2e8e5;
  --bad:         #c8381c;
  --shadow-lift: 0 2px 4px rgb(0 40 24 / .08), 0 20px 40px -18px rgb(0 40 24 / .38);
  --stripe: linear-gradient(90deg,
    #00acc1 0 16.67%, #ffcc00 0 33.33%, #0066cc 0 50%,
    #ec0000 0 66.67%, #00acc1 0 83.33%, #ffcc00 0);
  --font: 'Segoe UI', 'Segoe UI Web (West European)', 'Segoe UI Web', Tahoma, Geneva, Verdana, sans-serif;
  --font-brand: "Rajdhani", var(--font);

  /* Title band. */
  --head-bg:     #ffffff;
  --head-ink:    var(--ink);
  --head-rule:   var(--line);
  --head-shadow: 0 6px 18px -12px rgb(0 40 24 / .45);
  --head-h:      114px;
}

/* ----------------------------------------------------------- title band */

/* Shown on the sign-in page and the app list; hidden while a session is in front. */
.bp-head { display: none; }
body.bp-page .bp-head,
body:has(.rdweb-credentials-modal) .bp-head,
body:has(.tenants):not(:has(.session-tab.active)) .bp-head {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000001;          /* sign-in: above Fluent's layer host (1000000) */
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  box-sizing: border-box;
  height: var(--head-h);
  padding: 14px 20px 18px;
  background: var(--head-bg);
  box-shadow: var(--head-shadow);
}
/* App list: under the web client's top bar (z-index 1), whose buttons sit in
   the band's corners, and under any session layer. */
body:has(.tenants):not(:has(.session-tab.active)):not(:has(.rdweb-credentials-modal)) .bp-head { z-index: 0; }

.bp-head::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: var(--stripe);
}
.bp-head__logo { display: block; width: 210px; height: auto; }

/* BrokerPoint, to the right of the PowerSoft logo. */
.bp-head__divider { align-self: stretch; width: 1px; margin: 8px 0; background: var(--head-rule); }
.bp-head__product {
  display: flex;
  align-items: center;
  color: var(--head-ink);
  font-family: var(--font-brand);
  font-size: 34px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.01em;
  white-space: nowrap;
}

/* ------------------------------------------------------------ workspace */

/* The dimmed backdrop becomes the plain workspace, and the card is centred
   in the space under the title band. */
.rdweb-credentials-modal.ms-Modal {
  box-sizing: border-box;
  padding: calc(var(--head-h) + 24px) 16px 40px;
  overflow-y: auto;
  font-family: var(--font);
}
/* The icon pattern from the old RD Web Access page (RDWeb/Pages/images/bg_globe_01.jpg),
   centred at its natural size as it was there. It has a white backdrop, so it is
   multiplied over the workspace grey: the white takes the grey and only the icons show.
   A wash of the workspace grey on top softens it so the card stays the focus;
   set --bg-fade to 0 for the full-strength pattern. */
.rdweb-credentials-modal .ms-Overlay,
body.bp-page,
body:has(.tenants):not(:has(.session-tab.active)) {
  --bg-fade: .45;
  background:
    linear-gradient(rgb(225 231 228 / var(--bg-fade)), rgb(225 231 228 / var(--bg-fade))),
    url("bg-icons.jpg") center calc(50% + var(--head-h) / 2) / var(--bg-size, auto) no-repeat,
    var(--ground) !important;
  background-attachment: fixed;
  background-blend-mode: normal, multiply;
}

/* ------------------------------------------------------------- the card */

.rdweb-credentials-modal .ms-Dialog-main {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: 480px !important;
  min-width: 0 !important;
  max-height: none !important;
  padding: 38px 36px 30px;
  background: linear-gradient(180deg, #fff 0%, #fbfcfd 100%);
  border: 1px solid var(--line-soft);
  border-top: 0;
  border-radius: 14px;
  box-shadow: var(--shadow-lift);
  overflow: hidden;
}
/* The tile stripe along the top edge, echoing the title band. */
.rdweb-credentials-modal .ms-Dialog-main::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: var(--stripe);
}
.rdweb-credentials-modal .ms-Modal-scrollableContent { overflow: visible; max-height: none; }

/* Fluent's blue top border on large-header dialogs. */
.rdweb-credentials-modal .ms-Dialog-lgHeader { border-top: 0 !important; }

.rdweb-credentials-modal .ms-Dialog-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0 22px;
  padding: 0;
}
.rdweb-credentials-modal .ms-Dialog-title {
  margin: 0;
  padding: 0 !important;
  font-family: var(--font);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: var(--bp);
}
.rdweb-credentials-modal .ms-Dialog-header [class^="topButton"] { display: none; }

.rdweb-credentials-modal .ms-Dialog-inner { padding: 0 !important; }

/* Fields, then the error message moved above them, as Keycloak does. */
.rdweb-credentials-modal .ms-Dialog-content {
  display: flex;
  flex-direction: column;
  margin: 0;
}

/* ---------------------------------------------------------------- fields */

.rdweb-credentials-modal .rdweb-credentials-modal-container__textfield { margin: 0 0 18px; }

.rdweb-credentials-modal .ms-TextField .ms-Label {
  display: block;
  margin: 0 0 6px;
  padding: 0;
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
}

.rdweb-credentials-modal .ms-TextField .ms-TextField-fieldGroup {
  display: flex;
  height: auto;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgb(0 40 24 / .06);
  overflow: hidden;
}
.rdweb-credentials-modal .ms-TextField .ms-TextField-fieldGroup:hover { border-color: #9fb0bf; }
/* Fluent draws its focus ring with ::after; recolour and round it. */
.rdweb-credentials-modal .ms-TextField.is-active .ms-TextField-fieldGroup { border-color: var(--bp); }
.rdweb-credentials-modal .ms-TextField .ms-TextField-fieldGroup::after {
  inset: -1px;
  border: 2px solid rgb(0 105 63 / .3) !important;
  border-radius: 8px;
}

.rdweb-credentials-modal .ms-TextField .ms-TextField-field {
  height: auto;
  padding: 11px 12px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
}
/* Keycloak has no placeholders; the label says it. */
.rdweb-credentials-modal .ms-TextField .ms-TextField-field::placeholder { color: transparent; }

/* Show/hide password button. */
.rdweb-credentials-modal .ms-TextField .ms-TextField-reveal {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: auto;
  padding: 0;
  border-left: 1px solid var(--line);
  background: #f4f6f8;
  color: var(--ink-faint);
}
.rdweb-credentials-modal .ms-TextField .ms-TextField-reveal:hover { color: var(--bp-dark); background: #eef2f0; }
.rdweb-credentials-modal .ms-TextField .ms-TextField-reveal i { color: inherit; }

/* --------------------------------------------------------------- message */

.rdweb-credentials-modal .rdweb-credentials-modal-container__error-log { order: -1; }
.rdweb-credentials-modal .rdweb-credentials-modal-container__error-log:not(.visually-hidden) .message-container {
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--bad);
  border-radius: 8px;
  background: #fdf3f1;
}
.rdweb-credentials-modal .message-container__header { display: flex; align-items: flex-start; gap: 10px; }
.rdweb-credentials-modal .message-container__header-icon { flex: none; margin: 1px 0 0; }
.rdweb-credentials-modal .message-container__header-icon i,
.rdweb-credentials-modal .message-container__header-icon svg { width: 18px; height: 18px; color: var(--bad); }
.rdweb-credentials-modal .message-container__header-message {
  margin: 0;
  color: var(--ink) !important;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

/* "Click here to change your password." under the expired-password message. */
.rdweb-credentials-modal .rdweb-credentials-modal-container__error-log > a.action-item__privacy-link {
  display: block;
  margin: -8px 0 20px;
  font-weight: 600;
}

/* ---------------------------------------------------------------- footer */

/* Button first and full width; the privacy link becomes a quiet footnote. */
.rdweb-credentials-modal .ms-Dialog-actions { margin: 6px 0 0; min-height: 0; line-height: normal; }
.rdweb-credentials-modal .rdweb-credentials-modal-container__footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin: 0;
  text-align: center;
}
.rdweb-credentials-modal .rdweb-credentials-modal-container__footer .ms-Dialog-action {
  display: block;
  width: 100%;
  margin: 0;
  text-align: center;
}
.rdweb-credentials-modal .rdweb-credentials-modal-container__footer .ms-Dialog-action:has(.action-item__submit-button) { order: -1; }
.rdweb-credentials-modal .rdweb-credentials-modal-container__footer .ms-Dialog-action:has(.action-item__privacy-link) {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.rdweb-credentials-modal .ms-Button.action-item__submit-button {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  padding: 13px 20px;
  border: 1px solid var(--bp-dark);
  border-radius: 10px;
  background: linear-gradient(180deg, #007a4a, var(--bp-dark));
  box-shadow: 0 10px 22px -12px rgb(0 72 43 / .9);
  color: #fff;
  font-family: var(--font);
  transition: translate .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.rdweb-credentials-modal .ms-Button.action-item__submit-button .ms-Button-label {
  margin: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}
.rdweb-credentials-modal .ms-Button.action-item__submit-button:hover {
  background: var(--bp-darker);
  box-shadow: 0 14px 26px -12px rgb(0 72 43 / .95);
  translate: 0 -1px;
}
.rdweb-credentials-modal .ms-Button.action-item__submit-button:focus-visible,
.ms-Fabric--isFocusVisible .rdweb-credentials-modal .ms-Button.action-item__submit-button:focus {
  outline: 2px solid rgb(0 105 63 / .45);
  outline-offset: 2px;
}
.rdweb-credentials-modal .ms-Button.action-item__submit-button::after { display: none; }
/* The web client disables the button until both fields have text. */
.rdweb-credentials-modal .ms-Button.action-item__submit-button.is-disabled {
  opacity: .5;
  box-shadow: none;
  translate: none;
  cursor: not-allowed;
}

.rdweb-credentials-modal .action-item__privacy-link,
.bp-legal-link {
  color: var(--bp-dark) !important;
  font-family: var(--font);
  font-size: 14px;
  text-decoration: none;
}
.rdweb-credentials-modal .action-item__privacy-link:hover,
.bp-legal-link:hover { color: var(--bp-darker) !important; text-decoration: underline; }
/* "Privacy policy · Legal" (the Legal link is added by brokerpoint.js). */
.bp-legal-sep { margin: 0 8px; color: var(--ink-faint); font-size: 14px; }

/* ============================================================ app list */
/* Everything below applies only while the app list is in front (see the top). */

/* The web client's top bar (home, full screen, settings, help, account) stays
   and becomes see-through, so its buttons sit in the corners of the band. */
body:has(.tenants):not(:has(.session-tab.active)) .navbar-container {
  --navbar-primary-background-color: transparent;
  background-color: transparent !important;
}

/* Keep the card's top margin inside the app's container; otherwise it pushes
   the whole app, top bar included, down the page. */
body:has(.tenants):not(:has(.session-tab.active)) .webclient { display: flow-root; }

/* The heading the web client hides for screen readers ("Your apps"). */
body:has(.tenants):not(:has(.session-tab.active)) .webclient > h1.visually-hidden { margin: 0; }

/* The card, in the same place and style as the sign-in card. */
body:has(.tenants):not(:has(.session-tab.active)) .tenants {
  position: relative;
  box-sizing: border-box;
  width: calc(100% - 32px);
  max-width: 480px;
  margin: calc(var(--head-h) + 40px) auto 48px;
  padding: 38px 36px 26px;
  background:
    var(--stripe) top / 100% 5px no-repeat,
    linear-gradient(180deg, #fff 0%, #fbfcfd 100%);
  border: 1px solid var(--line-soft);
  border-top: 0;
  border-radius: 14px;
  box-shadow: var(--shadow-lift);
  font-family: var(--font);
  display: flex;
  flex-direction: column;
}
body:has(.tenants):not(:has(.session-tab.active)) .tenants::before {
  content: "Your apps";
  display: block;
  margin: 0 0 22px;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: var(--bp);
}

/* Notices ("Privacy settings ... preset by your organization", ...): the
   Keycloak message style, with the rail in PowerSoft green. */
body:has(.tenants):not(:has(.session-tab.active)) .warning-messages-root {
  min-height: 0;
  margin: 0 0 12px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--bp);
  border-radius: 8px;
  background: #f5faf7 !important;
}
body:has(.tenants):not(:has(.session-tab.active)) .warning-messages-root .ms-MessageBar-content { align-items: flex-start; }
body:has(.tenants):not(:has(.session-tab.active)) .warning-messages-root .ms-MessageBar-icon { margin: 11px 0 0 12px; }
body:has(.tenants):not(:has(.session-tab.active)) .warning-messages-icon { color: var(--bp-dark) !important; }
body:has(.tenants):not(:has(.session-tab.active)) .warning-messages-root .ms-MessageBar-text { margin: 9px 8px 9px 10px; }
body:has(.tenants):not(:has(.session-tab.active)) .warning-messages-text,
body:has(.tenants):not(:has(.session-tab.active)) .warning-messages-text span {
  color: var(--ink) !important;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  white-space: normal !important;
}
body:has(.tenants):not(:has(.session-tab.active)) .warning-messages-root .info-banners-link { margin-left: 4px; color: var(--bp-dark) !important; }
body:has(.tenants):not(:has(.session-tab.active)) .warning-messages-close-icon .ms-Button-icon { color: var(--ink-faint) !important; font-size: 11px; }

body:has(.tenants):not(:has(.session-tab.active)) .tenants-container { margin: 6px 0 0; padding: 0; }

/* Workspace name ("PowerSoft") with its collapse button, and the tile/list
   switch, on one row above the apps. */
body:has(.tenants):not(:has(.session-tab.active)) .tenants-container { position: relative; }
body:has(.tenants):not(:has(.session-tab.active)) .resources-controls-container {
  position: absolute;
  top: 6px;
  right: 0;
  z-index: 1;
}
body:has(.tenants):not(:has(.session-tab.active)) .resources-controls-icon-btn { width: 32px; height: 32px; }
body:has(.tenants):not(:has(.session-tab.active)) .resources-controls-icon-selected { color: var(--bp-dark) !important; }
body:has(.tenants):not(:has(.session-tab.active)) .tenant-header {
  min-height: 0;
  margin: 0 0 12px;
  padding: 0 72px 8px 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent !important;
}
body:has(.tenants):not(:has(.session-tab.active)) .tenant-header .title-container { min-width: 0; }
body:has(.tenants):not(:has(.session-tab.active)) .tenant-header .title-container .tenant-display-name {
  padding-left: 4px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
}
body:has(.tenants):not(:has(.session-tab.active)) .tenant-header-expand-button { width: 32px; height: 32px; padding: 0; }
body:has(.tenants):not(:has(.session-tab.active)) .tenant-header-expand-button:hover { background: #eef2f0 !important; }

/* Tiles: three across, each a bordered box like the card's fields. The web
   client sets each tile's width inline for a full-page grid, hence !important. */
body:has(.tenants):not(:has(.session-tab.active)) .tenant-resources { margin: 0 -6px; }
body:has(.tenants):not(:has(.session-tab.active)) .tenant-resources .tile-view {
  box-sizing: border-box;
  width: 33.3333% !important;
  padding: 6px;
}
/* Size each tile's button to its square, not to the padded tile around it. */
body:has(.tenants):not(:has(.session-tab.active)) .tenant-resources .tenant-resources-sizer { position: relative; }
body:has(.tenants):not(:has(.session-tab.active)) .tenant-resources .tenant-resources-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgb(0 40 24 / .06);
  transition: border-color .15s ease, box-shadow .15s ease, translate .15s ease;
}
body:has(.tenants):not(:has(.session-tab.active)) .tenant-resources .tenant-resources-btn:hover {
  border-color: var(--bp);
  background: #fff;
  box-shadow: 0 10px 22px -14px rgb(0 72 43 / .8);
  translate: 0 -1px;
}
body:has(.tenants):not(:has(.session-tab.active)) .tenant-resources .tile-view-thumbnail { width: 40px !important; height: 40px !important; }
body:has(.tenants):not(:has(.session-tab.active)) .tenant-resources .tile-view-label-container { height: auto; padding: 10px 8px 0; }
body:has(.tenants):not(:has(.session-tab.active)) .tenant-resources .tile-view-label {
  width: auto;
  height: auto;
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

/* List view: one app per row. */
body:has(.tenants):not(:has(.session-tab.active)) .tenant-resources .list-view {
  min-height: 0;
  margin: 0 6px 8px;
  width: calc(100% - 12px) !important;
  padding: 12px 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
body:has(.tenants):not(:has(.session-tab.active)) .tenant-resources .list-view:hover { border-color: var(--bp); background: #fff; }
body:has(.tenants):not(:has(.session-tab.active)) .tenant-resources .list-view-label {
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
}

/* Footnote under the apps (added by brokerpoint.js), like the sign-in card's. */
body:has(.tenants):not(:has(.session-tab.active)) .bp-card-foot {
  order: 99;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  text-align: center;
}
.bp-card-foot { display: none; }
body:has(.tenants):not(:has(.session-tab.active)) .bp-card-foot { display: block; }

/* ====================================================== standalone pages */
/* change-password.html: the same band, workspace and card as plain HTML. */

body.bp-page {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.bp-page__workspace {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  box-sizing: border-box;
  min-height: 100vh;
  padding: calc(var(--head-h) + 40px) 16px 48px;
}

.bp-card {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  max-width: 480px;
  padding: 38px 36px 26px;
  background:
    var(--stripe) top / 100% 5px no-repeat,
    linear-gradient(180deg, #fff 0%, #fbfcfd 100%);
  border: 1px solid var(--line-soft);
  border-top: 0;
  border-radius: 14px;
  box-shadow: var(--shadow-lift);
}
.bp-card__title {
  margin: 0 0 22px;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: var(--bp);
}

.bp-field { margin: 0 0 18px; }
.bp-field label {
  display: block;
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
}
.bp-field input {
  box-sizing: border-box;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 1px 2px rgb(0 40 24 / .06);
  color: var(--ink);
  font: inherit;
}
.bp-field input:hover { border-color: #9fb0bf; }
.bp-field input:focus {
  border-color: var(--bp);
  outline: 2px solid rgb(0 105 63 / .3);
  outline-offset: 0;
}
.bp-field__hint { margin: 6px 0 0; color: var(--ink-faint); font-size: 13px; line-height: 1.45; }

.bp-btn {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin-top: 6px;
  padding: 13px 20px;
  border: 1px solid var(--bp-dark);
  border-radius: 10px;
  background: linear-gradient(180deg, #007a4a, var(--bp-dark));
  box-shadow: 0 10px 22px -12px rgb(0 72 43 / .9);
  color: #fff;
  font: 600 16px var(--font);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: translate .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.bp-btn:hover { background: var(--bp-darker); box-shadow: 0 14px 26px -12px rgb(0 72 43 / .95); translate: 0 -1px; color: #fff; }
.bp-btn:focus-visible { outline: 2px solid rgb(0 105 63 / .45); outline-offset: 2px; }
.bp-btn:disabled { opacity: .6; cursor: wait; translate: none; }
.bp-btn[hidden] { display: none; }

.bp-alert {
  margin: 0 0 20px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-left: 4px solid var(--bad);
  border-radius: 8px;
  background: #fdf3f1;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}
.bp-alert--ok { border-left-color: var(--bp); background: #f3f9f5; }
.bp-alert[hidden] { display: none; }

.bp-page__foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  text-align: center;
  font-size: 14px;
}
.bp-page__foot a { color: var(--bp-dark); text-decoration: none; }
.bp-page__foot a:hover { color: var(--bp-darker); text-decoration: underline; }
.bp-page__foot [hidden] { display: none; }

/* ----------------------------------------------------------- small screens */

@media (max-width: 600px) {
  :root { --head-h: 98px; }
  .bp-head { gap: 14px; padding: 12px 12px 16px; }
  .bp-head__logo { width: 140px; }
  .bp-head__product { font-size: 23px; }
  .rdweb-credentials-modal.ms-Modal { padding: calc(var(--head-h) + 16px) 12px 28px; }
  .rdweb-credentials-modal .ms-Overlay,
  body.bp-page,
  body:has(.tenants):not(:has(.session-tab.active)) { --bg-size: 720px; }
  .rdweb-credentials-modal .ms-Dialog-main { padding: 30px 20px 22px; }
  .rdweb-credentials-modal .ms-Dialog-title { font-size: 26px; }
  .bp-page__workspace { padding: calc(var(--head-h) + 20px) 12px 28px; }
  .bp-card { padding: 30px 20px 20px; }
  .bp-card__title { font-size: 26px; }
  body:has(.tenants):not(:has(.session-tab.active)) .tenants { padding: 30px 20px 20px; }
  body:has(.tenants):not(:has(.session-tab.active)) .tenants::before { font-size: 26px; }
}

/* App list on narrower screens: the top bar's buttons would overlap the logos,
   so the band grows and the logos move below the buttons. */
@media (max-width: 900px) {
  body:has(.tenants):not(:has(.session-tab.active)) .bp-head { height: calc(var(--head-h) + 40px); padding-top: 50px; }
  body:has(.tenants):not(:has(.session-tab.active)) .tenants { margin-top: calc(var(--head-h) + 60px); }
}
