
:root {
  /* Repointed to Utah DHHS brand tokens (see brand-tokens.css).
     Interactive accents use teal (the DHHS identifier); link/anchor text
     uses navy. Legacy names kept so downstream selectors need no changes. */
  --ecids-purple: var(--brand-secondary);        /* teal #165857 */
  --ecids-purple-dark: var(--brand-secondary-hover); /* teal-05 #0D262E */
  --ecids-teal: var(--brand-secondary);          /* teal #165857 */
  --ecids-navy: var(--brand-primary);            /* navy #071D49 */
  --ecids-ink: #1f2430;
  --ecids-muted: #6b7280;
  --ecids-border: #e1e3e8;
  --ecids-bar-h: 74px;
  --ecids-font: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---- the bar itself ---- */
.ecids-megabar {
  position: relative;              /* positioning context for the full-width panels */
  background: #fff;
  border-bottom: 1px solid var(--ecids-border);
  font-family: var(--ecids-font);
  z-index: 3000;                   /* mega-panels overlay page content */
}

.datepicker.dropdown-menu {
  z-index: 3002 !important;
}
.ecids-megabar__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: var(--ecids-bar-h);
  padding: 8px 28px;
  max-width: 1600px;
  margin: 0 auto;
}

/* ---- logo ---- */
.ecids-megabar__logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
}
.ecids-megabar__logo img,
#design-system-logo {
  height: 52px;
  width: auto;
  display: block;
}

/* ---- pillar row ---- */
.ecids-megabar__nav {
  display: flex;
  align-items: stretch;
  gap: 4px;
  flex-grow: 1;
  min-height: var(--ecids-bar-h);
}
.ecids-pillar {
  position: static;                /* panels resolve against .ecids-megabar */
  display: flex;
  align-items: stretch;
}
.ecids-pillar__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  border: none;
  background: transparent;
  color: var(--ecids-ink);
  font-family: var(--ecids-font);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  border-radius: 0;
}

.ecids-pillar__label::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 4px;
  background: var(--ecids-purple);
  border-top-left-radius: 4px;
  border-top-right-radius: 4px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.ecids-pillar:hover .ecids-pillar__label,
.ecids-pillar:focus-within .ecids-pillar__label {
  color: var(--ecids-purple);
}
.ecids-pillar:hover .ecids-pillar__label::after,
.ecids-pillar:focus-within .ecids-pillar__label::after {
  opacity: 1;
}
.ecids-pillar__label:focus-visible {
  outline: 2px solid var(--ecids-purple);
  outline-offset: -2px;
}
.ecids-pillar__chevron {
  transition: transform 0.18s ease;
}
.ecids-pillar:hover .ecids-pillar__chevron,
.ecids-pillar:focus-within .ecids-pillar__chevron {
  transform: rotate(180deg);
}

/* ---- the full-width mega-menu panel ---- */
.ecids-mega-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: 100%;
  background: #fff;
  border-top: 3px solid var(--ecids-purple);
  box-shadow: 0 14px 28px -12px rgba(10, 12, 74, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  pointer-events: none;
  /* Small delay before hiding so the cursor can travel from the pillar down
     into the panel without the menu snapping shut. */
  transition: opacity 0.18s ease 0.18s, transform 0.18s ease 0.18s,
    visibility 0s linear 0.36s;
  z-index: 3001;
}
/* Invisible "hover bridge" spanning the gap between the bar and the panel.
   It is a descendant of the pillar, so hovering it keeps .ecids-pillar:hover
   true — the cursor never crosses a dead zone on the way to a menu item. */
.ecids-mega-panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -18px;
  height: 18px;
}
.ecids-pillar:hover .ecids-mega-panel,
.ecids-pillar:focus-within .ecids-mega-panel,
.ecids-pillar--open .ecids-mega-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0s;
}
/* After a menu item is clicked, JS adds this class to force the panel shut even
   while the cursor is still over it, so the navigated-to page is visible. The
   class is removed on mouseleave (see mega_menu.js), re-arming hover. */
