/* THIS IS THE CUSTOM CSS FILE FOR ADDITIONAL DEFINES */

.webix_el_box input,
.webix_el_box textarea,
.webix_el_box select {
  font-size: 16px !important;
}

.webix_view.webix_control > .webix_disabled {
  border: var(--ecmr-cloud-border);
}

.signature-empty-text {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: 100%;

  margin-top: 0;
  font-style: var(--ecmr-cloud-mini-textstyle);
  color: var(--ecmr-cloud-mini-textcolor);
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.4;
}

/* PRIMARY BUTTON DEFINE! */
.webix_primary .webix_button {
  font-size: var(--ecmr-cloud-font-size);
  font-weight: var(--ecmr-cloud-font-weight);
  border-radius: var(--ecmr-cloud-radius);
}

.webix_secondary .webix_button {
  background-color: #ccc;
  color: black;
  border-radius: var(--ecmr-cloud-radius);
  outline: var(--ecmr-cloud-outline);
  text-transform: capitalize;
  font-size: var(--ecmr-cloud-font-size);
  font-weight: var(--ecmr-cloud-font-weight);
  border: none;
  box-shadow: none;
}

.webix_secondary .webix_button:focus,
.webix_secondary .webix_button:focus-visible,
.webix_secondary .webix_button:active,
.webix_secondary.webix_focus .webix_button {
  background-color: #ccc;
  color: black;
  outline: var(--ecmr-cloud-outline);
  box-shadow: none;
}

/* Must come after focus/active */
.webix_secondary .webix_button:hover,
.webix_secondary .webix_button:focus:hover,
.webix_secondary .webix_button:focus-visible:hover,
.webix_secondary .webix_button:active:hover,
.webix_secondary.webix_focus .webix_button:hover {
  background-color: var(--ecmr-cloud-secondary-textcolor);
  color: var(--ecmr-cloud-secondary-color);
  outline: var(--ecmr-cloud-outline);
  box-shadow: none;
}

.ecmr-topbar-logo-wrap {
  display: flex;
  justify-content: center;
}

/* TAB ITEMS INSIDE SIGNATURES */
.webix_all_tabs .webix_item_tab {
  background-color: #ccc;
  color: black;
  font-size: var(--ecmr-cloud-font-size);
  font-weight: var(--ecmr-cloud-font-weight);
}

.webix_all_tabs .webix_item_tab:hover {
  background-color: var(--ecmr-cloud-color);
  color: var(--ecmr-cloud-textcolor);
}

.webix_all_tabs .webix_item_tab.webix_selected {
  background-color: var(--ecmr-cloud-color);
  color: var(--ecmr-cloud-textcolor);
}

.webix_all_tabs .webix_item_tab.webix_selected:hover {
  background-color: var(--ecmr-cloud-color);
  color: var(--ecmr-cloud-textcolor);
  border: none;
}

.webix_all_tabs .webix_item_tab.webix_selected:focus {
  color: var(--ecmr-cloud-textcolor);
}

/* SEGMENTED ITEMS */
.webix_segmented .webix_button {
  background-color: #ccc;
  color: black;
  font-size: var(--ecmr-cloud-font-size);
  font-weight: var(--ecmr-cloud-font-weight);
  border: none;
}

.webix_all_segments .webix_segment_0,
.webix_all_segments .webix_segment_1,
.webix_all_segments .webix_segment_2,
.webix_all_segments .webix_segment_3,
.webix_all_segments .webix_segment_N {
  background-color: #ccc;
  color: black;
  font-size: var(--ecmr-cloud-font-size);
  font-weight: var(--ecmr-cloud-font-weight);
  border: none;
}

.webix_segmented .webix_button:hover {
  background-color: var(--ecmr-cloud-color);
  color: var(--ecmr-cloud-textcolor);
}

.webix_segmented .webix_selected,
.webix_segmented .webix_button.webix_selected {
  background-color: var(--ecmr-cloud-color);
  color: var(--ecmr-cloud-textcolor);
  border: none;
}

