* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family:
    "Poppins",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
}

body {
  font-family:
    "Poppins",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: anywhere;
}

img,
video,
iframe {
  max-width: 100%;
}

:focus-visible {
  outline: 3px solid #d9534f;
  outline-offset: 3px;
}

.top-bar {
  background-color: #0d1b2a;
  color: #f3f4f6;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 600;
  padding: 7px clamp(12px, 4vw, 32px);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  letter-spacing: 0.04em;
}

.site-header {
  background: #ffffff;
  position: relative;
  border-bottom: 3px solid #d9534f;
  padding: clamp(10px, 2vw, 12px) clamp(12px, 4vw, 32px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(10px, 2vw, 18px);
}

@media (min-width: 1201px) {
  .site-header {
    display: grid;
    grid-template-columns: minmax(250px, 1fr) auto minmax(250px, 1fr);
    align-items: center;
  }

  .brand-container {
    justify-self: start;
  }

  .nav-capsule {
    justify-self: center;
  }

  .auth-actions {
    justify-self: end;
  }
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  flex: 1 1 250px;
  min-width: min(100%, 250px);
}

.header-menu-toggle {
  display: none;
  width: 42px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(217, 83, 79, 0.35);
  border-radius: 5px;
  background: rgba(255, 248, 247, 0.72);
  box-shadow:
    0 8px 22px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
}

.header-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: #d9534f;
  transition:
    transform 0.18s ease,
    opacity 0.18s ease;
}

.logo-box {
  width: clamp(42px, 6vw, 55px);
  height: clamp(42px, 6vw, 55px);
  border-radius: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-box img {
  width: 100%;
  object-fit: contain;
}

.brand-titles h1 {
  font-size: clamp(13px, 1.8vw, 15.5px);
  font-weight: 700;
  color: #d9534f;
  line-height: 1.2;
}

.brand-titles p {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: #4c5059;
  margin-top: 2px;
}

.brand-title-compact {
  display: none;
}

@media (max-width: 450px) {
  .brand-title-full {
    display: none;
  }
  .brand-title-compact {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    gap: 2px;
  }

  .brand-title-compact > span:first-child {
    color: #d9534f;
    font: inherit;
  }

  .brand-title-compact > span:last-child {
    color: #4c5059;
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0;
  }

  .brand-titles p {
    display: none;
  }
}

.nav-capsule {
  background-color: #f8fafc;
  border: 1.5px solid #b4b8be;
  border-radius: 9999px;
  padding: 4px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
  flex: 0 1 auto;
  width: min(100%, 700px);
  overflow-x: visible;
  scrollbar-width: thin;
}

.nav-capsule .nav-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  background-color: #d9534f;
  border-radius: 9999px;
  box-shadow: 0 1px 3px rgba(217, 83, 79, 0.25);
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition:
    left 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.2s ease;
}

.nav-capsule .nav-indicator.visible {
  opacity: 1;
}

