:root {
  /* Brand */
  --hb-color-primary: #072673;
  --hb-color-primary-hover: #051d5a;
  --hb-color-accent: #072673;

  /* Text */
  --hb-color-text: #111827;
  --hb-color-muted: #6b7280;
  --hb-color-subtle: #374151;

  /* Surfaces */
  --hb-color-bg: #f6f7fb;
  --hb-color-card: #ffffff;
  --hb-color-border: #e5e7eb;

  /* Typography */
  --hb-font-family: var(--h-font-family, 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
  --hb-font-size-base: clamp(14px, 0.9vw + 10px, 16px);
  --hb-line-height-base: 1.55;

  /* Compatibility aliases requested for tpl-wide standardization */
  --font-base: var(--hb-font-family);
  --color-primary: var(--hb-color-primary);
  --color-accent: var(--hb-color-accent);
  --color-text: var(--hb-color-text);
  --color-muted: var(--hb-color-muted);

  /* Spacing (8px steps) */
  --hb-space-1: 8px;
  --hb-space-2: 16px;
  --hb-space-3: 24px;
  --hb-space-4: 32px;

  /* Radius */
  --hb-radius-sm: 4px;
  --hb-radius-md: 8px;
  --hb-radius-card: 10px;
  --hb-radius-pill: 999px;

  /* Focus */
  --hb-focus-ring: 0 0 0 3px rgba(7, 38, 115, 0.18);

  /* z-index scale */
  --hb-z-dropdown: 1000;
  --hb-z-modal: 1100;
  --hb-z-notification: 1200;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--hb-font-family);
  font-size: var(--hb-font-size-base);
  line-height: var(--hb-line-height-base);
  color: var(--hb-color-text);
  max-width: 100%;
  overflow-x: hidden;
}

html {
  max-width: 100%;
  overflow-x: hidden;
}

@supports (overflow: clip) {
  html,
  body {
    overflow-x: clip;
  }
}

/* Interactive defaults */
a,
button,
.btn,
[role="button"],
input,
select,
textarea,
.nice-select {
  transition: all 0.25s ease-in-out;
}

a:hover,
a:focus {
  text-decoration: none !important;
  border-bottom: 0 !important;
}

a:hover {
  color: var(--hb-color-primary);
}

/* Unified focus treatment */
:where(a, button, .btn, input, select, textarea, .nice-select):focus {
  outline: none;
}

:where(a, button, .btn, input, select, textarea, .nice-select):focus-visible {
  outline: none;
  box-shadow: var(--hb-focus-ring);
}

/* Forms */
:where(input, select, textarea).form-control:focus,
:where(input, select, textarea):focus {
  border-color: var(--hb-color-primary);
  box-shadow: var(--hb-focus-ring);
}

/* z-index layering fixes */
.dropdown-menu {
  z-index: var(--hb-z-dropdown) !important;
}

/* Navbar dropdowns (public + logged-in primary nav)
   The upstream theme hides `.coodiv-menu-dropdown` using opacity/pointer-events and a negative z-index,
   and only reveals it on `:hover` unless the item has a special class.
   Bootstrap toggles `.show` on click/tap, so we explicitly make `.show` visible to fix
   Email/Support menus that were navigating to "#" without revealing the submenu. */
@media (min-width: 992px) {
  .nav-item.dropdown.show > .coodiv-menu-dropdown {
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: var(--hb-z-dropdown) !important;
    top: 90% !important;
  }
  .drop-menu-item.dropdown.show > .coodiv-menu-dropdown {
    opacity: 1 !important;
    pointer-events: auto !important;
    z-index: var(--hb-z-dropdown) !important;
    top: 10px !important;
    transform: translateX(100%) !important;
  }
}
.nice-select .list {
  z-index: var(--hb-z-dropdown) !important;
}
.modal {
  z-index: var(--hb-z-modal) !important;
}
.modal-backdrop {
  z-index: calc(var(--hb-z-modal) - 1) !important;
}

/* Shared motion primitives */
@keyframes hb-fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hb-animate-fade-up {
  animation: hb-fade-up 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

/* Prevent horizontal overflow without hiding content */
img,
svg,
video,
canvas,
iframe,
embed,
object {
  max-width: 100%;
  height: auto;
}

/* Table safety: long values won't break layout */
table th,
table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Scroll-to-top button */
.hb-scrolltop {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--hb-color-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 28px rgba(7, 38, 115, 0.18);
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.hb-scrolltop.is-visible {
  opacity: 0.8;
  pointer-events: auto;
}

.hb-scrolltop:hover,
.hb-scrolltop:focus-visible {
  opacity: 1;
  background: var(--hb-color-primary-hover);
  transform: translateY(-1px);
}