.webix_segmented .webix_selected:hover,
.webix_segmented .webix_button.webix_selected:hover {
  background-color: var(--ecmr-cloud-color);
  color: var(--ecmr-cloud-textcolor);
  border: none;
}

.webix_segmented .webix_selected:focus,
.webix_segmented .webix_button.webix_selected:focus {
  color: var(--ecmr-cloud-textcolor);
}

.ecmr-password-toggle-wrap {
  position: relative;
}

.ecmr-password-toggle-wrap input {
  padding-right: 42px !important;
}

.ecmr-password-toggle {
  position: absolute;
  right: 10px;
  top: 30px;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ecmr-password-toggle:focus,
.ecmr-password-toggle:active {
  outline: none;
  box-shadow: none;
}

.ecmr-password-toggle-icon {
  width: 18px;
  height: 18px;
  display: block;
}

.grecaptcha-badge {
  bottom: 70px !important;
}

.row-align-right {
  text-align: right;
  font-size: 12px;
}

.order-row-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.order-action-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  cursor: pointer;
  display: inline-block;
  vertical-align: middle;
}

.webix_context_menu .webix_disabled_box,
.webix_context_menu .webix_item_disabled {
  opacity: 0.5;
  pointer-events: none;
}

.company-row-actions,
.company-row-actions-mobile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 10px;
}

.company-action-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  cursor: pointer;
  display: inline-block;
  vertical-align: middle;
}

.signature-attachment-carousel-slide {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border-radius: 8px;
  overflow: hidden;
}

.signature-attachment-carousel-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.signature-attachment-carousel-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  cursor: pointer;
  padding: 6px;
}

.signature-attachment-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #666;
  text-align: center;
}

.webix_nav_panel .webix_nav_active {
  background-color: #666;
}

.top-ribbon-toolbar,
.top-ribbon-toolbar .webix_view,
.top-ribbon-toolbar .webix_el_box,
.top-ribbon-toolbar .webix_template,
.top-ribbon-toolbar .webix_icon {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
}

.top-ribbon-text-wrap {
  display: flex;
  align-items: center; /* vertical center */
  justify-content: center; /* horizontal center (optional but good) */
  height: 100%;
  text-align: center;
  margin-left: 50px;
}

.top-ribbon-toolbar.top-ribbon-error {
  background: #f8d7da !important;
  color: #842029 !important;
  border-bottom: 1px solid #f1aeb5 !important;
}

.top-ribbon-toolbar.top-ribbon-warning {
  background: #fff3cd !important;
  color: #664d03 !important;
  border-bottom: 1px solid #ffe69c !important;
}

.top-ribbon-toolbar.top-ribbon-success {
  background: #d1e7dd !important;
  color: #0f5132 !important;
  border-bottom: 1px solid #a3cfbb !important;
}

.top-ribbon-toolbar.top-ribbon-info {
  background: #cff4fc !important;
  color: #055160 !important;
  border-bottom: 1px solid #9eeaf9 !important;
}

.top-ribbon-toolbar.top-ribbon-error .webix_el_box,
.top-ribbon-toolbar.top-ribbon-error .webix_template,
.top-ribbon-toolbar.top-ribbon-error .webix_icon {
  color: #842029 !important;
}

.top-ribbon-toolbar.top-ribbon-warning .webix_el_box,
.top-ribbon-toolbar.top-ribbon-warning .webix_template,
.top-ribbon-toolbar.top-ribbon-warning .webix_icon {
  color: #664d03 !important;
}

.top-ribbon-toolbar.top-ribbon-success .webix_el_box,
.top-ribbon-toolbar.top-ribbon-success .webix_template,
.top-ribbon-toolbar.top-ribbon-success .webix_icon {
  color: #0f5132 !important;
}

.top-ribbon-toolbar.top-ribbon-info .webix_el_box,
.top-ribbon-toolbar.top-ribbon-info .webix_template,
.top-ribbon-toolbar.top-ribbon-info .webix_icon {
  color: #055160 !important;
}

