/*
 * Global Alert Toast v27.08.11.5.317.0
 * Every element with id="global-alert" is rendered as the same floating
 * notification toast. This file is intentionally loaded LAST by View::head()
 * so page-specific legacy #global-alert rules cannot turn it back into an
 * inline/full-width banner.
 */

body #global-alert.hidden {
  display: none !important;
}

body #global-alert:not(.hidden) {
  position: fixed !important;
  top: 86px !important;
  right: 24px !important;
  bottom: auto !important;
  left: auto !important;
  z-index: 2147482000 !important;
  display: block !important;
  box-sizing: border-box !important;
  width: min(520px, calc(100vw - 48px)) !important;
  min-width: 0 !important;
  max-width: 520px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 1px solid #d5e2f0 !important;
  border-radius: 15px !important;
  background: #ffffff !important;
  box-shadow: 0 16px 38px rgba(25, 45, 72, .20) !important;
  overflow: hidden !important;
  opacity: 1;
  transform: translateY(0);
  animation: hd-global-toast-in .20s ease-out;
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: auto !important;
}

/* Landing pages have the blue top bar + secondary navigation. */
body.landing-page #global-alert:not(.hidden) {
  top: 174px !important;
}

body.login-page #global-alert:not(.hidden) {
  top: 24px !important;
}

body #global-alert:not(.hidden).is-leaving {
  opacity: 0 !important;
  transform: translateY(-8px) !important;
  pointer-events: none !important;
}

body #global-alert.error:not(.hidden) {
  border-color: #f0b7bc !important;
  background: linear-gradient(180deg, #fff8f8 0%, #ffffff 100%) !important;
}

body #global-alert.success:not(.hidden) {
  border-color: #abd8bb !important;
  background: linear-gradient(180deg, #f6fdf8 0%, #ffffff 100%) !important;
}

body #global-alert.warning:not(.hidden) {
  border-color: #efcf96 !important;
  background: linear-gradient(180deg, #fffaf0 0%, #ffffff 100%) !important;
}

body #global-alert.info:not(.hidden) {
  border-color: #b7d4ef !important;
  background: linear-gradient(180deg, #f7fbff 0%, #ffffff 100%) !important;
}

body #global-alert:not(.hidden) .notification-message {
  position: relative !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 14px !important;
  box-sizing: border-box !important;
  min-height: 116px !important;
  margin: 0 !important;
  padding: 18px 18px 15px !important;
  background: transparent !important;
}

body #global-alert:not(.hidden) .notification-message__icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 44px !important;
  width: 44px !important;
  height: 44px !important;
  margin: 0 !important;
  border-radius: 50% !important;
  font-size: 22px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}

body #global-alert.error:not(.hidden) .notification-message__icon {
  background: #feeaec !important;
  color: #c53442 !important;
}

body #global-alert.success:not(.hidden) .notification-message__icon {
  background: #e6f7ed !important;
  color: #16814d !important;
}

body #global-alert.warning:not(.hidden) .notification-message__icon {
  background: #fff1d5 !important;
  color: #b87400 !important;
}

body #global-alert.info:not(.hidden) .notification-message__icon {
  background: #e8f2ff !important;
  color: #226dd4 !important;
}

body #global-alert:not(.hidden) .notification-message__body {
  position: relative !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

body #global-alert:not(.hidden) .notification-message__title {
  margin: 0 0 4px !important;
  padding: 0 34px 0 0 !important;
  font-size: 17px !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
}

body #global-alert.error:not(.hidden) .notification-message__title {
  color: #b62d39 !important;
}

body #global-alert.success:not(.hidden) .notification-message__title {
  color: #157245 !important;
}

body #global-alert.warning:not(.hidden) .notification-message__title {
  color: #9c6700 !important;
}

body #global-alert.info:not(.hidden) .notification-message__title {
  color: #1f61bc !important;
}

body #global-alert:not(.hidden) .notification-message__text,
body #global-alert:not(.hidden) .notification-message__body .alert-message {
  margin: 0 !important;
  padding: 0 12px 0 0 !important;
  color: #536781 !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
  overflow-wrap: anywhere !important;
}

body #global-alert:not(.hidden) .notification-message__close,
body #global-alert:not(.hidden) .alert-close {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 30px !important;
  height: 30px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 9px !important;
  background: transparent !important;
  color: #5d7188 !important;
  font-size: 20px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  box-shadow: none !important;
}

body #global-alert:not(.hidden) .notification-message__close:hover,
body #global-alert:not(.hidden) .notification-message__close:focus-visible,
body #global-alert:not(.hidden) .alert-close:hover,
body #global-alert:not(.hidden) .alert-close:focus-visible {
  background: #eef4fb !important;
  color: #1f3352 !important;
  outline: none !important;
  transform: none !important;
}

body #global-alert:not(.hidden) .notification-message__timer {
  height: 4px !important;
  margin: 18px 122px 0 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: 999px !important;
  background: #e9eef4 !important;
}

body #global-alert:not(.hidden) .notification-message__timer-bar {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: inherit !important;
  transform-origin: left center !important;
  animation: hd-global-toast-progress 10s linear forwards !important;
}

body #global-alert.error:not(.hidden) .notification-message__timer-bar {
  background: #e62f4b !important;
}

body #global-alert.success:not(.hidden) .notification-message__timer-bar {
  background: #1d9b5f !important;
}

body #global-alert.warning:not(.hidden) .notification-message__timer-bar {
  background: #d89614 !important;
}

body #global-alert.info:not(.hidden) .notification-message__timer-bar {
  background: #2f80d8 !important;
}

body #global-alert:not(.hidden) .notification-message__countdown {
  position: absolute !important;
  right: 18px !important;
  bottom: 13px !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #536781 !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}

@keyframes hd-global-toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hd-global-toast-progress {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@media (max-width: 720px) {
  body #global-alert:not(.hidden),
  body.landing-page #global-alert:not(.hidden),
  body.login-page #global-alert:not(.hidden) {
    top: 84px !important;
    right: 12px !important;
    left: auto !important;
    width: calc(100vw - 24px) !important;
    max-width: none !important;
  }

  body #global-alert:not(.hidden) .notification-message {
    min-height: 126px !important;
    padding: 16px 14px 14px !important;
  }

  body #global-alert:not(.hidden) .notification-message__timer {
    margin-right: 0 !important;
    margin-bottom: 24px !important;
  }

  body #global-alert:not(.hidden) .notification-message__countdown {
    right: auto !important;
    bottom: 11px !important;
    left: 72px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body #global-alert:not(.hidden) {
    animation: none !important;
    transition: none !important;
  }

  body #global-alert:not(.hidden) .notification-message__timer-bar {
    animation: none !important;
  }
}

/* v27.08.11.5.317.2 - Prevent generic background HTTP 5xx alerts from flashing
   before the global error gate clears them. Explicit/user-action failures are
   not assigned this body class and continue to use the normal toast UI. */
body.hd-suppress-generic-api-error #global-alert:not(.hidden) {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
