/**
 * App-specific overrides for the lifted B2B portal.
 * Loaded LAST so it wins the cascade. Keep it small.
 */

/* Force the legacy blue header background on table headers in the account
 * info form. The plain `th { background-color:#154988 }` rule in main.css is
 * occasionally beaten by other table rules that set `background: transparent`;
 * scoping to `.account-info-container` makes our intent specific enough. */
.account-info-container table th {
  background-color: #154988;
  color: #fff;
  font-weight: bold;
  padding: 10px;
  text-align: left;
}

/* Orange action buttons. The legacy main.css orange rule lists a specific set
 * of classes (.update_btn / .password_btn / .org-btn / etc.) but several
 * action buttons in the B2B flow use other class names that the legacy site
 * styled in stylesheets we're not pulling in. Force orange on the full set
 * we actually use. */
.password_btn,
.update_btn,
.org-btn,
.add_address,
.edit_address,
#submitInventorySearch,
#addShippingAddress {
  background: #f4921e !important;
  color: #fff !important;
  border: 0;
  text-transform: uppercase;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 4px;
}

.password_btn:hover,
.update_btn:hover,
.org-btn:hover,
.add_address:hover,
.edit_address:hover,
#submitInventorySearch:hover,
#addShippingAddress:hover {
  background: #ff9d11 !important;
}

/* "Add shipping address" link uses the same orange-button rule above. Just
 * make sure it renders as an inline-block link, not an underlined anchor. */
#addShippingAddress {
  display: inline-block;
  text-decoration: none;
  cursor: pointer;
}

/* Login page — drop the background image (a marketing photo we never copied
 * across) and undo the legacy address-form panel styling that wraps each
 * form-group in a big light-blue padded box. */
.login_section {
  background: #fff none !important;
  padding: 40px 0 !important;
}
.login_box {
  background: #fff !important;
  padding: 30px !important;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  max-width: 480px;
  margin: 0 auto;
}
.login_section .address-form > div,
.login_section .login-form > div {
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
}
.login_section .form-group {
  margin-bottom: 14px !important;
  display: block;
}
.login_section .form_lebel,
.login_section .login-form label {
  display: block !important;
  width: auto !important;
  text-align: left !important;
  padding: 0 0 4px 0 !important;
  margin: 0 !important;
  font-size: 14px !important;
  line-height: 1.4 !important;
  color: #154988;
}
.login_section .form_field {
  width: 100% !important;
  height: 38px;
  padding: 6px 10px;
  border: 1px solid #154988;
  border-radius: 4px;
  box-sizing: border-box;
}
.login_text {
  text-align: center;
  margin-bottom: 24px !important;
}

/* Accordion sections: more padding inside the open content, and vertically
 * center the heading row alongside the tall count cell. */
.accordion .opener {
  padding: 16px 130px 16px 24px !important;
}
.accordion .opener .accordian-med,
.accordion .opener .accordian td {
  vertical-align: middle !important;
}
.accordion .slide {
  padding: 16px 24px;
}

/* Dashboard search bar: input + button were `float: right` with mismatched
 * heights. Lay them out as inline-flex so they sit on the same baseline and
 * share padding/height. */
#b2b-search {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}
#b2b-search input,
#b2b-search button {
  float: none !important;
  display: inline-block;
  height: 40px;
  vertical-align: middle;
  box-sizing: border-box;
}
#b2b-search input {
  order: 1;
  padding: 6px 12px;
  font-size: 14px;
}
#b2b-search button {
  order: 2;
}

/* Address list rows render with `.address-text-blue` at the legacy size; shrink
 * for the B2B view where a long list is expected. */
.account-info-container .address-text-blue,
.account-info-container .address-list-container label {
  font-size: 13px;
  font-weight: 500;
}

/* all.css globally sets `table { table-layout: fixed }`, which forces the
 * accordion header table into 50/50 columns — the count cell's 120px font
 * then overflows into the header text. Restore auto layout and let the count
 * shrink to its content. */
.accordion .opener table.accordian {
  table-layout: auto;
  width: 100%;
}
.accordion .opener .accordian-lrg {
  width: 1%;
  white-space: nowrap;
  padding-right: 24px !important;
}

/* all.css ships a `.account-page label { width: 75px }` rule meant for the
 * shipment-step-2 layout that clips our address-picker labels to 75px. Undo
 * that constraint inside the address picker. */
.account-page .address-list-container label,
.account-page #addressModal_new label,
.account-page .address-picker-header h4 {
  float: none;
  width: auto;
  text-align: left;
  margin: 0;
}