.company-suggest-add-new {
  font-weight: 500;
  background-color: #eee;
}

.webix_accordionitem.horizontal.collapsed .webix_accordionitem_header,
.webix_accordionitem.collapsed .webix_accordionitem_header {
  background-color: #fff;
}

.webix_accordionitem.horizontal.collapsed .webix_accordionitem_header,
.webix_accordionitem.collapsed .webix_accordionitem_header:hover {
  color: #fff;
}

.section-card-line-row .webix_template {
  padding: 0 !important;
}

.section-card-title-wrap {
  height: 34px;
  display: flex;
  align-items: center;
  width: 100%;
}

.section-card-title-text {
  flex: 0 0 auto;
  white-space: nowrap;
  overflow: visible;
  padding-right: 10px;
  font-weight: 600;
  font-size: 16px;
}

.section-card-title-line {
  flex: 1 1 auto;
  height: 2px;
  background: #ccc;
}

.webix_multicombo_tag {
  font-style: italic;
}

.webix_placeholder {
  font-size: 16px !important;
}

.webix_segmented .webix_selected:focus,
.webix_segmented .webix_button.webix_selected:focus {
  background-color: var(--ecmr-cloud-color);
  color: var(--ecmr-cloud-textcolor);
  border: none;
}

.ecmr-blockchain-button .webix_button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}

.ecmr-blockchain-button-icon {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0 auto;
}

.ecmr-subsequent-button-icon {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0 auto;
}

.share-input-invalid-wrapper input {
  background-color: #ffe6e6 !important;
  border-color: #d93025 !important;
}

.share-input-invalid-wrapper .webix_inp_static {
  background-color: #ffe6e6 !important;
  border-color: #d93025 !important;
}

.ecmr-google-maps-link {
  display: flex;
  align-items: center;
  height: 100%;
  width: 100%;
  color: #0645ad;
  text-decoration: underline;
  cursor: pointer;
  line-height: normal;
}

.ecmr-google-maps-link:visited {
  color: #0645ad;
}

.ecmr-google-maps-link:hover {
  color: #1a73e8;
  text-decoration: underline;
}

.signature-copy-address-icon {
  cursor: pointer;
}

.signature-copy-address-icon img {
  cursor: pointer;
}

.ecmr-phone-field-label .webix_template {
    padding: 0 0 3px 0 !important;
    margin: 0 !important;
    line-height: 21px !important;
    font-size: 14px;
    text-align: left;
}

/*
 * Signature page company branding
 * --------------------------------
 * These styles are scoped under `.signature-branded-page` so company branding
 * only affects public signature/authentication pages.
 *
 * Do not apply these rules globally:
 * - the main eCMR application must keep the default theme
 * - the topbar user/language controls should keep their original font/icon style
 * - secondary buttons should stay secondary and only use the brand color on hover
 *
 * Runtime branding values are injected as CSS variables from signatures.js:
 * - --signature-brand-primary-color
 * - --signature-brand-text-color
 * - --signature-brand-title-color
 * - --signature-brand-font-family
 * - --signature-brand-font-size
 * - --signature-brand-title-font-size
 *
 * Primary signature actions, selected tabs, links, titles and signature content
 * use these variables. Inactive tabs and normal secondary buttons keep the base
 * eCMR.cloud styling for readability and consistency.
 */
.signature-branded-page,
.signature-branded-popup {
  --signature-brand-primary-color: #cc2027;
  --signature-brand-text-color: #000000;
  --signature-brand-title-color: #cc2027;
  --signature-brand-font-family: Arial, sans-serif;
  --signature-brand-font-size: 14px;
  --signature-brand-title-font-size: 18px;
}

