/* Shared raised-surface treatment for the hotel and police applications. */
:root {
  --surface-3d-edge: rgba(15, 35, 55, 0.12);
  --surface-3d-shadow: rgba(15, 35, 55, 0.18);
}

/* Keep the legal footer visually aligned with the dark dashboard hero. */
#appLegalFooter {
  border-color: rgba(148, 197, 221, 0.2) !important;
  background: linear-gradient(135deg, #0b1824 0%, #17324a 62%, #25618d 100%) !important;
  color: rgba(255, 255, 255, 0.78) !important;
}

#appLegalFooter > .flex p,
#appLegalFooter p:first-child {
  color: #ffffff !important;
}

#appLegalFooter a {
  border-color: rgba(255, 255, 255, 0.2) !important;
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  transition: background-color 180ms ease, transform 180ms ease;
}

#appLegalFooter a:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
  transform: translateY(-2px);
}

/* Buttons sit on a visible base and depress when pressed. */
main button:not(.three-d-surface-exempt),
main a.inline-flex[class*="rounded"]:not(.three-d-surface-exempt) {
  position: relative;
  transform: translateY(0);
  box-shadow: 0 5px 0 rgba(15, 35, 55, 0.28), 0 10px 18px rgba(15, 35, 55, 0.16) !important;
  transition: transform 130ms ease, box-shadow 130ms ease, filter 130ms ease !important;
}

main button:not(:disabled):not(.three-d-surface-exempt):hover,
main a.inline-flex[class*="rounded"]:not(.three-d-surface-exempt):hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 7px 0 rgba(15, 35, 55, 0.28), 0 15px 24px rgba(15, 35, 55, 0.2) !important;
}

main button:not(:disabled):not(.three-d-surface-exempt):active,
main a.inline-flex[class*="rounded"]:not(.three-d-surface-exempt):active {
  transform: translateY(4px) scale(0.985) !important;
  filter: brightness(0.96);
  box-shadow: 0 1px 0 rgba(15, 35, 55, 0.28), 0 3px 8px rgba(15, 35, 55, 0.14) !important;
}

main button:disabled {
  box-shadow: none !important;
}

main :is(div, section, article, aside, footer, a)[class*="rounded"][class*="bg-"]:not(.three-d-surface-exempt) {
  position: relative;
  isolation: isolate;
  transform: translateZ(0);
  box-shadow: 0 7px 0 var(--surface-3d-edge), 0 18px 34px var(--surface-3d-shadow) !important;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

main :is(div, section, article, aside, footer, a)[class*="rounded"][class*="bg-"]:not(.three-d-surface-exempt):hover {
  transform: translateY(-5px) translateZ(0);
  box-shadow: 0 11px 0 var(--surface-3d-edge), 0 28px 42px rgba(15, 35, 55, 0.22) !important;
}

/* Hotel home task cards: a more pronounced interactive 3D treatment. */
#taskPagesGrid > :is(a, article) {
  display: block;
  overflow: hidden;
  border-color: rgba(86, 125, 158, 0.42) !important;
  background: linear-gradient(145deg, #ffffff 0%, #f4f9fd 100%) !important;
  box-shadow: 0 9px 0 rgba(28, 67, 97, 0.2), 0 22px 36px rgba(15, 47, 83, 0.2) !important;
  transform: perspective(900px) translateZ(0);
  transform-style: preserve-3d;
  transition: transform 220ms cubic-bezier(.2, .75, .25, 1), box-shadow 220ms ease, border-color 220ms ease !important;
}

#taskPagesGrid > :is(a, article)::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(137, 207, 230, 0.28) 48%, rgba(25, 91, 134, 0.08));
  transition: opacity 220ms ease;
}

#taskPagesGrid > :is(a, article) > * {
  position: relative;
  z-index: 1;
}

#taskPagesGrid > :is(a, article):hover {
  z-index: 2;
  border-color: #2b7ca8 !important;
  transform: perspective(900px) translateY(-10px) rotateX(2deg) rotateY(-1deg) !important;
  box-shadow: 0 15px 0 rgba(28, 67, 97, 0.22), 0 34px 48px rgba(15, 47, 83, 0.27) !important;
}

#taskPagesGrid > :is(a, article):hover::before {
  opacity: 1;
}

#taskPagesGrid > :is(a, article):active {
  transform: perspective(900px) translateY(2px) !important;
  box-shadow: 0 4px 0 rgba(28, 67, 97, 0.2), 0 10px 20px rgba(15, 47, 83, 0.18) !important;
}

main :is(a, button):focus-visible {
  outline: 3px solid rgba(31, 59, 87, 0.45);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  main :is(div, section, article, aside, footer, a)[class*="rounded"][class*="bg-"]:not(.three-d-surface-exempt) {
    transition: none;
  }

  main :is(div, section, article, aside, footer, a)[class*="rounded"][class*="bg-"]:not(.three-d-surface-exempt):hover {
    transform: translateZ(0);
  }

  #taskPagesGrid > :is(a, article),
  #taskPagesGrid > :is(a, article):hover,
  #taskPagesGrid > :is(a, article):active {
    transform: translateZ(0) !important;
  }

  main button:not(.three-d-surface-exempt),
  main a.inline-flex[class*="rounded"]:not(.three-d-surface-exempt),
  main button:not(:disabled):not(.three-d-surface-exempt):hover,
  main a.inline-flex[class*="rounded"]:not(.three-d-surface-exempt):hover,
  main button:not(:disabled):not(.three-d-surface-exempt):active,
  main a.inline-flex[class*="rounded"]:not(.three-d-surface-exempt):active {
    transform: none !important;
    transition: none !important;
  }
}
