/*
 * Shared flash/toast presentation, promoted unchanged from application.css.
 * Rendered by app/views/shared/_flash_messages.html.erb.
 */

.app-flashes {
  position: fixed;
  top: 154px;
  left: 50%;
  z-index: 80;
  width: min(calc(100% - 32px), 620px);
  display: grid;
  gap: 10px;
  transform: translateX(-50%);
  pointer-events: none;
}

@media (min-width: 761px) {
  .app-flashes {
    top: 78px;
  }
}

.app-flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px 14px 18px;
  border: 1px solid;
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(36, 31, 89, 0.18);
  line-height: 1.4;
  pointer-events: auto;
  animation: app-flash-enter 240ms ease-out both;
}

.app-flash--leaving {
  animation: app-flash-leave 200ms ease-in both;
}

.app-flash__message {
  min-width: 0;
}

.app-flash__dismiss {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: currentColor;
  font-size: 1.25rem;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 999px;
}

.app-flash__dismiss:hover {
  background: rgba(36, 31, 89, 0.08);
}

.app-flash__dismiss:focus-visible {
  outline: 3px solid rgba(157, 124, 55, 0.45);
  outline-offset: 2px;
}

@keyframes app-flash-enter {
  from {
    opacity: 0;
    transform: translateY(-24px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes app-flash-leave {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(-16px) scale(0.98);
  }
}

.app-flash--alert {
  color: var(--color-alert-text);
  background: var(--color-alert-bg);
  border-color: var(--color-alert-border);
}

.app-flash--notice {
  color: var(--color-notice-text);
  background: var(--color-notice-bg);
  border-color: var(--color-notice-border);
}