/* Keep this selector narrow so branding does not affect the topbar user/language area. */
.signature-branded-page .view-base-text,
.signature-branded-page .signature-terms-text,
.signature-branded-page .signature-empty-text,
.signature-branded-page .ecmr-signature-multiline-text,
.signature-branded-page .ecmr-signature-info-text,
.signature-branded-page .signature-separated-label-text,
.signature-branded-page .signature-blockchain-help,
.signature-branded-page .signature-fieldset .webix_template {
  color: var(--signature-brand-text-color) !important;
  font-family: var(--signature-brand-font-family) !important;
  font-size: var(--signature-brand-font-size) !important;
}

/* Page titles: Document Info, Signatures, authorization title */
.signature-branded-page .view-title,
.signature-branded-page .view-base-title,
.signature-branded-page .view-section-title,
.signature-branded-page #signingBody .webix_template .view-title,
.signature-branded-page #signingBody .webix_template .view-base-title {
  color: var(--signature-brand-title-color) !important;
  font-family: var(--signature-brand-font-family) !important;
  font-size: var(--signature-brand-title-font-size) !important;
  font-weight: bold !important;
}

/* Signature document details near the truck/cargo icons */
.signature-branded-page .ecmr-signature-multiline-text {
  color: var(--signature-brand-text-color) !important;
}

/* Signature metadata labels: Name, Address, Status, etc. */
.signature-branded-page .signature-fieldset b {
  color: var(--signature-brand-text-color) !important;
  font-family: var(--signature-brand-font-family) !important;
}

/* Tabview headers */
.signature-branded-page .webix_tabbar .webix_item_tab {
  color: var(--signature-brand-text-color) !important;
  font-family: var(--signature-brand-font-family) !important;
  font-size: var(--signature-brand-font-size) !important;
  background-color: #d5d5d5 !important;
  border-color: #d5d5d5 !important;
}

/* Selected tab */
.signature-branded-page .webix_tabbar .webix_item_tab.webix_selected {
  color: #ffffff !important;
  background-color: var(--signature-brand-primary-color) !important;
  border-color: var(--signature-brand-primary-color) !important;
}

/* Buttons */
/* Brand only primary buttons. Secondary/icon buttons must keep their normal base styling. */
.signature-branded-page .webix_el_button:not(.webix_secondary) .webix_button,
.signature-branded-page .webix_el_button:not(.webix_secondary) button {
  background-color: var(--signature-brand-primary-color) !important;
  border-color: var(--signature-brand-primary-color) !important;
  color: #ffffff !important;
  font-family: var(--signature-brand-font-family) !important;
}

/* Links */
.signature-branded-page a,
.signature-branded-page .try-again-event a,
.signature-branded-page .open-terms-link {
  color: var(--signature-brand-primary-color) !important;
}

/* Signature page: secondary buttons stay secondary, but hover uses company primary color */
.signature-branded-page .webix_secondary .webix_button:hover,
.signature-branded-page .webix_secondary .webix_button:focus:hover,
.signature-branded-page .webix_secondary .webix_button:focus-visible:hover,
.signature-branded-page .webix_secondary .webix_button:active:hover,
.signature-branded-page .webix_secondary.webix_focus .webix_button:hover {
  background-color: var(--signature-brand-primary-color) !important;
  color: #ffffff !important;
  outline: var(--ecmr-cloud-outline);
  box-shadow: none;
}

/* Signature tabview */
.signature-branded-page .webix_all_tabs .webix_item_tab:hover {
  background-color: var(--signature-brand-primary-color) !important;
  color: #ffffff !important;
}

.signature-branded-page .webix_all_tabs .webix_item_tab.webix_selected,
.signature-branded-page .webix_all_tabs .webix_item_tab.webix_selected:hover,
.signature-branded-page .webix_all_tabs .webix_item_tab.webix_selected:focus {
  background-color: var(--signature-brand-primary-color) !important;
  border-color: var(--signature-brand-primary-color) !important;
  color: #ffffff !important;
  box-shadow: inset 0 -2px var(--signature-brand-primary-color) !important;
  padding-bottom: 0;
}

/*
 * Signature-branded popup/window
 * --------------------------------
 * Used for popups opened from the public signature page, for example the share
 * overlay. This is intentionally separate from `.signature-branded-page`
 * because Webix windows are rendered outside the main signature layout node.
 */