.nav-capsule a {
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  padding: 6px clamp(8px, 1vw, 13px);
  border-radius: 9999px;
  position: relative;
  z-index: 2;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.nav-capsule a:hover {
  color: #d9534f;
}

.nav-capsule a.active {
  color: #ffffff !important;
  font-weight: 600;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 1 auto;
  flex-wrap: wrap;
}

.btn-signin {
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  color: #374151;
  padding: 8px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  transition: background 0.15s ease;
}

.btn-signin:hover {
  background: #f9fafb;
}

.btn-register {
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  color: #ffffff;
  background-color: #d9534f;
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid #d9534f;
  transition: background 0.15s ease;
}

.btn-register:hover {
  background-color: #c14440;
}

.user-greeting-badge {
  font-size: 12.5px;
  font-weight: 600;
  color: #1e293b;
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 6px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}

.user-greeting-badge:hover {
  background-color: #fee2e2;
  border-color: #d9534f;
  color: #d9534f;
}

.btn-logout {
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  color: #dc2626;
  background-color: #fef2f2;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid #fecaca;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-logout:hover {
  background-color: #fee2e2;
  border-color: #f87171;
}

.mobile-menu-panel {
  display: contents;
}

/* Collapse before the full navigation can crowd the brand and account
           controls. The menu remains comfortable on tablets and compact laptops. */
@media (max-width: 1200px) {
  .site-header {
    align-items: center;
  }

  .header-menu-toggle {
    display: grid;
    margin-left: auto;
  }

  .nav-capsule {
    display: none;
  }

  .auth-actions {
    display: none;
  }

  .site-header.menu-open .nav-capsule {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow: visible;
    border-radius: 10px;
  }

  .mobile-menu-panel {
    display: none;
  }

  .site-header.menu-open .mobile-menu-panel {
    display: block;
    position: absolute;
    top: 100%;
    right: clamp(12px, 4vw, 32px);
    z-index: 10;
    width: max-content;
    min-width: 235px;
    max-width: min(360px, calc(100vw - 24px));
    padding: 8px;
    border: 1px solid rgba(180, 184, 190, 0.7);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.62);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  /* The desktop indicator spans the full capsule height. Wrapped mobile
               links need their own active background instead. */
  .site-header.menu-open .nav-capsule .nav-indicator {
    display: none;
  }

  .site-header.menu-open .auth-actions {
    display: flex;
    width: 100%;
    margin-left: 0;
    padding: 10px 4px 2px;
    border-top: 1px solid rgba(180, 184, 190, 0.65);
    justify-content: flex-start;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 0 0 7px 7px;
  }

  .site-header.menu-open .nav-capsule a {
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border-radius: 6px;
  }

  .site-header.menu-open .nav-capsule a.active {
    background: #d9534f;
    border-radius: 9999px;
    color: #ffffff !important;
  }

  .site-header.menu-open .header-menu-toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .site-header.menu-open .header-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .site-header.menu-open .header-menu-toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }
}
.user-header-notifications .admin-notif-bell-btn {
  color: #d9534f;
  border: 2px solid #d9534f;
  background: #ffffff;
  box-shadow: 0 5px 16px rgba(217, 83, 79, 0.08);
}

.user-header-notifications .admin-notif-bell-btn:hover {
  color: #b83f3b;
  border-color: #d9534f;
}

.user-header-notifications .admin-notif-panel {
  border-color: rgba(217, 83, 79, 0.22);
}

/* Keep the citizen notification bell visible when the navigation collapses. */
@media (max-width: 1200px) {
  .site-header:not(.menu-open) .mobile-menu-panel {
    display: contents;
  }

  .site-header > .user-header-notifications {
    position: absolute;
    top: 50%;
    right: clamp(68px, 8vw, 88px);
    transform: translateY(-50%);
    z-index: 1065;
  }

  .site-header:not(.menu-open) .auth-actions {
    display: flex;
    position: absolute;
    top: 50%;
    right: clamp(68px, 8vw, 88px);
    transform: translateY(-50%);
    margin: 0;
    padding: 0;
    pointer-events: none;
    z-index: 12;
  }

  .site-header:not(.menu-open)
    .auth-actions
    > :not(.user-header-notifications) {
    display: none;
  }

  .site-header:not(.menu-open) .user-header-notifications {
    pointer-events: auto;
  }

  .site-header.menu-open .user-header-notifications {
    position: absolute !important;
    top: 50% !important;
    right: clamp(68px, 8vw, 88px) !important;
    transform: translateY(-50%) !important;
    z-index: 1065 !important;
  }

  .user-header-notifications .admin-notif-bell-btn {
    width: 46px;
    height: 46px;
    border-width: 2px;
    font-size: 1.2rem;
    box-shadow: 0 5px 16px rgba(217, 83, 79, 0.2);
  }

  .user-header-notifications .admin-notif-bell-btn.has-unread {
    animation: user-bell-pulse 1.8s ease-in-out infinite;
  }
}

@keyframes user-bell-pulse {
  0%,
  100% {
    box-shadow: 0 5px 16px rgba(217, 83, 79, 0.2);
  }
  50% {
    box-shadow: 0 5px 22px rgba(217, 83, 79, 0.48);
  }
}