.ecids-pillar--dismissed .ecids-mega-panel,
.ecids-pillar--dismissed:hover .ecids-mega-panel,
.ecids-pillar--dismissed:focus-within .ecids-mega-panel {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0s;
}
.ecids-mega-panel__inner {
  display: flex;
  gap: 56px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 32px 28px 36px;
}

/* ---- a sub-headed column ---- */
.ecids-mega-col {
  min-width: 200px;
}
.ecids-mega-col__title {
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ecids-border);
  color: var(--ecids-muted);
  font-size: 0.875rem;              /* UDS: nothing below 14px */
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ecids-mega-col__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ecids-mega-col__list li {
  margin: 0 0 12px;
}
.ecids-mega-link {
  color: var(--ecids-navy);
  font-size: 1rem;
  display: inline-block;
  padding: 2px 0;                   /* 24px minimum target height */
  font-weight: 600;
  text-decoration: none;
  line-height: 1.3;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.ecids-mega-link:hover,
.ecids-mega-link:focus-visible {
  color: var(--ecids-purple);
  border-bottom-color: var(--ecids-purple);
}
.ecids-mega-link--external::after {
  content: "\2197";                /* ↗ new-tab hint */
  font-size: 0.75em;
  margin-left: 4px;
  vertical-align: text-top;
  color: var(--ecids-muted);
}

/* ---- right-aligned actions ---- */
.ecids-megabar__actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
  margin-left: auto;
}
.ecids-megabar__request {
  color: var(--ecids-ink);
  font-size: 0.875rem;              /* UDS: nothing below 14px */
  display: inline-block;
  padding: 6px 0;                   /* 24px minimum target height */
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.ecids-megabar__request:hover,
.ecids-megabar__request:focus-visible {
  color: var(--ecids-purple);
  border-bottom-color: var(--ecids-purple);
}

/* Login output (login_panel): a "Login" link when logged out, a user dropdown
   when logged in. Style both as a brand purple button. */
.ecids-megabar__login .nav-link,
.ecids-megabar__login .dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: var(--ecids-purple);
  color: #fff !important;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 4px;
  white-space: nowrap;
  border: none;
}
.ecids-megabar__login .nav-link:hover,
.ecids-megabar__login .dropdown-toggle:hover,
.ecids-megabar__login .nav-link:focus-visible,
.ecids-megabar__login .dropdown-toggle:focus-visible {
  background: var(--ecids-purple-dark);
  color: #fff !important;
}
.ecids-megabar__login .dropdown-toggle::after {
  border-top-color: #fff;          /* caret visible on purple */
}
.ecids-megabar__login .dropdown-menu {
  border: 1px solid var(--ecids-border);
  box-shadow: 0 8px 24px rgba(10, 12, 74, 0.14);
}
.ecids-megabar__login .dropdown-item.active,
.ecids-megabar__login .dropdown-item:active {
  background-color: var(--ecids-purple);
  color: #fff;
}
.ecids-megabar__login .dropdown-header {
  font-weight: 700;
  color: var(--ecids-muted);
}

/* ---- responsive: below the desktop breakpoint, let the bar wrap and the
        mega-panels open as full-width blocks under a shrunk row ---- */
@media (max-width: 1100px) {
  .ecids-megabar__inner {
    flex-wrap: wrap;
    gap: 16px;
    padding: 8px 16px;
  }
  .ecids-megabar__nav {
    order: 3;
    width: 100%;
    flex-wrap: wrap;
    min-height: 0;
    gap: 0;
  }
  .ecids-pillar {
    flex: 1 1 auto;
  }
  .ecids-pillar__label {
    width: 100%;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--ecids-border);
  }
  .ecids-pillar__label::after {
    display: none;
  }
  .ecids-mega-panel__inner {
    flex-wrap: wrap;
    gap: 28px;
    padding: 20px 16px 24px;
  }
  .ecids-megabar__actions {
    margin-left: 0;
  }
}