.signature-branded-popup .webix_win_head,
.signature-branded-popup .webix_popup_title,
.signature-branded-popup .window-header-title {
  color: var(--signature-brand-title-color) !important;
  font-family: var(--signature-brand-font-family) !important;
}

.signature-branded-popup .webix_template,
.signature-branded-popup .webix_el_label,
.signature-branded-popup .webix_inp_label,
.signature-branded-popup input,
.signature-branded-popup textarea {
  color: var(--signature-brand-text-color) !important;
  font-family: var(--signature-brand-font-family) !important;
  font-size: var(--signature-brand-font-size) !important;
}

.signature-branded-popup .webix_el_button:not(.webix_secondary) .webix_button,
.signature-branded-popup .webix_el_button:not(.webix_secondary) button {
  background-color: var(--signature-brand-primary-color) !important;
  border-color: var(--signature-brand-primary-color) !important;
  color: #ffffff !important;
  font-family: var(--signature-brand-font-family) !important;
}

.signature-branded-popup .webix_secondary .webix_button:hover,
.signature-branded-popup .webix_secondary .webix_button:focus:hover,
.signature-branded-popup .webix_secondary .webix_button:focus-visible:hover,
.signature-branded-popup .webix_secondary .webix_button:active:hover,
.signature-branded-popup .webix_secondary.webix_focus .webix_button:hover {
  background-color: var(--signature-brand-primary-color) !important;
  color: #ffffff !important;
  outline: var(--ecmr-cloud-outline);
  box-shadow: none;
}

.signature-branded-popup a {
  color: var(--signature-brand-primary-color) !important;
}

/* Accordion headers inside signature-branded popups */
.signature-branded-popup .webix_accordionitem_header {
  background-color: var(--signature-brand-primary-color) !important;
  border-color: var(--signature-brand-primary-color) !important;
  color: #ffffff !important;
  font-family: var(--signature-brand-font-family) !important;
  font-size: var(--signature-brand-font-size) !important;
  font-weight: 700 !important;
}

.signature-branded-popup .webix_accordionitem_header:hover {
  background-color: var(--signature-brand-primary-color) !important;
  color: #ffffff !important;
}

.signature-branded-page,
.signature-branded-popup {
  --signature-brand-secondary-color: #cccccc;
  --signature-brand-background-color: #ffffff;
}

.signature-branded-page {
  background-color: var(--signature-brand-background-color) !important;
}

.signature-branded-page .webix_view,
.signature-branded-page .webix_template {
  background-color: transparent;
}

.signature-branded-page .webix_tabbar .webix_item_tab {
  color: var(--signature-brand-text-color) !important;
  font-family: var(--signature-brand-font-family) !important;
  font-size: var(--signature-brand-font-size) !important;
  background-color: var(--signature-brand-secondary-color) !important;
  border-color: var(--signature-brand-secondary-color) !important;
}

.signature-branded-page .webix_all_tabs .webix_item_tab {
  background-color: var(--signature-brand-secondary-color) !important;
  border-color: var(--signature-brand-secondary-color) !important;
  color: var(--signature-brand-text-color) !important;
}

.signature-branded-page .webix_secondary .webix_button,
.signature-branded-popup .webix_secondary .webix_button {
  background-color: var(--signature-brand-secondary-color) !important;
  color: #000000 !important;
}

.signature-branded-page {
  background-color: var(--signature-brand-background-color) !important;
}

.signature-branded-page #signingBody,
.signature-branded-page #signingBody > .webix_view,
.signature-branded-page #signingBody .webix_view,
.signature-branded-page #signingBody .webix_template,
.signature-branded-page .webix_layout_clean {
  background-color: var(--signature-brand-background-color) !important;
}

.signature-branded-popup,
.signature-branded-popup .webix_win_body,
.signature-branded-popup .webix_view,
.signature-branded-popup .webix_form,
.signature-branded-popup .webix_template {
  background-color: var(--signature-brand-background-color) !important;
}

