:root {
  --nav-height: 60px;
}

body {
  padding-top: var(--nav-height);
  min-height: 100%;
}

#tagbody {
  position: relative;
  min-height: 100vh;
  padding-left: 2px;
  padding-right: 2px;
  overflow-x: hidden;
}

.vh-4 {
  height: var(--nav-height);
}

.fixed-top {
  position: fixed;
  top: 0;
  width: 100%;
}

/* Mobile/Tablet: push offcanvas menu below the fixed navbar */
@media (max-width: 991.98px) {

  #divmenu.offcanvas,
  #divmenu.offcanvas-start,
  #divmenu.offcanvas-lg {
    top: var(--nav-height);
    height: calc(100vh - var(--nav-height));
  }
}

.message-bubble {
  background-color: #f1f1f1;
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
  max-width: 95%;
}

.message-bubble.right {
  background-color: #f1f1f1;
  margin-left: 20px;
}

.message-bubble.left {
  background-color: #e2f2ff;
  margin-left: 2px;
}

h2 {
  font-size: 24px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 8px;
  margin-top: 8px;
}

h4 {
  font-size: 19px;
  line-height: 1.375em;
  color: #303030;
  font-weight: 400;
  margin-bottom: 8px;
  margin-top: 8px;
}

.bg-grey {
  background-color: #f6f6f6;
}

.overmi {
  overflow: visible;
}

.lista-sovrapposta {
  position: absolute;
  top: 33.3vh;
  left: 0;
  width: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  z-index: 2;
}

.bg-border-grey {
  border-color: #a6a9bd;
}

.bg-menu-grey {
  background-color: #1e31a8 !important;
  color: #ffffff !important;
  border-color: #1e31a8 !important;
}

.bg-blum {
  background-color: #1e31a8 !important;
  color: #ffffff !important;
}

.btn-custom {
  background-color: #1e31a8 !important;
  color: #ffffff !important;
  border-color: #1e31a8 !important;
  border-radius: 0 !important;
}

/* Enforce straight buttons and white text in navbar/menu */
nav.navbar .btn,
#divmenu .btn {
  border-radius: 0 !important;
  color: #ffffff !important;
}

.btn-custom:hover {
  background-color: #142280;
  border-color: #142280;
  color: #ffffff;
}

.no-caret::after {
  display: none !important;
}

.wheight {
  min-height: 800px;
}

.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  border: 8px solid #f3f3f3;
  border-top: 8px solid #3498db;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

#global-message {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
}

#global-message-box {
  padding: 16px 28px;
  border-radius: 8px;
  color: white;
  font-size: 18px;
  background-color: #2ecc71;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  animation: fadeInSlide 0.3s ease;
  text-align: center;
  min-width: 200px;
}

.message-success {
  background-color: #2ecc71;
}

.message-error {
  background-color: #e74c3c;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Fix desktop menu colors and styles */
#divmenu a {
  color: #ffffff !important;
  text-decoration: none;
}

#divmenu a:hover {
  color: #f1f1f1 !important;
}

#divmenu .dropdown-menu {
  border-radius: 0 !important;
  background-color: #1e31a8 !important;
  border: 1px solid white;
  padding: 0;
}

#divmenu .dropdown-item {
  color: #ffffff !important;
  /* padding is normalized below for compact menu */
}

/* Make dropdown menus more compact (navbar + offcanvas menu) */
.dropdown-menu {
  --bs-dropdown-padding-y: 0.15rem;
  --bs-dropdown-item-padding-y: 0.25rem;
  --bs-dropdown-item-padding-x: 0.75rem;
  font-size: 0.95rem;
}

/* Specific menu tweaks */
#divmenu .dropdown-item,
nav.navbar .dropdown-item {
  padding-top: 1px;
  padding-bottom: 1px;
  padding-left: 6px;
  padding-right: 6px;
  line-height: 1.1;
}

/* Reduce vertical spacing between list items inside dropdown */
nav.navbar .dropdown-menu li {
  margin: 0;
}

/* Compact button group in navbar */
nav.navbar .btn-group .btn {
  padding: 0.25rem 0.5rem;
}

/* Menu spacing: keep items close, but readable (8px between voices) */
#divmenu .menu-root {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0;
  /* small inner padding; prevents sticking to edge */
}

/* Remove extra margins that can be introduced by wrappers */
#divmenu .menu-entry {
  margin: 0;
}

/* Make menu “buttons/links” compact (reduce default bootstrap padding) */
#divmenu .btn,
#divmenu .dropdown-item {
  padding-top: 1px;
  padding-bottom: 1px;
}

/* Ensure links look like full-width menu items without extra left spacing */
#divmenu a.dropdown-item.menu-item {
  margin-left: 0 !important;
  padding-left: 6px;
}

#divmenu .dropdown-item:hover {
  background-color: #ffffff !important;
  color: #1e31a8 !important;
}

/* diform: sfondo bianco con logo IA-CATO come watermark */
#diform {
  background-color: #ffffff;
  position: relative;
}

#diform::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('/static/img/logo%20iacato-03.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 66%;
  opacity: 0.07;
  pointer-events: none;
  z-index: 0;
}