.signature-branded-popup .signature-wait-spinner {
  color: var(--signature-brand-primary-color) !important;
}

.signature-branded-page .signature-brand-link,
.signature-branded-popup .signature-brand-link {
  color: var(--signature-brand-primary-color) !important;
}

.signature-branded-page#webauthWindow,
.signature-branded-page #webauthForm,
.signature-branded-page .webix_form,
.signature-branded-page .webix_view {
  background-color: var(--signature-brand-background-color) !important;
}

/* Segmented auth selector inside branded signature/auth pages */
.signature-branded-page .webix_segmented .webix_button,
.signature-branded-popup .webix_segmented .webix_button,
.signature-branded-page .webix_all_segments .webix_segment_0,
.signature-branded-page .webix_all_segments .webix_segment_1,
.signature-branded-page .webix_all_segments .webix_segment_2,
.signature-branded-page .webix_all_segments .webix_segment_3,
.signature-branded-page .webix_all_segments .webix_segment_N,
.signature-branded-popup .webix_all_segments .webix_segment_0,
.signature-branded-popup .webix_all_segments .webix_segment_1,
.signature-branded-popup .webix_all_segments .webix_segment_2,
.signature-branded-popup .webix_all_segments .webix_segment_3,
.signature-branded-popup .webix_all_segments .webix_segment_N {
  background-color: var(--signature-brand-secondary-color) !important;
  border-color: var(--signature-brand-secondary-color) !important;
  color: var(--signature-brand-text-color) !important;
  font-family: var(--signature-brand-font-family) !important;
}

/* Hover */
.signature-branded-page .webix_segmented .webix_button:hover,
.signature-branded-popup .webix_segmented .webix_button:hover,
.signature-branded-page .webix_all_segments .webix_segment_0:hover,
.signature-branded-page .webix_all_segments .webix_segment_1:hover,
.signature-branded-page .webix_all_segments .webix_segment_2:hover,
.signature-branded-page .webix_all_segments .webix_segment_3:hover,
.signature-branded-page .webix_all_segments .webix_segment_N:hover,
.signature-branded-popup .webix_all_segments .webix_segment_0:hover,
.signature-branded-popup .webix_all_segments .webix_segment_1:hover,
.signature-branded-popup .webix_all_segments .webix_segment_2:hover,
.signature-branded-popup .webix_all_segments .webix_segment_3:hover,
.signature-branded-popup .webix_all_segments .webix_segment_N:hover {
  background-color: var(--signature-brand-primary-color) !important;
  border-color: var(--signature-brand-primary-color) !important;
  color: #ffffff !important;
}

/* Selected auth method */
.signature-branded-page .webix_segmented .webix_selected,
.signature-branded-page .webix_segmented .webix_button.webix_selected,
.signature-branded-popup .webix_segmented .webix_selected,
.signature-branded-popup .webix_segmented .webix_button.webix_selected,
.signature-branded-page .webix_all_segments .webix_selected,
.signature-branded-popup .webix_all_segments .webix_selected {
  background-color: var(--signature-brand-primary-color) !important;
  border-color: var(--signature-brand-primary-color) !important;
  color: #ffffff !important;
}

/* Selected hover/focus */
.signature-branded-page .webix_segmented .webix_selected:hover,
.signature-branded-page .webix_segmented .webix_button.webix_selected:hover,
.signature-branded-page .webix_segmented .webix_selected:focus,
.signature-branded-page .webix_segmented .webix_button.webix_selected:focus,
.signature-branded-popup .webix_segmented .webix_selected:hover,
.signature-branded-popup .webix_segmented .webix_button.webix_selected:hover,
.signature-branded-popup .webix_segmented .webix_selected:focus,
.signature-branded-popup .webix_segmented .webix_button.webix_selected:focus {
  background-color: var(--signature-brand-primary-color) !important;
  border-color: var(--signature-brand-primary-color) !important;
  color: #ffffff !important;
}
